Skip to content

Commit 221d654

Browse files
committed
Merge tag 'drm-intel-next-2023-11-23' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
drm/i915 feature pull for v6.8: Features and functionality: - Major DP MST improvements on bandwidth management, DSC (Imre, Stan, Ville) - DP panel replay enabling (Animesh, Jouni) - MTL C20 phy state verification (Mika) - MTL DP DSC fractional bpp support (Ankit, Vandita, Swati, Imre) - Audio fastset support (Ville) Refactoring and cleanups: - Use dma fence interfaces instead of i915_sw_fence (Jouni) - Separate gem and display code (Jouni, Juha-Pekka) - AUX register macro refactoring (Jani) - Separate display module/device parameters from the rest (Jouni) - Move display capabilities debugfs under display (Vinod) - Makefile cleanup (Jani) - Register cleanups (Ville) - Enginer iterator cleanups (Tvrtko) - Move display lock inits under display/ (Jani) - VLV/CHV DPIO PHY register and interface refactoring (Jani) - DSI VBT sequence refactoring (Jani, Andy Shevchenko) - C10/C20 PHY PLL hardware readout and calculation abstractions (Lucas) - DPLL code cleanups (Ville) - Cleanup PXP plane protection checks (Jani) Fixes: - Replace VLV/CHV DSI GPIO direct access with proper GPIO API usage (Andy Shevchenko) - Fix VLV/CHV DSI GPIO wrong initial value (Hans de Goede) - Fix UHBR data, link M/N/TU and PBN values (Imre) - Fix HDCP state on an enable/disable cycle (Suraj) - Fix DP MST modeset sequence to be according to spec (Ville) - Improved atomicity for multi-pipe commits (Ville) - Update URLs in i915 MAINTAINERS entry and code (Jani) - Check for VGA converter presence in eDP probe (Ville) - Fix surface size checks (Ville) - Fix LNL port/phy assignment (Lucas) - Reset C10/C20 message bus harder to avoid sporadic failures (Mika) - Fix bogus VBT HDMI level shift on BDW (Ville) - Add workaround for LNL underruns when enabling FBC (Vinod) - DSB refactoring (Animesh) - DPT refactoring (Juha-Pekka) - Disable DSC on DP MST on ICL (Imre) - Fix PSR VSC packet setup timing (Mika) - Fix LUT rounding and conversions (Ville) DRM core display changes: - DP MST fixes, helpers, refactoring to support bandwidth management (Imre) - DP MST PBN divider value refactoring and fixes (Imre) - DPCD register definitions (Ankit, Imre) - Add helper to get DSC bpp precision (Ankit) - Fix color LUT rounding (Ville) From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87v89sl2ao.fsf@intel.com [sima: Some conflicts in the amdgpu dp mst code] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2 parents b26ca73 + deac453 commit 221d654

116 files changed

Lines changed: 4397 additions & 1962 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10645,9 +10645,9 @@ M: Rodrigo Vivi <rodrigo.vivi@intel.com>
1064510645
M: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
1064610646
L: intel-gfx@lists.freedesktop.org
1064710647
S: Supported
10648-
W: https://01.org/linuxgraphics/
10648+
W: https://drm.pages.freedesktop.org/intel-docs/
1064910649
Q: http://patchwork.freedesktop.org/project/intel-gfx/
10650-
B: https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs
10650+
B: https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html
1065110651
C: irc://irc.oftc.net/intel-gfx
1065210652
T: git git://anongit.freedesktop.org/drm-intel
1065310653
F: Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include <drm/drm_atomic_uapi.h>
8686
#include <drm/drm_atomic_helper.h>
8787
#include <drm/drm_blend.h>
88+
#include <drm/drm_fixed.h>
8889
#include <drm/drm_fourcc.h>
8990
#include <drm/drm_edid.h>
9091
#include <drm/drm_eld.h>
@@ -6910,8 +6911,8 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
69106911
if (IS_ERR(mst_state))
69116912
return PTR_ERR(mst_state);
69126913

6913-
if (!mst_state->pbn_div)
6914-
mst_state->pbn_div = dm_mst_get_pbn_divider(aconnector->mst_root->dc_link);
6914+
if (!mst_state->pbn_div.full)
6915+
mst_state->pbn_div.full = dfixed_const(dm_mst_get_pbn_divider(aconnector->mst_root->dc_link));
69156916

69166917
if (!state->duplicated) {
69176918
int max_bpc = conn_state->max_requested_bpc;
@@ -6923,7 +6924,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
69236924
max_bpc);
69246925
bpp = convert_dc_color_depth_into_bpc(color_depth) * 3;
69256926
clock = adjusted_mode->clock;
6926-
dm_new_connector_state->pbn = drm_dp_calc_pbn_mode(clock, bpp, false);
6927+
dm_new_connector_state->pbn = drm_dp_calc_pbn_mode(clock, bpp << 4);
69276928
}
69286929

69296930
dm_new_connector_state->vcpi_slots =

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <drm/drm_probe_helper.h>
3232
#include <drm/amdgpu_drm.h>
3333
#include <drm/drm_edid.h>
34+
#include <drm/drm_fixed.h>
3435

3536
#include "dm_services.h"
3637
#include "amdgpu.h"
@@ -210,7 +211,7 @@ static void dm_helpers_construct_old_payload(
210211
struct drm_dp_mst_atomic_payload *old_payload)
211212
{
212213
struct drm_dp_mst_atomic_payload *pos;
213-
int pbn_per_slot = mst_state->pbn_div;
214+
int pbn_per_slot = dfixed_trunc(mst_state->pbn_div);
214215
u8 next_payload_vc_start = mgr->next_start_slot;
215216
u8 payload_vc_start = new_payload->vc_start_slot;
216217
u8 allocated_time_slots;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <drm/display/drm_dp_mst_helper.h>
2828
#include <drm/drm_atomic.h>
2929
#include <drm/drm_atomic_helper.h>
30+
#include <drm/drm_fixed.h>
3031
#include "dm_services.h"
3132
#include "amdgpu.h"
3233
#include "amdgpu_dm.h"
@@ -941,10 +942,10 @@ static int increase_dsc_bpp(struct drm_atomic_state *state,
941942
link_timeslots_used = 0;
942943

943944
for (i = 0; i < count; i++)
944-
link_timeslots_used += DIV_ROUND_UP(vars[i + k].pbn, mst_state->pbn_div);
945+
link_timeslots_used += DIV_ROUND_UP(vars[i + k].pbn, dfixed_trunc(mst_state->pbn_div));
945946

946947
fair_pbn_alloc =
947-
(63 - link_timeslots_used) / remaining_to_increase * mst_state->pbn_div;
948+
(63 - link_timeslots_used) / remaining_to_increase * dfixed_trunc(mst_state->pbn_div);
948949

949950
if (initial_slack[next_index] > fair_pbn_alloc) {
950951
vars[next_index].pbn += fair_pbn_alloc;
@@ -1642,7 +1643,7 @@ enum dc_status dm_dp_mst_is_port_support_mode(
16421643
} else {
16431644
/* check if mode could be supported within full_pbn */
16441645
bpp = convert_dc_color_depth_into_bpc(stream->timing.display_color_depth) * 3;
1645-
pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp, false);
1646+
pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp << 4);
16461647
if (pbn > full_pbn)
16471648
return DC_FAIL_BANDWIDTH_VALIDATE;
16481649
}

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = {
22452245
{ OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) },
22462246
/* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */
22472247
{ OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) },
2248+
/* Synaptics DP1.4 MST hubs require DSC for some modes on which it applies HBLANK expansion. */
2249+
{ OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_HBLANK_EXPANSION_REQUIRES_DSC) },
22482250
/* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */
22492251
{ OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) },
22502252
};
@@ -2326,6 +2328,33 @@ int drm_dp_read_desc(struct drm_dp_aux *aux, struct drm_dp_desc *desc,
23262328
}
23272329
EXPORT_SYMBOL(drm_dp_read_desc);
23282330

2331+
/**
2332+
* drm_dp_dsc_sink_bpp_incr() - Get bits per pixel increment
2333+
* @dsc_dpcd: DSC capabilities from DPCD
2334+
*
2335+
* Returns the bpp precision supported by the DP sink.
2336+
*/
2337+
u8 drm_dp_dsc_sink_bpp_incr(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
2338+
{
2339+
u8 bpp_increment_dpcd = dsc_dpcd[DP_DSC_BITS_PER_PIXEL_INC - DP_DSC_SUPPORT];
2340+
2341+
switch (bpp_increment_dpcd) {
2342+
case DP_DSC_BITS_PER_PIXEL_1_16:
2343+
return 16;
2344+
case DP_DSC_BITS_PER_PIXEL_1_8:
2345+
return 8;
2346+
case DP_DSC_BITS_PER_PIXEL_1_4:
2347+
return 4;
2348+
case DP_DSC_BITS_PER_PIXEL_1_2:
2349+
return 2;
2350+
case DP_DSC_BITS_PER_PIXEL_1_1:
2351+
return 1;
2352+
}
2353+
2354+
return 0;
2355+
}
2356+
EXPORT_SYMBOL(drm_dp_dsc_sink_bpp_incr);
2357+
23292358
/**
23302359
* drm_dp_dsc_sink_max_slice_count() - Get the max slice count
23312360
* supported by the DSC sink.
@@ -3898,3 +3927,135 @@ int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux)
38983927
EXPORT_SYMBOL(drm_panel_dp_aux_backlight);
38993928

39003929
#endif
3930+
3931+
/* See DP Standard v2.1 2.6.4.4.1.1, 2.8.4.4, 2.8.7 */
3932+
static int drm_dp_link_symbol_cycles(int lane_count, int pixels, int bpp_x16,
3933+
int symbol_size, bool is_mst)
3934+
{
3935+
int cycles = DIV_ROUND_UP(pixels * bpp_x16, 16 * symbol_size * lane_count);
3936+
int align = is_mst ? 4 / lane_count : 1;
3937+
3938+
return ALIGN(cycles, align);
3939+
}
3940+
3941+
static int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_count,
3942+
int bpp_x16, int symbol_size, bool is_mst)
3943+
{
3944+
int slice_pixels = DIV_ROUND_UP(pixels, slice_count);
3945+
int slice_data_cycles = drm_dp_link_symbol_cycles(lane_count, slice_pixels,
3946+
bpp_x16, symbol_size, is_mst);
3947+
int slice_eoc_cycles = is_mst ? 4 / lane_count : 1;
3948+
3949+
return slice_count * (slice_data_cycles + slice_eoc_cycles);
3950+
}
3951+
3952+
/**
3953+
* drm_dp_bw_overhead - Calculate the BW overhead of a DP link stream
3954+
* @lane_count: DP link lane count
3955+
* @hactive: pixel count of the active period in one scanline of the stream
3956+
* @dsc_slice_count: DSC slice count if @flags/DRM_DP_LINK_BW_OVERHEAD_DSC is set
3957+
* @bpp_x16: bits per pixel in .4 binary fixed point
3958+
* @flags: DRM_DP_OVERHEAD_x flags
3959+
*
3960+
* Calculate the BW allocation overhead of a DP link stream, depending
3961+
* on the link's
3962+
* - @lane_count
3963+
* - SST/MST mode (@flags / %DRM_DP_OVERHEAD_MST)
3964+
* - symbol size (@flags / %DRM_DP_OVERHEAD_UHBR)
3965+
* - FEC mode (@flags / %DRM_DP_OVERHEAD_FEC)
3966+
* - SSC/REF_CLK mode (@flags / %DRM_DP_OVERHEAD_SSC_REF_CLK)
3967+
* as well as the stream's
3968+
* - @hactive timing
3969+
* - @bpp_x16 color depth
3970+
* - compression mode (@flags / %DRM_DP_OVERHEAD_DSC).
3971+
* Note that this overhead doesn't account for the 8b/10b, 128b/132b
3972+
* channel coding efficiency, for that see
3973+
* @drm_dp_link_bw_channel_coding_efficiency().
3974+
*
3975+
* Returns the overhead as 100% + overhead% in 1ppm units.
3976+
*/
3977+
int drm_dp_bw_overhead(int lane_count, int hactive,
3978+
int dsc_slice_count,
3979+
int bpp_x16, unsigned long flags)
3980+
{
3981+
int symbol_size = flags & DRM_DP_BW_OVERHEAD_UHBR ? 32 : 8;
3982+
bool is_mst = flags & DRM_DP_BW_OVERHEAD_MST;
3983+
u32 overhead = 1000000;
3984+
int symbol_cycles;
3985+
3986+
/*
3987+
* DP Standard v2.1 2.6.4.1
3988+
* SSC downspread and ref clock variation margin:
3989+
* 5300ppm + 300ppm ~ 0.6%
3990+
*/
3991+
if (flags & DRM_DP_BW_OVERHEAD_SSC_REF_CLK)
3992+
overhead += 6000;
3993+
3994+
/*
3995+
* DP Standard v2.1 2.6.4.1.1, 3.5.1.5.4:
3996+
* FEC symbol insertions for 8b/10b channel coding:
3997+
* After each 250 data symbols on 2-4 lanes:
3998+
* 250 LL + 5 FEC_PARITY_PH + 1 CD_ADJ (256 byte FEC block)
3999+
* After each 2 x 250 data symbols on 1 lane:
4000+
* 2 * 250 LL + 11 FEC_PARITY_PH + 1 CD_ADJ (512 byte FEC block)
4001+
* After 256 (2-4 lanes) or 128 (1 lane) FEC blocks:
4002+
* 256 * 256 bytes + 1 FEC_PM
4003+
* or
4004+
* 128 * 512 bytes + 1 FEC_PM
4005+
* (256 * 6 + 1) / (256 * 250) = 2.4015625 %
4006+
*/
4007+
if (flags & DRM_DP_BW_OVERHEAD_FEC)
4008+
overhead += 24016;
4009+
4010+
/*
4011+
* DP Standard v2.1 2.7.9, 5.9.7
4012+
* The FEC overhead for UHBR is accounted for in its 96.71% channel
4013+
* coding efficiency.
4014+
*/
4015+
WARN_ON((flags & DRM_DP_BW_OVERHEAD_UHBR) &&
4016+
(flags & DRM_DP_BW_OVERHEAD_FEC));
4017+
4018+
if (flags & DRM_DP_BW_OVERHEAD_DSC)
4019+
symbol_cycles = drm_dp_link_dsc_symbol_cycles(lane_count, hactive,
4020+
dsc_slice_count,
4021+
bpp_x16, symbol_size,
4022+
is_mst);
4023+
else
4024+
symbol_cycles = drm_dp_link_symbol_cycles(lane_count, hactive,
4025+
bpp_x16, symbol_size,
4026+
is_mst);
4027+
4028+
return DIV_ROUND_UP_ULL(mul_u32_u32(symbol_cycles * symbol_size * lane_count,
4029+
overhead * 16),
4030+
hactive * bpp_x16);
4031+
}
4032+
EXPORT_SYMBOL(drm_dp_bw_overhead);
4033+
4034+
/**
4035+
* drm_dp_bw_channel_coding_efficiency - Get a DP link's channel coding efficiency
4036+
* @is_uhbr: Whether the link has a 128b/132b channel coding
4037+
*
4038+
* Return the channel coding efficiency of the given DP link type, which is
4039+
* either 8b/10b or 128b/132b (aka UHBR). The corresponding overhead includes
4040+
* the 8b -> 10b, 128b -> 132b pixel data to link symbol conversion overhead
4041+
* and for 128b/132b any link or PHY level control symbol insertion overhead
4042+
* (LLCP, FEC, PHY sync, see DP Standard v2.1 3.5.2.18). For 8b/10b the
4043+
* corresponding FEC overhead is BW allocation specific, included in the value
4044+
* returned by drm_dp_bw_overhead().
4045+
*
4046+
* Returns the efficiency in the 100%/coding-overhead% ratio in
4047+
* 1ppm units.
4048+
*/
4049+
int drm_dp_bw_channel_coding_efficiency(bool is_uhbr)
4050+
{
4051+
if (is_uhbr)
4052+
return 967100;
4053+
else
4054+
/*
4055+
* Note that on 8b/10b MST the efficiency is only
4056+
* 78.75% due to the 1 out of 64 MTPH packet overhead,
4057+
* not accounted for here.
4058+
*/
4059+
return 800000;
4060+
}
4061+
EXPORT_SYMBOL(drm_dp_bw_channel_coding_efficiency);

0 commit comments

Comments
 (0)