Skip to content

Commit 8066904

Browse files
committed
Merge tag 'drm-intel-next-2025-05-08' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Non-display related: - Fix undefined reference to `intel_pxp_gsccs_is_ready_for_sessions' Display related: - More work towards display separation (Jani) - Stop writing VRR_CTL_IGN_MAX_SHIFT for MTL onwards (Jouni) - DSC checks for 3 engines (Ankit) - Add link rate and lane count to i915_display_info (Khaled) - PSR fixes and workaround for underrun on idle (Jouni) - LOBF enablement and ALMP fixes (Animesh) - Clean up VGA plane handling (Ville) - Use an intel_connector pointer everywhere (Imre) - Fix warning for coffeelake on SunrisePoint PCH (Jiajia) - Rework/Correction on minimum hblank calculation (Arun) - Dmesg clean up (Jani) - Add a couple of simple display workarounds (Ankit, Vinod) - Refactor HDCP GSC (Jani) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents 67322d3 + ecd9352 commit 8066904

File tree

118 files changed

+2636
-2317
lines changed

Some content is hidden

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

118 files changed

+2636
-2317
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,31 +4393,52 @@ EXPORT_SYMBOL(drm_panel_dp_aux_backlight);
43934393
#endif
43944394

43954395
/* See DP Standard v2.1 2.6.4.4.1.1, 2.8.4.4, 2.8.7 */
4396-
static int drm_dp_link_symbol_cycles(int lane_count, int pixels, int bpp_x16,
4397-
int symbol_size, bool is_mst)
4396+
static int drm_dp_link_data_symbol_cycles(int lane_count, int pixels,
4397+
int bpp_x16, int symbol_size,
4398+
bool is_mst)
43984399
{
43994400
int cycles = DIV_ROUND_UP(pixels * bpp_x16, 16 * symbol_size * lane_count);
44004401
int align = is_mst ? 4 / lane_count : 1;
44014402

44024403
return ALIGN(cycles, align);
44034404
}
44044405

4405-
static int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_count,
4406-
int bpp_x16, int symbol_size, bool is_mst)
4406+
/**
4407+
* drm_dp_link_symbol_cycles - calculate the link symbol count with/without dsc
4408+
* @lane_count: DP link lane count
4409+
* @pixels: number of pixels in a scanline
4410+
* @dsc_slice_count: number of slices for DSC or '0' for non-DSC
4411+
* @bpp_x16: bits per pixel in .4 binary fixed format
4412+
* @symbol_size: DP symbol size
4413+
* @is_mst: %true for MST and %false for SST
4414+
*
4415+
* Calculate the link symbol cycles for both DSC (@dsc_slice_count !=0) and
4416+
* non-DSC case (@dsc_slice_count == 0) and return the count.
4417+
*/
4418+
int drm_dp_link_symbol_cycles(int lane_count, int pixels, int dsc_slice_count,
4419+
int bpp_x16, int symbol_size, bool is_mst)
44074420
{
4421+
int slice_count = dsc_slice_count ? : 1;
44084422
int slice_pixels = DIV_ROUND_UP(pixels, slice_count);
4409-
int slice_data_cycles = drm_dp_link_symbol_cycles(lane_count, slice_pixels,
4410-
bpp_x16, symbol_size, is_mst);
4411-
int slice_eoc_cycles = is_mst ? 4 / lane_count : 1;
4423+
int slice_data_cycles = drm_dp_link_data_symbol_cycles(lane_count,
4424+
slice_pixels,
4425+
bpp_x16,
4426+
symbol_size,
4427+
is_mst);
4428+
int slice_eoc_cycles = 0;
4429+
4430+
if (dsc_slice_count)
4431+
slice_eoc_cycles = is_mst ? 4 / lane_count : 1;
44124432

44134433
return slice_count * (slice_data_cycles + slice_eoc_cycles);
44144434
}
4435+
EXPORT_SYMBOL(drm_dp_link_symbol_cycles);
44154436

44164437
/**
44174438
* drm_dp_bw_overhead - Calculate the BW overhead of a DP link stream
44184439
* @lane_count: DP link lane count
44194440
* @hactive: pixel count of the active period in one scanline of the stream
4420-
* @dsc_slice_count: DSC slice count if @flags/DRM_DP_LINK_BW_OVERHEAD_DSC is set
4441+
* @dsc_slice_count: number of slices for DSC or '0' for non-DSC
44214442
* @bpp_x16: bits per pixel in .4 binary fixed point
44224443
* @flags: DRM_DP_OVERHEAD_x flags
44234444
*
@@ -4431,7 +4452,7 @@ static int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_c
44314452
* as well as the stream's
44324453
* - @hactive timing
44334454
* - @bpp_x16 color depth
4434-
* - compression mode (@flags / %DRM_DP_OVERHEAD_DSC).
4455+
* - compression mode (@dsc_slice_count != 0)
44354456
* Note that this overhead doesn't account for the 8b/10b, 128b/132b
44364457
* channel coding efficiency, for that see
44374458
* @drm_dp_link_bw_channel_coding_efficiency().
@@ -4486,15 +4507,10 @@ int drm_dp_bw_overhead(int lane_count, int hactive,
44864507
WARN_ON((flags & DRM_DP_BW_OVERHEAD_UHBR) &&
44874508
(flags & DRM_DP_BW_OVERHEAD_FEC));
44884509

4489-
if (flags & DRM_DP_BW_OVERHEAD_DSC)
4490-
symbol_cycles = drm_dp_link_dsc_symbol_cycles(lane_count, hactive,
4491-
dsc_slice_count,
4492-
bpp_x16, symbol_size,
4493-
is_mst);
4494-
else
4495-
symbol_cycles = drm_dp_link_symbol_cycles(lane_count, hactive,
4496-
bpp_x16, symbol_size,
4497-
is_mst);
4510+
symbol_cycles = drm_dp_link_symbol_cycles(lane_count, hactive,
4511+
dsc_slice_count,
4512+
bpp_x16, symbol_size,
4513+
is_mst);
44984514

44994515
return DIV_ROUND_UP_ULL(mul_u32_u32(symbol_cycles * symbol_size * lane_count,
45004516
overhead * 16),

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ i915-y += \
5252
i915-y += \
5353
soc/intel_dram.o \
5454
soc/intel_gmch.o \
55-
soc/intel_pch.o \
5655
soc/intel_rom.o
5756

5857
# core library code
@@ -282,6 +281,7 @@ i915-y += \
282281
display/intel_modeset_setup.o \
283282
display/intel_modeset_verify.o \
284283
display/intel_overlay.o \
284+
display/intel_pch.o \
285285
display/intel_pch_display.o \
286286
display/intel_pch_refclk.o \
287287
display/intel_plane_initial.o \

drivers/gpu/drm/i915/display/g4x_dp.c

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
#include <linux/string_helpers.h>
99

10+
#include <drm/drm_print.h>
11+
1012
#include "g4x_dp.h"
11-
#include "i915_drv.h"
1213
#include "i915_reg.h"
14+
#include "i915_utils.h"
1315
#include "intel_audio.h"
1416
#include "intel_backlight.h"
1517
#include "intel_connector.h"
@@ -28,7 +30,6 @@
2830
#include "intel_hotplug.h"
2931
#include "intel_pch_display.h"
3032
#include "intel_pps.h"
31-
#include "vlv_sideband.h"
3233

3334
static const struct dpll g4x_dpll[] = {
3435
{ .dot = 162000, .p1 = 2, .p2 = 10, .n = 2, .m1 = 23, .m2 = 8, },
@@ -60,14 +61,13 @@ static void g4x_dp_set_clock(struct intel_encoder *encoder,
6061
struct intel_crtc_state *pipe_config)
6162
{
6263
struct intel_display *display = to_intel_display(encoder);
63-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
6464
const struct dpll *divisor = NULL;
6565
int i, count = 0;
6666

6767
if (display->platform.g4x) {
6868
divisor = g4x_dpll;
6969
count = ARRAY_SIZE(g4x_dpll);
70-
} else if (HAS_PCH_SPLIT(dev_priv)) {
70+
} else if (HAS_PCH_SPLIT(display)) {
7171
divisor = pch_dpll;
7272
count = ARRAY_SIZE(pch_dpll);
7373
} else if (display->platform.cherryview) {
@@ -93,7 +93,6 @@ static void intel_dp_prepare(struct intel_encoder *encoder,
9393
const struct intel_crtc_state *pipe_config)
9494
{
9595
struct intel_display *display = to_intel_display(encoder);
96-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
9796
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
9897
enum port port = encoder->port;
9998
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
@@ -141,7 +140,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder,
141140
intel_dp->DP |= DP_ENHANCED_FRAMING;
142141

143142
intel_dp->DP |= DP_PIPE_SEL_IVB(crtc->pipe);
144-
} else if (HAS_PCH_CPT(dev_priv) && port != PORT_A) {
143+
} else if (HAS_PCH_CPT(display) && port != PORT_A) {
145144
intel_dp->DP |= DP_LINK_TRAIN_OFF_CPT;
146145

147146
intel_de_rmw(display, TRANS_DP_CTL(crtc->pipe),
@@ -183,7 +182,7 @@ static void assert_dp_port(struct intel_dp *intel_dp, bool state)
183182

184183
static void assert_edp_pll(struct intel_display *display, bool state)
185184
{
186-
bool cur_state = intel_de_read(display, DP_A) & DP_PLL_ENABLE;
185+
bool cur_state = intel_de_read(display, DP_A) & EDP_PLL_ENABLE;
187186

188187
INTEL_DISPLAY_STATE_WARN(display, cur_state != state,
189188
"eDP PLL state assertion failure (expected %s, current %s)\n",
@@ -205,12 +204,12 @@ static void ilk_edp_pll_on(struct intel_dp *intel_dp,
205204
drm_dbg_kms(display->drm, "enabling eDP PLL for clock %d\n",
206205
pipe_config->port_clock);
207206

208-
intel_dp->DP &= ~DP_PLL_FREQ_MASK;
207+
intel_dp->DP &= ~EDP_PLL_FREQ_MASK;
209208

210209
if (pipe_config->port_clock == 162000)
211-
intel_dp->DP |= DP_PLL_FREQ_162MHZ;
210+
intel_dp->DP |= EDP_PLL_FREQ_162MHZ;
212211
else
213-
intel_dp->DP |= DP_PLL_FREQ_270MHZ;
212+
intel_dp->DP |= EDP_PLL_FREQ_270MHZ;
214213

215214
intel_de_write(display, DP_A, intel_dp->DP);
216215
intel_de_posting_read(display, DP_A);
@@ -225,7 +224,7 @@ static void ilk_edp_pll_on(struct intel_dp *intel_dp,
225224
if (display->platform.ironlake)
226225
intel_wait_for_vblank_if_active(display, !crtc->pipe);
227226

228-
intel_dp->DP |= DP_PLL_ENABLE;
227+
intel_dp->DP |= EDP_PLL_ENABLE;
229228

230229
intel_de_write(display, DP_A, intel_dp->DP);
231230
intel_de_posting_read(display, DP_A);
@@ -243,7 +242,7 @@ static void ilk_edp_pll_off(struct intel_dp *intel_dp,
243242

244243
drm_dbg_kms(display->drm, "disabling eDP PLL\n");
245244

246-
intel_dp->DP &= ~DP_PLL_ENABLE;
245+
intel_dp->DP &= ~EDP_PLL_ENABLE;
247246

248247
intel_de_write(display, DP_A, intel_dp->DP);
249248
intel_de_posting_read(display, DP_A);
@@ -277,7 +276,6 @@ bool g4x_dp_port_enabled(struct intel_display *display,
277276
i915_reg_t dp_reg, enum port port,
278277
enum pipe *pipe)
279278
{
280-
struct drm_i915_private *dev_priv = to_i915(display->drm);
281279
bool ret;
282280
u32 val;
283281

@@ -287,13 +285,13 @@ bool g4x_dp_port_enabled(struct intel_display *display,
287285

288286
/* asserts want to know the pipe even if the port is disabled */
289287
if (display->platform.ivybridge && port == PORT_A)
290-
*pipe = (val & DP_PIPE_SEL_MASK_IVB) >> DP_PIPE_SEL_SHIFT_IVB;
291-
else if (HAS_PCH_CPT(dev_priv) && port != PORT_A)
288+
*pipe = REG_FIELD_GET(DP_PIPE_SEL_MASK_IVB, val);
289+
else if (HAS_PCH_CPT(display) && port != PORT_A)
292290
ret &= cpt_dp_port_selected(display, port, pipe);
293291
else if (display->platform.cherryview)
294-
*pipe = (val & DP_PIPE_SEL_MASK_CHV) >> DP_PIPE_SEL_SHIFT_CHV;
292+
*pipe = REG_FIELD_GET(DP_PIPE_SEL_MASK_CHV, val);
295293
else
296-
*pipe = (val & DP_PIPE_SEL_MASK) >> DP_PIPE_SEL_SHIFT;
294+
*pipe = REG_FIELD_GET(DP_PIPE_SEL_MASK, val);
297295

298296
return ret;
299297
}
@@ -338,7 +336,6 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
338336
struct intel_crtc_state *pipe_config)
339337
{
340338
struct intel_display *display = to_intel_display(encoder);
341-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
342339
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
343340
u32 tmp, flags = 0;
344341
enum port port = encoder->port;
@@ -353,7 +350,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
353350

354351
pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
355352

356-
if (HAS_PCH_CPT(dev_priv) && port != PORT_A) {
353+
if (HAS_PCH_CPT(display) && port != PORT_A) {
357354
u32 trans_dp = intel_de_read(display,
358355
TRANS_DP_CTL(crtc->pipe));
359356

@@ -389,13 +386,12 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
389386
if (display->platform.g4x && tmp & DP_COLOR_RANGE_16_235)
390387
pipe_config->limited_color_range = true;
391388

392-
pipe_config->lane_count =
393-
((tmp & DP_PORT_WIDTH_MASK) >> DP_PORT_WIDTH_SHIFT) + 1;
389+
pipe_config->lane_count = REG_FIELD_GET(DP_PORT_WIDTH_MASK, tmp) + 1;
394390

395391
g4x_dp_get_m_n(pipe_config);
396392

397393
if (port == PORT_A) {
398-
if ((intel_de_read(display, DP_A) & DP_PLL_FREQ_MASK) == DP_PLL_FREQ_162MHZ)
394+
if ((intel_de_read(display, DP_A) & EDP_PLL_FREQ_MASK) == EDP_PLL_FREQ_162MHZ)
399395
pipe_config->port_clock = 162000;
400396
else
401397
pipe_config->port_clock = 270000;
@@ -416,7 +412,6 @@ intel_dp_link_down(struct intel_encoder *encoder,
416412
const struct intel_crtc_state *old_crtc_state)
417413
{
418414
struct intel_display *display = to_intel_display(encoder);
419-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
420415
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
421416
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
422417
enum port port = encoder->port;
@@ -429,7 +424,7 @@ intel_dp_link_down(struct intel_encoder *encoder,
429424
drm_dbg_kms(display->drm, "\n");
430425

431426
if ((display->platform.ivybridge && port == PORT_A) ||
432-
(HAS_PCH_CPT(dev_priv) && port != PORT_A)) {
427+
(HAS_PCH_CPT(display) && port != PORT_A)) {
433428
intel_dp->DP &= ~DP_LINK_TRAIN_MASK_CPT;
434429
intel_dp->DP |= DP_LINK_TRAIN_PAT_IDLE_CPT;
435430
} else {
@@ -448,7 +443,7 @@ intel_dp_link_down(struct intel_encoder *encoder,
448443
* to transcoder A after disabling it to allow the
449444
* matching HDMI port to be enabled on transcoder A.
450445
*/
451-
if (HAS_PCH_IBX(dev_priv) && crtc->pipe == PIPE_B && port != PORT_A) {
446+
if (HAS_PCH_IBX(display) && crtc->pipe == PIPE_B && port != PORT_A) {
452447
/*
453448
* We get CPU/PCH FIFO underruns on the other pipe when
454449
* doing the workaround. Sweep them under the rug.
@@ -581,16 +576,10 @@ static void chv_post_disable_dp(struct intel_atomic_state *state,
581576
const struct intel_crtc_state *old_crtc_state,
582577
const struct drm_connector_state *old_conn_state)
583578
{
584-
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
585-
586579
intel_dp_link_down(encoder, old_crtc_state);
587580

588-
vlv_dpio_get(dev_priv);
589-
590581
/* Assert data lane reset */
591582
chv_data_lane_soft_reset(encoder, old_crtc_state, true);
592-
593-
vlv_dpio_put(dev_priv);
594583
}
595584

596585
static void
@@ -1223,10 +1212,10 @@ static int g4x_dp_compute_config(struct intel_encoder *encoder,
12231212
struct intel_crtc_state *crtc_state,
12241213
struct drm_connector_state *conn_state)
12251214
{
1226-
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1215+
struct intel_display *display = to_intel_display(encoder);
12271216
int ret;
12281217

1229-
if (HAS_PCH_SPLIT(i915) && encoder->port != PORT_A)
1218+
if (HAS_PCH_SPLIT(display) && encoder->port != PORT_A)
12301219
crtc_state->has_pch_encoder = true;
12311220

12321221
ret = intel_dp_compute_config(encoder, crtc_state, conn_state);
@@ -1279,7 +1268,6 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {
12791268
bool g4x_dp_init(struct intel_display *display,
12801269
i915_reg_t output_reg, enum port port)
12811270
{
1282-
struct drm_i915_private *dev_priv = to_i915(display->drm);
12831271
const struct intel_bios_encoder_data *devdata;
12841272
struct intel_digital_port *dig_port;
12851273
struct intel_encoder *intel_encoder;
@@ -1353,7 +1341,7 @@ bool g4x_dp_init(struct intel_display *display,
13531341
intel_encoder->audio_disable = g4x_dp_audio_disable;
13541342

13551343
if ((display->platform.ivybridge && port == PORT_A) ||
1356-
(HAS_PCH_CPT(dev_priv) && port != PORT_A))
1344+
(HAS_PCH_CPT(display) && port != PORT_A))
13571345
dig_port->dp.set_link_train = cpt_set_link_train;
13581346
else
13591347
dig_port->dp.set_link_train = g4x_set_link_train;
@@ -1370,7 +1358,7 @@ bool g4x_dp_init(struct intel_display *display,
13701358
intel_encoder->set_signal_levels = g4x_set_signal_levels;
13711359

13721360
if (display->platform.valleyview || display->platform.cherryview ||
1373-
(HAS_PCH_SPLIT(dev_priv) && port != PORT_A)) {
1361+
(HAS_PCH_SPLIT(display) && port != PORT_A)) {
13741362
dig_port->dp.preemph_max = intel_dp_preemph_max_3;
13751363
dig_port->dp.voltage_max = intel_dp_voltage_max_3;
13761364
} else {

0 commit comments

Comments
 (0)