Skip to content

Commit b1c1c52

Browse files
committed
Merge tag 'drm-intel-next-2025-09-05' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Cross-subsystem Changes: - iopoll: Generalize read_poll_timeout() into poll_timeout_us() (Ville) Non-display related: - PREEMPT_RT fix (Sebastian) - Replace DRM_DEBUG_SELFTEST with DRM_KUNIT_TEST (Ruben, Imre) - Some changes oeveral like in RPS, SoC, debugfs targeting display separation (Jani) Display related: - General refactor in favor of intel_display (Suraj) - Prune modes for YUV420 (Suraj) - Reject HBR3 in any eDP Panel (Ankit) - Change AUX DPCD probe address (Imre) - Display Wa fix, additions, and updates (Ankit, Vinod, Nemesa, Suraj, Jouni)) - DP: Fix 2.7 Gbps link training on g4x (Ville) - DP: Adjust the idle pattern handling (Ville) - DP: Shuffle the link training code a bit (Ville) - Don't set/read the DSI C clock divider on GLK (Ville) - Precompute plane SURF address/etc (Ville) - Enable_psr kernel parameter changes (Jouni) - PHY LFPS sending configuration fixes (Jouni) - Fix dma_fence_wait_timeout() return value handling (Aakash) - DP: Fix disabling training pattern (Imre) - Small code clean-ups (Gustavo, Colin, Jani, Juha-Pekka) - Change vblank log from err to debug (Suraj) - More display clean-up towards intel_display split (Jani) - Use the recomended min_hblank values (Arun) - Block hpd during suspend (Dibin) - DSI: Fix overflow issue in pclk parsing (Jouni) - PSR: Do not trigger Frame Change events from frontbuffer flush (Jouni) - VBT cleanups and new fields (Jani, Suraj) - Type-C enabled/disconnected dp-alt sink (Imre) - Optimize panel power-on wait time (Dibin) - Wildcat Lake enabling (Imre, Chaitanya) - DP HDR updates (Chaitanya) - Fix divide by 0 error in i9xx_set_backlight (Suraj) - Fixes for PSR (Jouni) - Remove the encoder check in hdcp enable (Suraj) - Control HDMI output bpc (Lee) - Fix possible overflow on tc power (Mika) - Convert code towards poll_timeout_* (Jani) - Use REG_BIT on FW_BLC_SELF_* macros (Luca) - ALPM LFPS and silence period calculation (Jouni) - Remove power state verification before HW readout (Imre) - Fix HPD mtp_tc_hpd_enable_detection (Ville) - DRAM detection (Ville) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/aLtc-gk3jhwcWxZh@intel.com
2 parents 6dc1d3c + 70a9b20 commit b1c1c52

124 files changed

Lines changed: 2102 additions & 1375 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.

drivers/gpu/drm/i915/Kconfig.debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ config DRM_I915_DEBUG
5050
select DRM_VGEM # used by igt/prime_vgem (dmabuf interop checks)
5151
select DRM_DEBUG_MM if DRM=y
5252
select DRM_EXPORT_FOR_TESTS if m
53-
select DRM_DEBUG_SELFTEST
53+
select DRM_KUNIT_TEST if KUNIT
5454
select DMABUF_SELFTESTS
5555
select SW_SYNC # signaling validation framework (igt/syncobj*)
5656
select DRM_I915_WERROR

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

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -424,17 +424,6 @@ intel_dp_link_down(struct intel_encoder *encoder,
424424

425425
drm_dbg_kms(display->drm, "\n");
426426

427-
if ((display->platform.ivybridge && port == PORT_A) ||
428-
(HAS_PCH_CPT(display) && port != PORT_A)) {
429-
intel_dp->DP &= ~DP_LINK_TRAIN_MASK_CPT;
430-
intel_dp->DP |= DP_LINK_TRAIN_PAT_IDLE_CPT;
431-
} else {
432-
intel_dp->DP &= ~DP_LINK_TRAIN_MASK;
433-
intel_dp->DP |= DP_LINK_TRAIN_PAT_IDLE;
434-
}
435-
intel_de_write(display, intel_dp->output_reg, intel_dp->DP);
436-
intel_de_posting_read(display, intel_dp->output_reg);
437-
438427
intel_dp->DP &= ~DP_PORT_EN;
439428
intel_de_write(display, intel_dp->output_reg, intel_dp->DP);
440429
intel_de_posting_read(display, intel_dp->output_reg);
@@ -611,6 +600,19 @@ cpt_set_link_train(struct intel_dp *intel_dp,
611600
intel_de_posting_read(display, intel_dp->output_reg);
612601
}
613602

603+
static void
604+
cpt_set_idle_link_train(struct intel_dp *intel_dp,
605+
const struct intel_crtc_state *crtc_state)
606+
{
607+
struct intel_display *display = to_intel_display(intel_dp);
608+
609+
intel_dp->DP &= ~DP_LINK_TRAIN_MASK_CPT;
610+
intel_dp->DP |= DP_LINK_TRAIN_PAT_IDLE_CPT;
611+
612+
intel_de_write(display, intel_dp->output_reg, intel_dp->DP);
613+
intel_de_posting_read(display, intel_dp->output_reg);
614+
}
615+
614616
static void
615617
g4x_set_link_train(struct intel_dp *intel_dp,
616618
const struct intel_crtc_state *crtc_state,
@@ -639,6 +641,19 @@ g4x_set_link_train(struct intel_dp *intel_dp,
639641
intel_de_posting_read(display, intel_dp->output_reg);
640642
}
641643

644+
static void
645+
g4x_set_idle_link_train(struct intel_dp *intel_dp,
646+
const struct intel_crtc_state *crtc_state)
647+
{
648+
struct intel_display *display = to_intel_display(intel_dp);
649+
650+
intel_dp->DP &= ~DP_LINK_TRAIN_MASK;
651+
intel_dp->DP |= DP_LINK_TRAIN_PAT_IDLE;
652+
653+
intel_de_write(display, intel_dp->output_reg, intel_dp->DP);
654+
intel_de_posting_read(display, intel_dp->output_reg);
655+
}
656+
642657
static void intel_dp_enable_port(struct intel_dp *intel_dp,
643658
const struct intel_crtc_state *crtc_state)
644659
{
@@ -1285,12 +1300,10 @@ bool g4x_dp_init(struct intel_display *display,
12851300
drm_dbg_kms(display->drm, "No VBT child device for DP-%c\n",
12861301
port_name(port));
12871302

1288-
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
1303+
dig_port = intel_dig_port_alloc();
12891304
if (!dig_port)
12901305
return false;
12911306

1292-
dig_port->aux_ch = AUX_CH_NONE;
1293-
12941307
intel_connector = intel_connector_alloc();
12951308
if (!intel_connector)
12961309
goto err_connector_alloc;
@@ -1300,8 +1313,6 @@ bool g4x_dp_init(struct intel_display *display,
13001313

13011314
intel_encoder->devdata = devdata;
13021315

1303-
mutex_init(&dig_port->hdcp.mutex);
1304-
13051316
if (drm_encoder_init(display->drm, &intel_encoder->base,
13061317
&intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS,
13071318
"DP %c", port_name(port)))
@@ -1342,10 +1353,13 @@ bool g4x_dp_init(struct intel_display *display,
13421353
intel_encoder->audio_disable = g4x_dp_audio_disable;
13431354

13441355
if ((display->platform.ivybridge && port == PORT_A) ||
1345-
(HAS_PCH_CPT(display) && port != PORT_A))
1356+
(HAS_PCH_CPT(display) && port != PORT_A)) {
13461357
dig_port->dp.set_link_train = cpt_set_link_train;
1347-
else
1358+
dig_port->dp.set_idle_link_train = cpt_set_idle_link_train;
1359+
} else {
13481360
dig_port->dp.set_link_train = g4x_set_link_train;
1361+
dig_port->dp.set_idle_link_train = g4x_set_idle_link_train;
1362+
}
13491363

13501364
if (display->platform.cherryview)
13511365
intel_encoder->set_signal_levels = chv_set_signal_levels;
@@ -1368,7 +1382,6 @@ bool g4x_dp_init(struct intel_display *display,
13681382
}
13691383

13701384
dig_port->dp.output_reg = output_reg;
1371-
dig_port->max_lanes = 4;
13721385

13731386
intel_encoder->type = INTEL_OUTPUT_DP;
13741387
intel_encoder->power_domain = intel_display_power_ddi_lanes_domain(display, port);

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "intel_display_types.h"
2020
#include "intel_dp_aux.h"
2121
#include "intel_dpio_phy.h"
22-
#include "intel_fdi.h"
22+
#include "intel_encoder.h"
2323
#include "intel_fifo_underrun.h"
2424
#include "intel_hdmi.h"
2525
#include "intel_hotplug.h"
@@ -135,11 +135,8 @@ static int g4x_hdmi_compute_config(struct intel_encoder *encoder,
135135
struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state);
136136
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
137137

138-
if (HAS_PCH_SPLIT(display)) {
138+
if (HAS_PCH_SPLIT(display))
139139
crtc_state->has_pch_encoder = true;
140-
if (!intel_fdi_compute_pipe_bpp(crtc_state))
141-
return -EINVAL;
142-
}
143140

144141
if (display->platform.g4x)
145142
crtc_state->has_hdmi_sink = g4x_compute_has_hdmi_sink(state, crtc);
@@ -690,12 +687,10 @@ bool g4x_hdmi_init(struct intel_display *display,
690687
drm_dbg_kms(display->drm, "No VBT child device for HDMI-%c\n",
691688
port_name(port));
692689

693-
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
690+
dig_port = intel_dig_port_alloc();
694691
if (!dig_port)
695692
return false;
696693

697-
dig_port->aux_ch = AUX_CH_NONE;
698-
699694
intel_connector = intel_connector_alloc();
700695
if (!intel_connector)
701696
goto err_connector_alloc;
@@ -704,8 +699,6 @@ bool g4x_hdmi_init(struct intel_display *display,
704699

705700
intel_encoder->devdata = devdata;
706701

707-
mutex_init(&dig_port->hdcp.mutex);
708-
709702
if (drm_encoder_init(display->drm, &intel_encoder->base,
710703
&intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
711704
"HDMI %c", port_name(port)))
@@ -767,8 +760,6 @@ bool g4x_hdmi_init(struct intel_display *display,
767760
intel_encoder->cloneable |= BIT(INTEL_OUTPUT_HDMI);
768761

769762
dig_port->hdmi.hdmi_reg = hdmi_reg;
770-
dig_port->dp.output_reg = INVALID_MMIO_REG;
771-
dig_port->max_lanes = 4;
772763

773764
intel_infoframe_init(dig_port);
774765

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

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ static bool i9xx_plane_has_windowing(struct intel_plane *plane)
155155
i9xx_plane == PLANE_C;
156156
}
157157

158-
static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
159-
const struct intel_plane_state *plane_state)
158+
static u32 i9xx_plane_ctl(const struct intel_plane_state *plane_state)
160159
{
161160
struct intel_display *display = to_intel_display(plane_state);
162161
const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -355,11 +354,24 @@ i9xx_plane_check(struct intel_crtc_state *crtc_state,
355354
if (ret)
356355
return ret;
357356

358-
plane_state->ctl = i9xx_plane_ctl(crtc_state, plane_state);
357+
plane_state->ctl = i9xx_plane_ctl(plane_state);
359358

360359
return 0;
361360
}
362361

362+
static u32 i8xx_plane_surf_offset(const struct intel_plane_state *plane_state)
363+
{
364+
int x = plane_state->view.color_plane[0].x;
365+
int y = plane_state->view.color_plane[0].y;
366+
367+
return intel_fb_xy_to_linear(x, y, plane_state, 0);
368+
}
369+
370+
u32 i965_plane_surf_offset(const struct intel_plane_state *plane_state)
371+
{
372+
return plane_state->view.color_plane[0].offset;
373+
}
374+
363375
static u32 i9xx_plane_ctl_crtc(const struct intel_crtc_state *crtc_state)
364376
{
365377
struct intel_display *display = to_intel_display(crtc_state);
@@ -463,7 +475,7 @@ static void i9xx_plane_update_arm(struct intel_dsb *dsb,
463475
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
464476
int x = plane_state->view.color_plane[0].x;
465477
int y = plane_state->view.color_plane[0].y;
466-
u32 dspcntr, dspaddr_offset, linear_offset;
478+
u32 dspcntr;
467479

468480
dspcntr = plane_state->ctl | i9xx_plane_ctl_crtc(crtc_state);
469481

@@ -472,13 +484,6 @@ static void i9xx_plane_update_arm(struct intel_dsb *dsb,
472484
crtc_state->async_flip_planes & BIT(plane->id))
473485
dspcntr |= DISP_ASYNC_FLIP;
474486

475-
linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
476-
477-
if (DISPLAY_VER(display) >= 4)
478-
dspaddr_offset = plane_state->view.color_plane[0].offset;
479-
else
480-
dspaddr_offset = linear_offset;
481-
482487
if (display->platform.cherryview && i9xx_plane == PLANE_B) {
483488
int crtc_x = plane_state->uapi.dst.x1;
484489
int crtc_y = plane_state->uapi.dst.y1;
@@ -498,7 +503,7 @@ static void i9xx_plane_update_arm(struct intel_dsb *dsb,
498503
DISP_OFFSET_Y(y) | DISP_OFFSET_X(x));
499504
} else if (DISPLAY_VER(display) >= 4) {
500505
intel_de_write_fw(display, DSPLINOFF(display, i9xx_plane),
501-
linear_offset);
506+
intel_fb_xy_to_linear(x, y, plane_state, 0));
502507
intel_de_write_fw(display, DSPTILEOFF(display, i9xx_plane),
503508
DISP_OFFSET_Y(y) | DISP_OFFSET_X(x));
504509
}
@@ -511,11 +516,9 @@ static void i9xx_plane_update_arm(struct intel_dsb *dsb,
511516
intel_de_write_fw(display, DSPCNTR(display, i9xx_plane), dspcntr);
512517

513518
if (DISPLAY_VER(display) >= 4)
514-
intel_de_write_fw(display, DSPSURF(display, i9xx_plane),
515-
intel_plane_ggtt_offset(plane_state) + dspaddr_offset);
519+
intel_de_write_fw(display, DSPSURF(display, i9xx_plane), plane_state->surf);
516520
else
517-
intel_de_write_fw(display, DSPADDR(display, i9xx_plane),
518-
intel_plane_ggtt_offset(plane_state) + dspaddr_offset);
521+
intel_de_write_fw(display, DSPADDR(display, i9xx_plane), plane_state->surf);
519522
}
520523

521524
static void i830_plane_update_arm(struct intel_dsb *dsb,
@@ -604,16 +607,13 @@ g4x_primary_async_flip(struct intel_dsb *dsb,
604607
{
605608
struct intel_display *display = to_intel_display(plane);
606609
u32 dspcntr = plane_state->ctl | i9xx_plane_ctl_crtc(crtc_state);
607-
u32 dspaddr_offset = plane_state->view.color_plane[0].offset;
608610
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
609611

610612
if (async_flip)
611613
dspcntr |= DISP_ASYNC_FLIP;
612614

613615
intel_de_write_fw(display, DSPCNTR(display, i9xx_plane), dspcntr);
614-
615-
intel_de_write_fw(display, DSPSURF(display, i9xx_plane),
616-
intel_plane_ggtt_offset(plane_state) + dspaddr_offset);
616+
intel_de_write_fw(display, DSPSURF(display, i9xx_plane), plane_state->surf);
617617
}
618618

619619
static void
@@ -624,11 +624,9 @@ vlv_primary_async_flip(struct intel_dsb *dsb,
624624
bool async_flip)
625625
{
626626
struct intel_display *display = to_intel_display(plane);
627-
u32 dspaddr_offset = plane_state->view.color_plane[0].offset;
628627
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
629628

630-
intel_de_write_fw(display, DSPADDR_VLV(display, i9xx_plane),
631-
intel_plane_ggtt_offset(plane_state) + dspaddr_offset);
629+
intel_de_write_fw(display, DSPADDR_VLV(display, i9xx_plane), plane_state->surf);
632630
}
633631

634632
static void
@@ -1037,6 +1035,11 @@ intel_primary_plane_create(struct intel_display *display, enum pipe pipe)
10371035
plane->get_hw_state = i9xx_plane_get_hw_state;
10381036
plane->check_plane = i9xx_plane_check;
10391037

1038+
if (DISPLAY_VER(display) >= 4)
1039+
plane->surf_offset = i965_plane_surf_offset;
1040+
else
1041+
plane->surf_offset = i8xx_plane_surf_offset;
1042+
10401043
if (DISPLAY_VER(display) >= 5 || display->platform.g4x)
10411044
plane->capture_error = g4x_primary_capture_error;
10421045
else if (DISPLAY_VER(display) >= 4)
@@ -1254,24 +1257,21 @@ bool i9xx_fixup_initial_plane_config(struct intel_crtc *crtc,
12541257
const struct intel_plane_state *plane_state =
12551258
to_intel_plane_state(plane->base.state);
12561259
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
1257-
u32 base;
12581260

12591261
if (!plane_state->uapi.visible)
12601262
return false;
12611263

1262-
base = intel_plane_ggtt_offset(plane_state);
1263-
12641264
/*
12651265
* We may have moved the surface to a different
12661266
* part of ggtt, make the plane aware of that.
12671267
*/
1268-
if (plane_config->base == base)
1268+
if (plane_config->base == plane_state->surf)
12691269
return false;
12701270

12711271
if (DISPLAY_VER(display) >= 4)
1272-
intel_de_write(display, DSPSURF(display, i9xx_plane), base);
1272+
intel_de_write(display, DSPSURF(display, i9xx_plane), plane_state->surf);
12731273
else
1274-
intel_de_write(display, DSPADDR(display, i9xx_plane), base);
1274+
intel_de_write(display, DSPADDR(display, i9xx_plane), plane_state->surf);
12751275

12761276
return true;
12771277
}

drivers/gpu/drm/i915/display/i9xx_plane.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane,
2424
const struct drm_framebuffer *fb,
2525
int colot_plane);
2626
int i9xx_check_plane_surface(struct intel_plane_state *plane_state);
27+
u32 i965_plane_surf_offset(const struct intel_plane_state *plane_state);
2728

2829
struct intel_plane *
2930
intel_primary_plane_create(struct intel_display *display, enum pipe pipe);

0 commit comments

Comments
 (0)