]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
3 months agodrm/i915/dp_mst: Fix ww mutex lock failure in for_each_joiner_candidate() loop
Imre Deak [Wed, 18 Feb 2026 10:57:08 +0000 (12:57 +0200)] 
drm/i915/dp_mst: Fix ww mutex lock failure in for_each_joiner_candidate() loop

Handle modeset WW mutex lock failures due to contention properly.
Return -EDEADLK to the caller instead of attempting to lock the same
mutex again in a subsequent joiner candidate iteration, where the WW
mutex is already in a contended state.

This fixes the following warning:

WARNING: drivers/gpu/drm/drm_modeset_lock.c:298 at modeset_lock+0x1c0/0x210

triggered by ctx->contended.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Fixes: b506a8e18c972 ("drm/i915/dp_mst: Rework pipe joiner logic in compute_config")
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260218105708.845161-2-imre.deak@intel.com
3 months agodrm/i915/dp: Fix ww mutex lock failure in for_each_joiner_candidate() loop
Imre Deak [Wed, 18 Feb 2026 10:57:07 +0000 (12:57 +0200)] 
drm/i915/dp: Fix ww mutex lock failure in for_each_joiner_candidate() loop

Handle modeset WW mutex lock failures due to contention properly.
Return -EDEADLK to the caller instead of attempting to lock the same
mutex again in a subsequent joiner candidate iteration, where the WW
mutex is already in a contended state.

This fixes the following warning:

WARNING: drivers/gpu/drm/drm_modeset_lock.c:298 at modeset_lock+0x1c0/0x210

triggered by ctx->contended.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Fixes: 1f1e3e5c65f6d ("drm/i915/dp: Rework pipe joiner logic in compute_config")
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260218105708.845161-1-imre.deak@intel.com
3 months agodrm/i915/dp_mst: Allow modes requiring compression for DSC passthrough
Imre Deak [Mon, 16 Feb 2026 07:04:21 +0000 (09:04 +0200)] 
drm/i915/dp_mst: Allow modes requiring compression for DSC passthrough

The DSC passthrough mode allows a compressed stream to be forwarded
to the sink instead of being decompressed at the last MST branch
device, provided that the branch device supports passthrough and
the sink supports decompression. This enables modes that would not
be possible without compression, as the bandwidth required for the
uncompressed stream exceeds what is available on the full MST path
from source to sink.

Currently, MST mode validation assumes the stream is uncompressed
and uses the corresponding uncompressed minimum link BPP for
bandwidth calculation. Use the minimum compressed link BPP instead
when DSC passthrough is available to enable the modes described
above.

The non-passthrough DSC mode, where the last MST branch device
decompresses the stream, may also allow enabling additional modes.
This would require determining the link bandwidth between the last
branch device and the sink based on the
DFP_Link_Available_Payload_Bandwidth_Number reported by the branch
device for the sink via the ENUM_PATH_RESOURCES MST message.
Supporting this is left for a follow-up for the following reasons:

1. DFP Link Available PBN reporting is not supported by any of the
   available MST devices used for testing.
2. Non-passthrough mode would enable additional modes only if the link
   bandwidth between the last branch device and the sink exceeded that
   of the full MST path. Unless multiple MST devices are used, or link
   training forces a reduced bandwidth between the source and the first
   branch device, both rare cases, this is unlikely.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4332
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260216070421.714884-5-imre.deak@intel.com
3 months agodrm/i915/dp_mst: Track min link BPP as x16 fixed-point during mode validation
Imre Deak [Mon, 16 Feb 2026 07:04:20 +0000 (09:04 +0200)] 
drm/i915/dp_mst: Track min link BPP as x16 fixed-point during mode validation

Track the minimum link BPP as an x16 fixed-point value and, for
clarity, rename the variable storing it to min_link_bpp_x16.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260216070421.714884-4-imre.deak@intel.com
3 months agodrm/i915/dp: Export intel_dp_compute_min_compressed_bpp_x16()
Imre Deak [Mon, 16 Feb 2026 07:04:19 +0000 (09:04 +0200)] 
drm/i915/dp: Export intel_dp_compute_min_compressed_bpp_x16()

Export intel_dp_compute_min_compressed_bpp_x16() for use by a
follow-up change validating MST modes with DSC enabled.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260216070421.714884-3-imre.deak@intel.com
3 months agodrm/i915/dp: Add missing slice count check during mode validation
Imre Deak [Mon, 16 Feb 2026 07:04:18 +0000 (09:04 +0200)] 
drm/i915/dp: Add missing slice count check during mode validation

Add the missing check for a valid slice count during
mode validation when DSC is enabled.

Cc: Vinod Govindapillai <vinod.govindapillai@intel.com>
Fixes: 745395b51c26 ("drm/i915/dp: Add intel_dp_mode_valid_with_dsc()")
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260216070421.714884-2-imre.deak@intel.com
3 months agodrm/i915/gt: Check set_default_submission() before deferencing
Rahul Bukte [Tue, 3 Feb 2026 04:48:39 +0000 (10:18 +0530)] 
drm/i915/gt: Check set_default_submission() before deferencing

When the i915 driver firmware binaries are not present, the
set_default_submission pointer is not set. This pointer is
dereferenced during suspend anyways.

Add a check to make sure it is set before dereferencing.

[   23.289926] PM: suspend entry (deep)
[   23.293558] Filesystems sync: 0.000 seconds
[   23.298010] Freezing user space processes
[   23.302771] Freezing user space processes completed (elapsed 0.000 seconds)
[   23.309766] OOM killer disabled.
[   23.313027] Freezing remaining freezable tasks
[   23.318540] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   23.342038] serial 00:05: disabled
[   23.345719] serial 00:02: disabled
[   23.349342] serial 00:01: disabled
[   23.353782] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   23.358993] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[   23.361635] ata1.00: Entering standby power mode
[   23.368863] ata2.00: Entering standby power mode
[   23.445187] BUG: kernel NULL pointer dereference, address: 0000000000000000
[   23.452194] #PF: supervisor instruction fetch in kernel mode
[   23.457896] #PF: error_code(0x0010) - not-present page
[   23.463065] PGD 0 P4D 0
[   23.465640] Oops: Oops: 0010 [#1] SMP NOPTI
[   23.469869] CPU: 8 UID: 0 PID: 211 Comm: kworker/u48:18 Tainted: G S      W           6.19.0-rc4-00020-gf0b9d8eb98df #10 PREEMPT(voluntary)
[   23.482512] Tainted: [S]=CPU_OUT_OF_SPEC, [W]=WARN
[   23.496511] Workqueue: async async_run_entry_fn
[   23.501087] RIP: 0010:0x0
[   23.503755] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   23.510324] RSP: 0018:ffffb4a60065fca8 EFLAGS: 00010246
[   23.515592] RAX: 0000000000000000 RBX: ffff9f428290e000 RCX: 000000000000000f
[   23.522765] RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff9f428290e000
[   23.529937] RBP: ffff9f4282907070 R08: ffff9f4281130428 R09: 00000000ffffffff
[   23.537111] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9f42829070f8
[   23.544284] R13: ffff9f4282906028 R14: ffff9f4282900000 R15: ffff9f4282906b68
[   23.551457] FS:  0000000000000000(0000) GS:ffff9f466b2cf000(0000) knlGS:0000000000000000
[   23.559588] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   23.565365] CR2: ffffffffffffffd6 CR3: 000000031c230001 CR4: 0000000000f70ef0
[   23.572539] PKRU: 55555554
[   23.575281] Call Trace:
[   23.577770]  <TASK>
[   23.579905]  intel_engines_reset_default_submission+0x42/0x60
[   23.585695]  __intel_gt_unset_wedged+0x191/0x200
[   23.590360]  intel_gt_unset_wedged+0x20/0x40
[   23.594675]  gt_sanitize+0x15e/0x170
[   23.598290]  i915_gem_suspend_late+0x6b/0x180
[   23.602692]  i915_drm_suspend_late+0x35/0xf0
[   23.607008]  ? __pfx_pci_pm_suspend_late+0x10/0x10
[   23.611843]  dpm_run_callback+0x78/0x1c0
[   23.615817]  device_suspend_late+0xde/0x2e0
[   23.620037]  async_suspend_late+0x18/0x30
[   23.624082]  async_run_entry_fn+0x25/0xa0
[   23.628129]  process_one_work+0x15b/0x380
[   23.632182]  worker_thread+0x2a5/0x3c0
[   23.635973]  ? __pfx_worker_thread+0x10/0x10
[   23.640279]  kthread+0xf6/0x1f0
[   23.643464]  ? __pfx_kthread+0x10/0x10
[   23.647263]  ? __pfx_kthread+0x10/0x10
[   23.651045]  ret_from_fork+0x131/0x190
[   23.654837]  ? __pfx_kthread+0x10/0x10
[   23.658634]  ret_from_fork_asm+0x1a/0x30
[   23.662597]  </TASK>
[   23.664826] Modules linked in:
[   23.667914] CR2: 0000000000000000
[   23.671271] ------------[ cut here ]------------

Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260203044839.1555147-1-suraj.kandpal@intel.com
3 months agodrm/i915/dp: Clamp the connector max_bpc request to the valid pipe bpp range
Imre Deak [Wed, 11 Feb 2026 11:58:11 +0000 (13:58 +0200)] 
drm/i915/dp: Clamp the connector max_bpc request to the valid pipe bpp range

The user's request for a maximum BPC - via the max-bpc connector
property - determines the pipe BPP selected by the encoder, which is in
turn used either as the uncompressed output BPP or as the input BPP for
the DSC engine. This user-requested BPC->BPP can be outside of the
source/sink's supported valid min/max pipe BPP range and atm such an
out-of-bound request will be rejected by the encoder's state
computation.

As opposed to the above, the semantics for the max-bpc connector
property - which the user may reasonably expect - should not be to
fail the modeset in case of an out-of-bound max BPC request, but rather
to adjust the request, clamping it to the valid BPP range.

Based on the above, calculate the baseline (i.e. the non-DP specific
platform/EDID) _maximum_ pipe BPP, storing it in
intel_crtc_state::max_pipe_bpp, separately from the baseline _target_
pipe BPP (which is the lower BPP of the baseline maximum and requested
maximum BPP, stored in intel_crtc_state::pipe_bpp). This allows the
encoder state computation to use the baseline maximum pipe BPP as a hard
limit for the selected pipe BPP, while also letting it use the baseline
target pipe BPP only as a preference, clamping this target BPP to the
valid DP pipe BPP range.

v2:
- Fix typos in the commit message. (Michał)
- Clarify code comment's reference to the baseline max BPP value.
  (Ankit)

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260211115811.508496-2-imre.deak@intel.com
3 months agodrm/i915/display: Clarify target pipe bpp variable name in compute_sink_pipe_bpp()
Imre Deak [Wed, 11 Feb 2026 11:58:10 +0000 (13:58 +0200)] 
drm/i915/display: Clarify target pipe bpp variable name in compute_sink_pipe_bpp()

Clarify that the baseline pipe BPP - i.e. the non-DP specific
platform/EDID maximum BPP limited by any user-requested max-bpc setting
- set by compute_sink_pipe_bpp() is a baseline _target_ pipe BPP. This
target BPP can get either rejected or adjusted (lowering or increasing
it as needed) by the encoder state computation based on other
constraints, like a minimum pipe BPP dictated by a non-RGB output format
(24 BPP) or a min/max DSC input BPP dictated by a DSC sink. Whether an
out-of-bound target BPP is adjusted or rejected depends on the max-bpc
property's semantics assumed by the driver, which is atm to reject such a
request.

A follow-up change will also compute the baseline _maximum_ pipe BPP,
which is the non-DP specific platform/EDID maximum BPP w/o the requested
max-bpc adjustment and as such is a hard limit: the encoder state
computation must ensure that the final BPP selected for the modeset is
below this maximum. Tracking the baseline maximum pipe BPP separately
will allow for adjusting the baseline target BPP as needed, clamping it
to the valid DP min/max pipe BPP range, instead of rejecting an
out-of-bound BPC/BPP request.

To clarify the above semantics rename bpp in compute_sink_pipe_bpp() to
target_pipe_bpp in this patch, preparing for a follow-up change also
computing max_pipe_bpp in the same function.

v2: Fix typos in the commit log. (Michał)

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260211115811.508496-1-imre.deak@intel.com
3 months agodrm/{i915, xe}: Remove i915_reg.h from display
Uma Shankar [Thu, 5 Feb 2026 09:43:41 +0000 (15:13 +0530)] 
drm/{i915, xe}: Remove i915_reg.h from display

Make display files free from including i915_reg.h.

v2: Move pcode_regs.h out of i915_reg.h (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-21-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_modeset_setup.c
Uma Shankar [Thu, 5 Feb 2026 09:43:40 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_modeset_setup.c

Move GEN9_CLKGATE_DIS_0 reg to display header to make
intel_modeset_setup.c free from i915_reg.h include.

v2: Remove from gmd common header and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-20-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_display_power_well.c
Uma Shankar [Thu, 5 Feb 2026 09:43:39 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_display_power_well.c

Make intel_display_power_well.c free from including i915_reg.h.

v3: Separate bit field for VLV (Ville)

v2: Include specific pcode header, drop common header (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-19-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_display_irq.c
Uma Shankar [Thu, 5 Feb 2026 09:43:38 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_display_irq.c

Move VLV_IRQ_REGS to common header for interrupt to make
intel_display_irq.c free from including i915_reg.h.

v2: Move interrupt to dedicated header (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-18-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_fifo_underrun.c
Uma Shankar [Thu, 5 Feb 2026 09:43:37 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_fifo_underrun.c

Move GEN7_ERR_INT reg to common header to make intel_fifo_underrun.c
free from including i915_reg.h.

v2: Move GEN7_ERR_INT regs to display header (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-17-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_psr.c
Uma Shankar [Thu, 5 Feb 2026 09:43:36 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_psr.c

Move some chicken registers to display header to make
intel_psr.c free from including i915_reg.h.

v3: Update commit header

v2: Use display header instead of gmd common include (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-16-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_rom.c
Uma Shankar [Thu, 5 Feb 2026 09:43:35 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_rom.c

Make intel_rom.c free from including i915_reg.h.

v5: Use SPDX (Jani)

v4: Move oprom reg to separate header (Ville)

v3: Update patch header

v2: Use display header instead of gmd common include (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-15-uma.shankar@intel.com
3 months agodrm/{i915, xe}: Remove i915_reg.h from g4x_hdmi.c
Uma Shankar [Thu, 5 Feb 2026 09:43:34 +0000 (15:13 +0530)] 
drm/{i915, xe}: Remove i915_reg.h from g4x_hdmi.c

Move TRANS_CHICKEN1 reg to display header to make g4x_hdmi.c
free from i915_reg.h dependency.

v2: Remove from common header in include and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-14-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from i9xx_wm.c
Uma Shankar [Thu, 5 Feb 2026 09:43:33 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from i9xx_wm.c

Move FW_BLC_SELF to common header to make i9xx_wm.c
free from i915_reg.h include. Introduce a common
intel_gmd_misc_regs.h to define common miscellaneous
register definitions across graphics and display.

v3: MISC header included as needed, drop from i915_reg (Jani)

v2: Introdue a common misc header for GMD

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-13-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from g4x_dp.c
Uma Shankar [Thu, 5 Feb 2026 09:43:32 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from g4x_dp.c

Move DE_IRQ_REGS to display header to make g4x_dp.c
free from i915_reg.h dependency. These registers are
only used by display and gvt.

v3: Drop a superfluous include (Jani)

v2: Move DE interrupt regs from common to display header (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-12-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_overlay.c
Uma Shankar [Thu, 5 Feb 2026 09:43:31 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_overlay.c

Move GEN2_ISR and some interrupt definitions to common header.
This removes dependency of i915_reg.h from intel_overlay.c.

v3: Rename interrupt header with regs suffix (Jani)

v2: Create a separate file for common interrupts (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-11-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_display.c
Uma Shankar [Thu, 5 Feb 2026 09:43:30 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_display.c

Move CHICKEN_PIPESL_1 register definition to display header.
This allows intel_display.c free of i915_reg.h include.

v3: Fix commit header (Jani)

v2: Drop common header in include and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-10-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_dram.c
Uma Shankar [Thu, 5 Feb 2026 09:43:29 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_dram.c

Make intel_dram.c free from including i915_reg.h.

v3: Move MEM_SS info reg to display instead of pcode header (Jani)

v2: Move mem config register to newly added pcode header (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-9-uma.shankar@intel.com
3 months agodrm/i915: Move GMD_ID and mask to intel_gt header
Uma Shankar [Thu, 5 Feb 2026 09:43:28 +0000 (15:13 +0530)] 
drm/i915: Move GMD_ID and mask to intel_gt header

GMD_ID* is relevant only for GT, hence moving the same
together in gt/intel_gt_regs.h

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-8-uma.shankar@intel.com
3 months agodrm/i915: Remove i915_reg.h from intel_display_device.c
Uma Shankar [Thu, 5 Feb 2026 09:43:27 +0000 (15:13 +0530)] 
drm/i915: Remove i915_reg.h from intel_display_device.c

Move GU_CNTL_PROTECTED and GMD_ID_DISPLAY to common header,
this helps intel_display_device.c free from i915_reg.h dependency.

v2: Move GMD_ID_DISPLAY to display header instead of common (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-7-uma.shankar@intel.com
3 months agodrm/{i915, xe}: Extract pcode definitions to common header
Uma Shankar [Thu, 5 Feb 2026 09:43:26 +0000 (15:13 +0530)] 
drm/{i915, xe}: Extract pcode definitions to common header

There are certain register definitions which are commonly shared
by i915, xe and display. Extract the same to a common header to
avoid duplication.

Move GEN6_PCODE_MAILBOX to common pcode header to make intel_cdclk.c
free from including i915_reg.h.

v3: Include pcode header as required, instead in i915_reg.h (Jani)

v2: Make the header granular and per feature (Jani)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-6-uma.shankar@intel.com
3 months agodrm/i915: Extract DSPCLK_GATE_D from i915_reg to display
Uma Shankar [Thu, 5 Feb 2026 09:43:25 +0000 (15:13 +0530)] 
drm/i915: Extract DSPCLK_GATE_D from i915_reg to display

Move DSPCLK_GATE_D register definition to display header.
This allows intel_gmbus.c not to include i915_reg.h.

v3: Update commit header and message (Jani)

v2: Drop common header in include and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-5-uma.shankar@intel.com
3 months agodrm/i915: Extract display interrupt definitions
Uma Shankar [Thu, 5 Feb 2026 09:43:24 +0000 (15:13 +0530)] 
drm/i915: Extract display interrupt definitions

Extract DE Interrupt registers from i915_reg.h to display header.
This allows intel_display_rps.c not to include i915_reg.h

v2: Update commit message (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-4-uma.shankar@intel.com
3 months agodrm/i915: Extract South chicken registers from i915_reg.h to display
Uma Shankar [Thu, 5 Feb 2026 09:43:23 +0000 (15:13 +0530)] 
drm/i915: Extract South chicken registers from i915_reg.h to display

Extract South Chicken registers from i915_reg.h to display header.
This allows intel_pch_refclk.c not to include i915_reg.h

v3: Drop whitespace changes, commit header updated (Jani)

v2: Drop common header in include and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-3-uma.shankar@intel.com
3 months agodrm/i915: Extract display registers from i915_reg.h to display
Uma Shankar [Thu, 5 Feb 2026 09:43:22 +0000 (15:13 +0530)] 
drm/i915: Extract display registers from i915_reg.h to display

There are certain register definitions which are defined in i915_reg.h
which are exclusively needed by display. Move the same to display
headers to remove i915_reg.h includes from display. This is a step
towards making display independent of i915.

intel_clock_gating.c can include display header directly, since its
usage is planned to be re-factored and will be moved within display.

v3: Updated subject and commit message (Jani)

v2: Drop common header in include and use display_regs.h (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260205094341.1882816-2-uma.shankar@intel.com
3 months agodrm/i915/acpi: free _DSM package when no connectors
Kaushlendra Kumar [Fri, 9 Jan 2026 03:25:49 +0000 (08:55 +0530)] 
drm/i915/acpi: free _DSM package when no connectors

acpi_evaluate_dsm_typed() returns an ACPI package in pkg.
When pkg->package.count == 0, we returned without freeing pkg,
leaking memory. Free pkg before returning on the empty case.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Fixes: 337d7a1621c7 ("drm/i915: Fix invalid access to ACPI _DSM objects")
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260109032549.1826303-1-kaushlendra.kumar@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/overlay: remove dead code with MTL platform checks
Jani Nikula [Fri, 6 Feb 2026 12:59:49 +0000 (14:59 +0200)] 
drm/i915/overlay: remove dead code with MTL platform checks

Commit c5741c5c1122 ("drm/i915/display: Do not use stolen on MTL") added
some checks for MTL in overlay code. However, this is never run on
MTL. Clean it up.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260206125949.243643-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/dp: Verify valid pipe BPP range
Imre Deak [Mon, 9 Feb 2026 13:38:17 +0000 (15:38 +0200)] 
drm/i915/dp: Verify valid pipe BPP range

Ensure that the pipe BPP range is valid after calculating the minimum
and maximum pipe BPP values separately.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260209133817.395823-2-imre.deak@intel.com
3 months agodrm/i915/dp: Fix pipe BPP clamping due to HDR
Imre Deak [Mon, 9 Feb 2026 13:38:16 +0000 (15:38 +0200)] 
drm/i915/dp: Fix pipe BPP clamping due to HDR

The pipe BPP value shouldn't be set outside of the source's / sink's
valid pipe BPP range, ensure this when increasing the minimum pipe BPP
value to 30 due to HDR.

While at it debug print if the HDR mode was requested for a connector by
setting the corresponding HDR connector property. This indicates
if the requested HDR mode could not be enabled, since the selected
pipe BPP is below 30, due to a sink capability or link BW limit.

v2:
- Also handle the case where the sink could support the target 30 BPP
  only in DSC mode due to a BW limit, but the sink doesn't support DSC
  or 30 BPP as a DSC input BPP. (Chaitanya)
- Debug print the connector's HDR mode in the link config dump, to
  indicate if a BPP >= 30 required by HDR couldn't be reached. (Ankit)
- Add Closes: trailer. (Ankit)
- Don't print the 30 BPP-outside of valid BPP range debug message if
  the min BPP is already > 30 (and so a target BPP >= 30 required
  for HDR is ensured).

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7052
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15503
Fixes: ba49a4643cf53 ("drm/i915/dp: Set min_bpp limit to 30 in HDR mode")
Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> # v1
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260209133817.395823-1-imre.deak@intel.com
3 months agodrm/i915/dp: Restore the missing check for intel_dp_has_joiner
Ankit Nautiyal [Fri, 6 Feb 2026 04:47:53 +0000 (10:17 +0530)] 
drm/i915/dp: Restore the missing check for intel_dp_has_joiner

Commit ad121a62d566 ("drm/i915/dp: Rework pipe joiner logic in mode_valid")
replaced intel_dp_num_joined_pipes() with an explicit joiner candidate
iteration. The previous code implicitly checked for DP joiner capability
via intel_dp_has_joiner(), but this check was lost during the refactor.

Restore the missing intel_dp_has_joiner() check in intel_dp_can_join() so
that DP specific joiner conditions are taken into account.

v2: Derive intel_dp from intel_attached_dp(). (Imre)

Fixes: ad121a62d566 ("drm/i915/dp: Rework pipe joiner logic in mode_valid")
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260206044753.808631-1-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Make intel_dp_can_join() static
Ankit Nautiyal [Thu, 5 Feb 2026 08:36:22 +0000 (14:06 +0530)] 
drm/i915/dp: Make intel_dp_can_join() static

intel_dp_can_join() was previously exposed in intel_dp.h, but after the
recent joiner refactor it is only used internally via
intel_dp_joiner_candidate_valid(). It no longer needs external
visibility, so make it static and drop the prototype from intel_dp.h.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260205083623.793902-2-ankit.k.nautiyal@intel.com
3 months agodrm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry
Ankit Nautiyal [Fri, 26 Dec 2025 04:33:59 +0000 (10:03 +0530)] 
drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry

Update the device ID for Dell XPS 13 7390 2-in-1 in the quirk
`QUIRK_EDP_LIMIT_RATE_HBR2` entry. The previous ID (0x8a12) was
incorrect; the correct ID is 0x8a52.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/5969
Fixes: 21c586d9233a ("drm/i915/dp: Add device specific quirk to limit eDP rate to HBR2")
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20251226043359.2553-1-ankit.k.nautiyal@intel.com
3 months agodrm/i915/alpm: Disable LOBF around transitioning for LRR/seamless MN
Ankit Nautiyal [Wed, 4 Feb 2026 05:02:50 +0000 (10:32 +0530)] 
drm/i915/alpm: Disable LOBF around transitioning for LRR/seamless MN

When enabling LRR/seamless MN disable LOBF first and re-enable
afterwards.
- pre_plane_update: if LOBF was enabled, disable LOBF before the
  update_lrr/update_m_n transition.
- post_plane_update: Re-enable LOBF after the transition.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260204050250.762718-6-ankit.k.nautiyal@intel.com
3 months agodrm/i915/alpm: Simplify and align LOBF checks in pre/post plane update
Ankit Nautiyal [Wed, 4 Feb 2026 05:02:49 +0000 (10:32 +0530)] 
drm/i915/alpm: Simplify and align LOBF checks in pre/post plane update

The pre_plane_update and post_plane_update hooks essentially
disable/enable lobf feature. Use the existing _is_enabling/is_disabling
logic for this in the pre_plane_update and post_plane_update paths.

Also rename the helpers to intel_alpm_lobf_{en,dis}able().

v2: Remove redeundant checks during enabling/disabling. (Jouni)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patch.msgid.link/20260204050250.762718-5-ankit.k.nautiyal@intel.com
3 months agodrm/i915/alpm: Allow LOBF only for platform that have Always on VRR TG
Ankit Nautiyal [Wed, 4 Feb 2026 05:02:48 +0000 (10:32 +0530)] 
drm/i915/alpm: Allow LOBF only for platform that have Always on VRR TG

As per bspec the LOBF is allowed when running in fixed refresh rate mode
i.e. when flipline = vmin = vmax and when window1 is non zero. This
implies that we can allow LOBF only when VRR timing generator is running
in the fixed refresh rate mode.

Use the check intel_vrr_always_use_vrr_tg() to avoid LOBF with legacy
timing generator. Also use intel_vrr_is_fixed_rr() to check for fixed
refresh rate mode.

v2: Modify commit message to clarify window1 requirement for LOBF.
(Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260204050250.762718-4-ankit.k.nautiyal@intel.com
3 months agodrm/i915/alpm: Allow LOBF only if window1 > alpm check_entry lines
Ankit Nautiyal [Wed, 4 Feb 2026 05:02:47 +0000 (10:32 +0530)] 
drm/i915/alpm: Allow LOBF only if window1 > alpm check_entry lines

LOBF must be disabled if the number of lines within Window 1 is not greater
than ALPM_CTL[ALPM Entry Check]

v2: Consider the case where SCL is in the active region. (Ville)

Bspec:71041
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260204050250.762718-3-ankit.k.nautiyal@intel.com
3 months agodrm/i915/alpm: Compute LOBF late after guardband is already determined
Ankit Nautiyal [Wed, 4 Feb 2026 05:02:46 +0000 (10:32 +0530)] 
drm/i915/alpm: Compute LOBF late after guardband is already determined

Currently intel_alpm_lobf_compute_config() tries to account for
guardband +SCL requirements during encoder->compute_config() phase,
even before guardband is computed.
Also, LOBF depends on crtc_state->has_psr which can be modified in
encoder->compute_config_late().

Account for lobf requirements while optimizing the guardband and add
checks for final guardband in encoder->compute_config_late() phase after
the guardband and the final state of crtc_state->has_psr are already
computed.

Use crtc_state->vrr.guardband and crtc_state->set_context_latency for
the computation and add more documentation for the dependency of first
sdp position, guardband, set context latency and wake lines.

v2: Add helper to use min guardband required for lobf.
v3: Remove unrelated inadvertent changes. (Michał)
v4: Add a #FIXME note for computing wakelines based on feature. (Jouni)

Bspec:71041
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patch.msgid.link/20260204050250.762718-2-ankit.k.nautiyal@intel.com
3 months agodrm/i915/ltphy: Return true for TBT scenario during lt_phy_state compare
Suraj Kandpal [Wed, 4 Feb 2026 02:32:47 +0000 (08:02 +0530)] 
drm/i915/ltphy: Return true for TBT scenario during lt_phy_state compare

TBT PHY is enablement/disablement is handled by its own TBT module.
We do not play a big part in it's state management, that being take care
by it's own TBT modeule.
The PHY/PLL TypeC mode (TBT, DP-alt) can change after the PLL state was
computed for a modeset, so the state verification after the modeset
sequence would indicate a mismatch in case the mode changed from DP-alt
to TBT, or from TBT to DP-alt mode. To avoid such a mismatch error the
verification is skipped if the mode for either the read-out or the
computed state is TBT (where that TBT PLL state doesn't reflect anyway
the PLL's actual HW state).
Simply return true when we are in tbt mode.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260204023247.1560196-1-suraj.kandpal@intel.com
3 months agodrm/i915/display: Implement Wa_16024710867
Mitul Golani [Tue, 3 Feb 2026 08:49:37 +0000 (14:19 +0530)] 
drm/i915/display: Implement Wa_16024710867

Defeature port sync feature for xe3lpd onwards.

--v1:
- Use xe3lpd naming (Suraj)
- Use IS_DISPLAY_VER (Suraj)

--v2:
- Comments update and Adding Bspec link (Suraj)

Bspec: 69965
Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260203084937.1447834-2-mitulkumar.ajitkumar.golani@intel.com
3 months agodrm/i915/power_well: Enable workaround for DSS clock gating issue
Mika Kahola [Mon, 2 Feb 2026 14:02:42 +0000 (14:02 +0000)] 
drm/i915/power_well: Enable workaround for DSS clock gating issue

Prevent display corruption observed after restart, hotplug, or unplug
operations on Meteor Lake and newer platforms. The issue is caused by
DSS clock gating affecting DSC logic when pipe power wells are disabled.

Apply this WA by disabling DSS clock gating for the affected pipes
before turning off their power wells. This avoids DSC corruption on
external displays.

v2: Use single intel_de_rmw() (Jani)
    Switch to use drm_dbg_kms() instead of drm_printf() (Jani)
    Remove WA number from commit message (Suraj)
    rename dss_clock_gating_enable_disable() to
    dss_pipe_gating_enable_disable();
v3: Do not use open ended display version when checking
    wa (Matt)

WA: 22021048059
BSpec: 690991, 666241
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260202140242.704234-1-mika.kahola@intel.com
3 months agodrm/i915/display: Extend the max dotclock limit to WCL
Chaitanya Kumar Borah [Mon, 2 Feb 2026 10:37:31 +0000 (16:07 +0530)] 
drm/i915/display: Extend the max dotclock limit to WCL

Add upper limit check for pixel clock for WCL.

For prior platforms though the bspec mentions the dotclock limits, however
these are intentionally not enforced to avoid regressions, unless real
issues are observed.

BSpec: 49199, 68912
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-18-ankit.k.nautiyal@intel.com
3 months agodrm/i915/display: Add upper limit check for pixel clock
Chaitanya Kumar Borah [Mon, 2 Feb 2026 10:37:30 +0000 (16:07 +0530)] 
drm/i915/display: Add upper limit check for pixel clock

Add upper limit check for pixel clock for DISPLAY_VER >= 30.
Limits don't apply when DSC is enabled.

The helper returns the upper limit for the platforms, capped to the
max dotclock (khz).

For the currently supported versions of HDMI, pixel clock is already
limited to 600Mhz so nothing needs to be done there as of now.

v2:
 - Add this limit to the new helper.
v3:
 - Rename helper to intel_max_uncompressed_dotclock(). (Imre)
 - Limit only for PTL and cap the limit to max_dotclock. (Imre)

BSpec: 49199, 68912
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-17-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Add helpers for joiner candidate loops
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:29 +0000 (16:07 +0530)] 
drm/i915/dp: Add helpers for joiner candidate loops

Introduce for_each_joiner_candidate(), intel_dp_joiner_candidate_valid()
and intel_dp_joiner_candidate_valid() to remove duplicated joiner
enumeration and validity checks across DP SST and MST paths.

Suggested-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-16-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Account for DSC slice overhead
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:28 +0000 (16:07 +0530)] 
drm/i915/dp: Account for DSC slice overhead

Account for DSC slice overhead bubbles and adjust the pixel rate while
checking the pixel rate against the max dotclock limits.

v2: Add missing assignment for dsc_slice_count in
mst_connector_mode_valid_ctx(). (Imre)

v3: Explicitly pass dsc_slice_count as 0 for Non-DSC case. (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-15-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Refactor dsc_slice_count handling in intel_dp_mode_valid()
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:27 +0000 (16:07 +0530)] 
drm/i915/dp: Refactor dsc_slice_count handling in intel_dp_mode_valid()

Make dsc_slice_count closer to the block where it is used and promote it
from u8 to int. This aligns it with upcoming DSC bubble pixel-rate
adjustments, where the slice count participates in wider arithmetic.

Currently, for non-eDP (DP/DP_MST) cases  the slice count is computed only
inside intel_dp_dsc_mode_valid() and is not used by the caller. Once DSC
bubble handling is added, dp_mode_valid() will need access to its own local
slice count for non-eDP cases as well.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-14-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Introduce helper to check pixel rate against dotclock limits
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:26 +0000 (16:07 +0530)] 
drm/i915/dp: Introduce helper to check pixel rate against dotclock limits

Add intel_dp_dotclk_valid() helper, that checks the required pixel rate
against platform dotclock limit. With joined pipes the effective dotclock
limit depends upon the number of joined pipes.

Call the helper from the mode_valid phase and from the compute_config
phase where we need to check the limits for the given target clock for a
given joiner candidate.

v2: Rename the helper to intel_dp_dotclk_valid(). (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-13-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Remove unused joiner helpers
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:25 +0000 (16:07 +0530)] 
drm/i915/dp: Remove unused joiner helpers

The helpers intel_dp_num_joined_pipes() and intel_dp_needs_joiner() are no
longer used now that joiner selection iterates over all candidates.
Remove them.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-12-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp_mst: Rework pipe joiner logic in compute_config
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:24 +0000 (16:07 +0530)] 
drm/i915/dp_mst: Rework pipe joiner logic in compute_config

Similar to the DP SST, refactor mst_stream_compute_config() to iterate
over joiner candidates and select the minimal joiner configuration that
satisfies the mode requirements. This prepares the logic for future changes
that will consider DSC slice overhead.

v2:
 - Move the check for dotclock in the new helper and check for both DSC and
   non-DSC case. In case the check fails for non-DSC, fallback to DSC
   configuration. (Imre)
 - Propagate the return value from the core helper:
   mst_stream_compute_link_for_joined_pipes(). (Imre)
v3:
 - Use num_joined_pipes instead of num_pipes. (Imre)
v4:
 - Switch to 'ret == 0' for break condition to match SST code.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-11-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp_mst: Extract helper to compute link for given joiner config
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:23 +0000 (16:07 +0530)] 
drm/i915/dp_mst: Extract helper to compute link for given joiner config

Move the joiner-dependent portion of mst_stream_compute_config() into
mst_stream_compute_link_for_joined_pipes(), which computes the MST link
configuration for a specific num_joined_pipes.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-10-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp_mst: Rework pipe joiner logic in mode_valid
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:22 +0000 (16:07 +0530)] 
drm/i915/dp_mst: Rework pipe joiner logic in mode_valid

Refactor the logic to get the number of joined pipes. Start with a single
pipe and incrementally try additional pipes only if needed. While DSC
overhead is not yet computed here, this restructuring prepares the code to
support that in follow-up changes.

v2:
 - Remove fallback in case force-joiner configuration fails. (Imre)
 - Drop redundant MODE_OK assignment (Imre)
v3:
 - Align with the changes in intel_dp_mode_valid(). (Imre)
v4:
 - Set MODE_CLOCK_HIGH on DSC/rate failures aligning with SST case. (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-9-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp_mst: Move the joiner dependent code together
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:21 +0000 (16:07 +0530)] 
drm/i915/dp_mst: Move the joiner dependent code together

Move the calculation of num_joined_pipes and other constraints that
depend on it, into a single block in mst_stream_compute_config().

This groups all joiner-dependent logic together, preparing the code for a
future loop-based evaluation of multiple joiner configurations.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-8-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp_mst: Move the check for dotclock at the end
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:20 +0000 (16:07 +0530)] 
drm/i915/dp_mst: Move the check for dotclock at the end

Refactor the mode_valid to have all joiner dependent stuff together and
place the check for dotclock limit at the very end.

This will help in the following refactor to iterate over the joiner
candidates and find the best joiner candidate that satisfy all checks
and limits.

v2: Update status to MODE_CLOCK_HIGH if max_dotclock check fails. (Imre)
v3: Drop redundant MODE_OK assignment and return. (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-7-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Rework pipe joiner logic in compute_config
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:19 +0000 (16:07 +0530)] 
drm/i915/dp: Rework pipe joiner logic in compute_config

Currently, the number of joined pipes are determined early in the flow,
which limits flexibility for accounting DSC slice overhead. To address
this, recompute the joined pipe count during DSC configuration.

Refactor intel_dp_dsc_compute_config() to iterate over joiner candidates
and select the minimal joiner configuration that satisfies the mode
requirements. This prepares the logic for future changes that will
consider DSC slice overhead.

v2:
 - Rename helper to intel_dp_compute_link_for_joined_pipes(). (Imre)
 - Move the check for max dotclock inside the helper so that if dotclock
   check fails for non DSC case for a given number of joined pipes, we
   are able to fallback to the DSC mode. (Imre)
v3:
 - Drop fallback to other joiner configurations, if the force joiner
   configuration fails. (Imre)
 - Check for maxdotclock limit for non-DSC case first and fall back to
   DSC if the check fails. (Imre)
 - Initialize ret to -EINVAL to handle case where we bail out early.
   (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-6-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Rework pipe joiner logic in mode_valid
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:18 +0000 (16:07 +0530)] 
drm/i915/dp: Rework pipe joiner logic in mode_valid

Currently in intel_dp_mode_valid(), we compute the number of joined pipes
required before deciding whether DSC is needed. This ordering prevents us
from accounting for DSC-related overhead when determining pipe
requirements.

It is not possible to first decide whether DSC is needed and then compute
the required number of joined pipes, because the two depend on each other:

 - DSC need is a function of the pipe count (e.g., 4‑pipe always requires
   DSC; 2‑pipe may require it if uncompressed joiner is unavailable).

 - Whether a given pipe‑join configuration is sufficient depends on
   effective bandwidth, which itself changes when DSC is used.

As a result, the only correct approach is to iterate candidate pipe counts.

So, refactor the logic to start with a single pipe and incrementally try
additional pipes only if needed. While DSC overhead is not yet computed
here, this restructuring prepares the code to support that in a follow-up
changes.

If a forced joiner configuration is present, we just check for that
configuration. If it fails, we bailout and return instead of trying with
other joiner configurations.

v2:
 - Iterate over number of pipes to be joined instead of joiner
   candidates. (Jani)
 - Document the rationale of iterating over number of joined pipes.
   (Imre)
v3:
 - In case the force joiner configuration doesn't work, do not fallback
   to the normal routine, bailout instead of trying other joiner
   configurations. (Imre)
v4:
 - Use num_joined_pipes instead of num_pipes. (Imre)
 - Inititialize status before the loops starts. (Imre)
v5:
 - Fix status handling by setting MODE_CLOCK_HIGH on DSC/rate failures.
   (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-5-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Extract helper to get the hdisplay limit
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:17 +0000 (16:07 +0530)] 
drm/i915/dp: Extract helper to get the hdisplay limit

Separate out function to get the hdisplay limit for a given platform.

v2: Rename the helper to intel_dp_max_hdisplay_per_pipe(). (Imre)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-4-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Move num_joined_pipes and related checks together
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:16 +0000 (16:07 +0530)] 
drm/i915/dp: Move num_joined_pipes and related checks together

Move the calculation of `num_joined_pipes` and other constraints that
depend on it, into a single block.
This groups all joiner-dependent logic together, preparing the code for a
future loop-based evaluation of multiple joiner configurations.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-3-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Early reject bad hdisplay in intel_dp_mode_valid
Ankit Nautiyal [Mon, 2 Feb 2026 10:37:15 +0000 (16:07 +0530)] 
drm/i915/dp: Early reject bad hdisplay in intel_dp_mode_valid

Move check for bad hdisplay early as it is independent on other checks.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-2-ankit.k.nautiyal@intel.com
3 months agodrm/i915/dp: Add a meaningful return to intel_dp_read_dsc_dpcd
Suraj Kandpal [Mon, 2 Feb 2026 08:18:02 +0000 (13:48 +0530)] 
drm/i915/dp: Add a meaningful return to intel_dp_read_dsc_dpcd

Add a meaningful return to intel_dp_read_dsc_dpcd. This is to avoid
unwanted DPCD reads which are not needed once we know DSC DPCD
read fails. To do this convert drm_dp_dpcd_read to drm_dp_dpcd_read_data
which returns a meaningful error which can be propogated up when all
bits are not read.
While we are at it convert the drm_err in intel_dp_read_dsc_dpcd to
drm_dbg_kms. This is because we do not want a hard ERROR when we
call this function, during the intel_dp_detect phase since AUX may not
be up, it is expected to fail but we do not expect a failure in read
when we call intel_dp_dsc_get_sink_cap so we move the drm_err there.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260202081801.1400708-1-suraj.kandpal@intel.com
3 months agodrm/i915/display: fix the pixel normalization handling for xe3p_lpd
Vinod Govindapillai [Fri, 30 Jan 2026 09:59:19 +0000 (11:59 +0200)] 
drm/i915/display: fix the pixel normalization handling for xe3p_lpd

Pixel normalizer is enabled with normalization factor as 1.0 for
FP16 formats in order to support FBC for those formats in xe3p_lpd.
Previously pixel normalizer gets disabled during the plane disable
routine. But there could be plane format settings without explicitly
calling the plane disable in-between and we could endup keeping the
pixel normalizer enabled for formats which we don't require that.
This is causing crc mismatches in yuv formats and FIFO underruns in
planar formats like NV12. Fix this by updating the pixel normalizer
configuration based on the pixel formats explicitly during the plane
settings arm calls itself - enable it for FP16 and disable it for
other formats in HDR capable planes.

v2: avoid redundant pixel normalization setting updates

v3: moved the normalization factor definition to intel_fbc.c and some
    updates to comments

v4: simplified the pixel normalizer setting handling

Fixes: 5298eea7ed20 ("drm/i915/xe3p_lpd: use pixel normalizer for fp16 formats for FBC")
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260130095919.107805-1-vinod.govindapillai@intel.com
3 months agodrm/i915/psr: Use TRANS_PUSH to trigger frame change event
Jouni Högander [Tue, 27 Jan 2026 12:41:20 +0000 (14:41 +0200)] 
drm/i915/psr: Use TRANS_PUSH to trigger frame change event

Now we have everything in place for triggering PSR "frame change" event
using TRANS_PUSH: use TRANS_PUSH for LunarLake and onwards.

v4:
  - Added call to intel_vrr_psr_frame_change_enable call
  - added setting LNL_TRANS_PUSH_PSR_PR_EN into intel_vrr_send_push
v3: use HAS_PSR_FRAME_CHANGE macro
v2: use AND instead of OR in intel_psr_use_trans_push

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-12-jouni.hogander@intel.com
3 months agodrm/i915/display: Add HAS_PSR_TRANS_PUSH_FRAME_CHANGE macro
Jouni Högander [Tue, 27 Jan 2026 12:41:19 +0000 (14:41 +0200)] 
drm/i915/display: Add HAS_PSR_TRANS_PUSH_FRAME_CHANGE macro

Add a macro indicating that the platform supports triggering a Frame
Change event for the PSR HW using the TRANS PUSH mechanism.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-11-jouni.hogander@intel.com
3 months agodrm/i915/psr: Do PSR exit on frontbuffer flush on LunarLake and onwards
Jouni Högander [Tue, 27 Jan 2026 12:41:18 +0000 (14:41 +0200)] 
drm/i915/psr: Do PSR exit on frontbuffer flush on LunarLake and onwards

We need to use intel_psr_exit in frontbuffer flush on LunarLake and
onwards if we want to move using trans push mechanism to trigger Frame
Change event.

Keep PSR1 and PSR2 HW tracking as it is for older platforms as this was
seen causing problems there.

v2: typo fixed

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-10-jouni.hogander@intel.com
3 months agodrm/i915/psr: Wait for idle only after possible send push
Jouni Högander [Tue, 27 Jan 2026 12:41:17 +0000 (14:41 +0200)] 
drm/i915/psr: Wait for idle only after possible send push

We are planning to move using trans push mechanism to trigger the Frame
Change event. In that case we can't wait PSR to idle before send push
happens. Due to this move wait for idle to be done after possible send push
is done.

This should be ok for Frame Change event triggered by register write as
well. Wait for idle is needed only for corner case where PSR is
transitioning into DEEP_SLEEP when Frame Change event is triggered. It just
has to be before wait for vblank. Otherwise we may have vblank before PSR
enters DEEP_SLEEP and still using old frame buffers for first frame after
wake up.

v2: some typos fixed

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-9-jouni.hogander@intel.com
3 months agodrm/i915/display: Wait for vblank in case of PSR is using trans push
Jouni Högander [Tue, 27 Jan 2026 12:41:16 +0000 (14:41 +0200)] 
drm/i915/display: Wait for vblank in case of PSR is using trans push

In case PSR uses trans push as a "frame change" event and we need to wait
vblank after triggering PSR "frame change" event. Otherwise we may miss
selective updates.

DSB skips all waits while PSR is active. Check push send is skipped as well
because trans push send bit is not reset by the HW if VRR is not enabled ->
we may start configuring new selective update while previous is not
complete. Avoid this by waiting for vblank after sending trans push.

v2: some typos fixed

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-8-jouni.hogander@intel.com
3 months agodrm/i915/dsb: Set DSB_SKIP_WAITS_EN chicken bit for LunarLake and onwards
Jouni Högander [Tue, 27 Jan 2026 12:41:15 +0000 (14:41 +0200)] 
drm/i915/dsb: Set DSB_SKIP_WAITS_EN chicken bit for LunarLake and onwards

On LunarLake we are using TRANS_PUSH mechanism to trigger "Frame Change"
event. This way we have more control on when PSR HW is woken up. I.e. not
every display register write is triggering sending update. This allows us
setting DSB_SKIP_WAITS_EN chicken bit as well.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-7-jouni.hogander@intel.com
3 months agodrm/i915/vrr: Prepare to Use TRANS_PUSH mechanism for PSR frame change
Jouni Högander [Tue, 27 Jan 2026 12:41:14 +0000 (14:41 +0200)] 
drm/i915/vrr: Prepare to Use TRANS_PUSH mechanism for PSR frame change

On Lunarlake and onward it is possible to generate PSR Frame Change
event using TRANS_PUSH mechanism:

Ensure push is performed on flip if needed by PSR.

Don't use intel_psr_trigger_frame_change_event if PSR uses trans push as
Frame Change event: When not using trans push to generate Frame Change
event plane/pipe register writes are triggering the event. This is causing
problems when transiting to PSR active/idle and the event is coming in. To
tackle this we are waiting PSR to idle and using
intel_psr_trigger_frame_change_event to ensure PSR exit. If the Frame
change event is triggered after everything is configured (on trans push) we
don't need to worry about all this.

Ensure possible intel_vrr_tg_disable call is not overwriting
LNL_TRANS_PUSH_PSR_PR_EN.

v8:
  - split adding intel_vrr_psr_frame_change_enable as a separate change
  - update commit message
v7:
  - HAS_PSR_FRAME_CHANGE macro moved to separate patch and renamed as
    HAS_PSR_TRANS_PUSH_FRAME_CHANGE
  - use intel_psr_use_trans_push instead of HAS_PSR_FRAME_CHANGE in
    intel_psr_trigger_frame_change
  - moved calling intel_vrr_psr_frame_change_enable away from this patch
v6:
  - add HAS_PSR_FRAME_CHANGE macro
  - use TRANS_PUSH in instead of TRAN_VRR_CTL
v5: use intel_psr_use_trans_push for intel_vrr_psr_frame_change_enable
v4:
  - use rmw when enabling/disabling transcoder
  - set TRANS_PUSH_EN conditionally in intel_vrr_send_push
  - do not call intel_vrr_send_push from intel_psr_trigger_frame_change
  - do not enable using TRANS_PUSH mechanism for PSR "Frame Change"
v3:
  - use rmw when enabling/disabling
  - keep LNL_TRANS_PUSH_PSR_PR_EN set always on LunarLake and onwards
v2: use intel_vrr_trans_push_enabled_set_clear instead of rmw

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-6-jouni.hogander@intel.com
3 months agodrm/i915/vrr: Add helper for PSR to enable Frame Change event on trans push
Jouni Högander [Tue, 27 Jan 2026 12:41:13 +0000 (14:41 +0200)] 
drm/i915/vrr: Add helper for PSR to enable Frame Change event on trans push

Add new helper to enable PSR Frame Change event generation using trans push
mechanism. This helper is to be used by PSR code on PSR enable.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-5-jouni.hogander@intel.com
3 months agodrm/i915/vrr: Add helper for parsing value to be written into TRANS_PUSH
Jouni Högander [Tue, 27 Jan 2026 12:41:12 +0000 (14:41 +0200)] 
drm/i915/vrr: Add helper for parsing value to be written into TRANS_PUSH

On Lunarlake and onwards it is possible to generate PSR "frame change"
event using TRANS_PUSH mechanism. As a preparation add new helper to parse
value to be written into TRANS_PUSH register. Setting
LNL_TRANS_PUSH_PSR_PR_EN is done in upcoming change.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-4-jouni.hogander@intel.com
3 months agodrm/i915/psr: Add intel_psr_use_trans_push to query if TRANS_PUSH is used
Jouni Högander [Tue, 27 Jan 2026 12:41:11 +0000 (14:41 +0200)] 
drm/i915/psr: Add intel_psr_use_trans_push to query if TRANS_PUSH is used

This is a preparation to start using trans push as a PSR "Frame Change"
event. It adds intel_psr_use_trans_push placeholder which return false for
now until we have everything in place.

v2:
  - modify commit message
  - add TODO

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-3-jouni.hogander@intel.com
3 months agodrm/i915/psr: Add TRANS_PUSH register bit definition for PSR
Jouni Högander [Tue, 27 Jan 2026 12:41:10 +0000 (14:41 +0200)] 
drm/i915/psr: Add TRANS_PUSH register bit definition for PSR

Add TRANS_PUSH register bit LNL_TRANS_PUSH_PSR_PR_EN definition for PSR
usage.

v2: add bspec reference

Bspec: 69984
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260127124120.1069026-2-jouni.hogander@intel.com
4 months agodrm/i915: move intel_gvt_init() level higher
Michał Grzelak [Thu, 29 Jan 2026 09:01:29 +0000 (10:01 +0100)] 
drm/i915: move intel_gvt_init() level higher

Both initialisation and removal of GVT happen at different abstraction
levels. Hence caller of i915_driver_hw_probe() has no way of knowing
status of intel_gvt_init(). This can lead to an unbalanced number of
calls of intel_gvt_init() and intel_gvt_driver_remove() since GVT error
path is currently handled in i915_driver_probe(). One such scenario has
been seen with i915_driver_hw_probe() fault injection, which caused
double entry deletion and list corruption.

Move intel_gvt_init() up to i915_driver_probe(). Add out_cleanup_gvt
error path for removing gvt. Trigger it only after intel_gvt_init()
succeeded.

In case intel_gvt_init() failed, theoretically we should follow err_msi
error path. That is actually impossible since call to intel_gvt_init()
unconditionally returns 0, although it claims to return negative error
code on failure. Thus follow standard out_cleanup_hw error path on a
hypothetical future intel_gvt_init() failure. Remove err_msi label from
i915_driver_hw_probe() since intel_gvt_init() was the only user of it.

Changelog:
v1->v2
- don't move err_msi error path from i915_driver_hw_probe (Jani)
- rewrite commit message

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15481
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patch.msgid.link/20260129090129.2601661-2-michal.grzelak@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/gvt: drop unnecessary include of intel_display.h
Jani Nikula [Wed, 28 Jan 2026 14:59:10 +0000 (16:59 +0200)] 
drm/i915/gvt: drop unnecessary include of intel_display.h

This does not appear to be needed at all.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/32359d5d5feb777ecc7c983d970823218851035f.1769612208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/gvt: drop dependency on intel_display_types.h
Jani Nikula [Wed, 28 Jan 2026 14:59:09 +0000 (16:59 +0200)] 
drm/i915/gvt: drop dependency on intel_display_types.h

Avoid even accidental use of display details by dropping the include of
intel_display_types.h. We'll still have to include intel_dpll_mgr.h for
the DPLL IDs, but at least the surface is smaller.

Add duplicate defines of pipe_name() and port_name() to avoid depending
on display. They're trivial enough to be acceptable.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/2fa5677f5ff3dbeaa75a7984d74fb9855a4ba3d2.1769612208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/gvt: drop dependency on display struct dpll
Jani Nikula [Wed, 28 Jan 2026 14:59:08 +0000 (16:59 +0200)] 
drm/i915/gvt: drop dependency on display struct dpll

The gvt code has no real need for struct dpll, it's just a collection of
variables. So use a bunch of variables instead.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/ff7478efa80323c638a31c578cb1d707692ef51d.1769612208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/display: move enum aux_ch to intel_display_limits.h
Jani Nikula [Wed, 28 Jan 2026 14:59:07 +0000 (16:59 +0200)] 
drm/i915/display: move enum aux_ch to intel_display_limits.h

Move enum aux_ch from intel_display.h to intel_display_limits.h to avoid
having to include the former from gvt. This currently happens via
intel_display_types.h, which we can also drop in favour of
intel_display_limits.h in intel_gvt_mmio_table.c.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/86ccc91ee1ca96fa145b750e2f1935918ec288d0.1769612208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/cdclk: Extend Wa_13012396614 to Xe3p_LPD
Gustavo Sousa [Thu, 22 Jan 2026 12:37:07 +0000 (09:37 -0300)] 
drm/i915/cdclk: Extend Wa_13012396614 to Xe3p_LPD

Xe3p_LPD also needs Wa_13012396614.  Update the conditions for that
workaround accordingly.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260122-wa_13012396614-xe3p_lpd-v1-1-39d34a3a5b77@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
4 months agodrm/i915/display: vcpi is always greater than zero
Jonathan Cavitt [Fri, 23 Jan 2026 17:09:15 +0000 (17:09 +0000)] 
drm/i915/display: vcpi is always greater than zero

Static analysis issue:

intel_conn_to_vcpi currently checks and asserts vcpi >= 0, as grabbed
from payload->vcpi.  But payload->vcpi is a u8, so this is always true.
Remove this unnecessary check.

While we're here, the jump statements in this function are largely
defunct now, so remove those as well.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20260123170914.64548-2-jonathan.cavitt@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
4 months agodrm/{i915, xe}/pcode: move display pcode calls to parent interface
Jani Nikula [Mon, 26 Jan 2026 11:29:25 +0000 (13:29 +0200)] 
drm/{i915, xe}/pcode: move display pcode calls to parent interface

Call the parent driver pcode functions through the parent interface
function pointers instead of expecting both to have functions of the
same name.

In i915, add the interface to existing intel_pcode.[ch], while in xe
move them to new display/xe_display_pcode.[ch] and build it only for
CONFIG_DRM_XE_DISPLAY=y.

Do not add separate write and write_timeout calls in the
interface. Instead, handle the default 1 ms timeout in the
intel_parent.c glue layer.

This drops the last intel_pcode.h includes from display, and allows us
to remove the corresponding xe compat header.

v2: initialize .pcode in i915

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260126112925.2452171-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/display: Disable DMG Clock Gating
Suraj Kandpal [Thu, 22 Jan 2026 03:18:18 +0000 (08:48 +0530)] 
drm/i915/display: Disable DMG Clock Gating

Incorrect clock is connected to DMG registers.
Disable DMG Clock gating during display initialization.

WA: 22021451799
Bspec: 69095
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Link: https://patch.msgid.link/20260122031818.703590-1-suraj.kandpal@intel.com
4 months agodrm/i915/cx0: Rename intel_clear_response_ready flag
Suraj Kandpal [Thu, 22 Jan 2026 04:48:59 +0000 (10:18 +0530)] 
drm/i915/cx0: Rename intel_clear_response_ready flag

Rename the non static intel_clear_response_ready_flag to
intel_cx0_clear_response_ready_flag so that we follow the
naming standards of non static function.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Link: https://patch.msgid.link/20260122044859.753682-2-suraj.kandpal@intel.com
4 months agodrm/i915/cx0: Clear response ready & error bit
Suraj Kandpal [Thu, 22 Jan 2026 04:48:58 +0000 (10:18 +0530)] 
drm/i915/cx0: Clear response ready & error bit

Clear the response ready and error bit of PORT_P2M_MESSAGE_BUS_STATUS
before writing the transaction pending bit of
PORT_M2P_MSGBUS_CTL as that is a hard requirement. If not done
we find that the PHY hangs since it ends up in a weird state if left
idle for more than 1 hour.

Bspec: 65101
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260122044859.753682-1-suraj.kandpal@intel.com
4 months agodrm/{i915, xe}/dsb: move DSB buffer to parent interface
Jani Nikula [Tue, 20 Jan 2026 15:45:41 +0000 (17:45 +0200)] 
drm/{i915, xe}/dsb: move DSB buffer to parent interface

Move the DSB buffer handling to the display parent interface, making
display more independent of i915 and xe driver implementations.

Since the DSB parent interface is only called from intel_dsb.c, add the
wrappers there with smaller visibility instead of the usual
intel_parent.[ch], and using struct intel_dsb as the context parameter
for convenience.

Unfortunately, memset() being a macro in linux/fortify-string.h, we
can't use that as the function pointer name. dsb->memset() would be
using the macro and leading to build failures. Therefore, use .fill()
for the memset() functionality.

v2: s/memset/fill/

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/df117c862a6d34dae340e4a85c2482b4e29c8884.1768923917.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dsb: move i915 specific DSB buffer implementation to i915
Jani Nikula [Tue, 20 Jan 2026 15:45:40 +0000 (17:45 +0200)] 
drm/i915/dsb: move i915 specific DSB buffer implementation to i915

The DSB buffer implementation is different for both i915 and xe. Move
the i915 specific implementation from display to i915 core.

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/a01b3e69a3f79713eacf437af00dbe23d2f9c8dd.1768923917.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915: move GEN7_ERR_INT snapshot to display irq code
Jani Nikula [Thu, 22 Jan 2026 12:37:59 +0000 (14:37 +0200)] 
drm/i915: move GEN7_ERR_INT snapshot to display irq code

The error interrupt register GEN7_ERR_INT is a display irq
register. Move its GPU error capture to display irq snapshot.

Cc: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260122123759.1701492-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915: Document the GMCH_CTRL register a bit
Ville Syrjälä [Mon, 8 Dec 2025 18:26:37 +0000 (20:26 +0200)] 
drm/i915: Document the GMCH_CTRL register a bit

The actual GMCH_CRTL lives in the host bridge aka. device 0,
but device 2 has a read-only mirror on i85x/i865+. Document
that fact.

Also remove the ancient tales about where the defines are used.
Those haven't been true in a long time.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-20-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915: Clean up PCI config space reg defines
Ville Syrjälä [Mon, 8 Dec 2025 18:26:36 +0000 (20:26 +0200)] 
drm/i915: Clean up PCI config space reg defines

The PCI config space register defines in i915_drm.h are
a bit of a mess; Whitespace is all over the place, register
masks and values are defined in inconsistent ways.

Clean it up a bit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-19-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915: Get rid of the INTEL_GMCH_CTRL alias
Ville Syrjälä [Mon, 8 Dec 2025 18:26:35 +0000 (20:26 +0200)] 
drm/i915: Get rid of the INTEL_GMCH_CTRL alias

INTEL_GMCH_CTRL and I830_GMCH_CTRL are the same register.
Get rid of the INTEL_GMCH_CTRL name.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-18-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/crt: Extract intel_crt_sense_above_threshold()
Ville Syrjälä [Mon, 8 Dec 2025 18:26:34 +0000 (20:26 +0200)] 
drm/i915/crt: Extract intel_crt_sense_above_threshold()

Extract the CRT sense check into a helper instead of repeating
the same thing twice.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-17-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/crt: Use IS0_R instead of VGA_MIS_W
Ville Syrjälä [Mon, 8 Dec 2025 18:26:33 +0000 (20:26 +0200)] 
drm/i915/crt: Use IS0_R instead of VGA_MIS_W

Use the proper IS0_R name for the VGA input status register 0, instead
of using the VGA_MIS_W alias which is meant for write accesses to the
same address. Yes, VGA registers are weird.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-16-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agovideo/vga: Add VGA_IS0_R
Ville Syrjälä [Tue, 9 Dec 2025 07:55:49 +0000 (09:55 +0200)] 
video/vga: Add VGA_IS0_R

Add a proper name for the "Input status register 0" IO address.
Currently we have some code that does reads using the aliasing
VGA_MSR_W define, making it unclear what register we're
actually reading.

v2: Remove stray '?'

Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251209075549.14051-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Helge Deller <deller@gmx.de>
4 months agodrm/i915/vga: Use MMIO for VGA registers on pre-g4x
Ville Syrjälä [Mon, 8 Dec 2025 18:26:31 +0000 (20:26 +0200)] 
drm/i915/vga: Use MMIO for VGA registers on pre-g4x

On pre-g4x VGA registers are accessible via MMIO. Make use of
it so that we can avoid dealing with the VGA arbiter.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-14-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/vga: Introduce intel_vga_{read,write}()
Ville Syrjälä [Mon, 8 Dec 2025 18:26:30 +0000 (20:26 +0200)] 
drm/i915/vga: Introduce intel_vga_{read,write}()

VGA register are rather special since they either get accessed
via the global IO addresses, or possibly through MMIO on
pre-g4x platforms. Wrap all VGA register accesses in
intel_vga_{read,write}() to make it obvious where they get
accessed.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-13-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/de: Add intel_de_write8()
Ville Syrjälä [Mon, 8 Dec 2025 18:26:29 +0000 (20:26 +0200)] 
drm/i915/de: Add intel_de_write8()

Add a write counterpart to intel_de_read8(). Will be used for
MMIO access to VGA registers on pre-g4x.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-12-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/de: Simplify intel_de_read8()
Ville Syrjälä [Mon, 8 Dec 2025 18:26:28 +0000 (20:26 +0200)] 
drm/i915/de: Simplify intel_de_read8()

intel_de_read8() is only needed for VGA register MMIO access
by the CRT code on gen2/3. Remove the redundant wakelock stuff,
and add a platform check to make sure this won't get used on
any platform where MMIO VGA register accesses don't work.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-11-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/vga: Assert that VGA register accesses are going to the right GPU
Ville Syrjälä [Mon, 8 Dec 2025 18:26:27 +0000 (20:26 +0200)] 
drm/i915/vga: Assert that VGA register accesses are going to the right GPU

We want our VGA register accesses to land on the correct GPU.
Check that the VGA routing is appropriately configured.

For the iGPU this just means the IO decode enable on the GPU, but
for dGPUs we also need the entire chain of bridges to forward the
VGA accesses.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-10-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/vga: Stop trying to use GMCH_CTRL for VGA decode control
Ville Syrjälä [Mon, 8 Dec 2025 18:26:26 +0000 (20:26 +0200)] 
drm/i915/vga: Stop trying to use GMCH_CTRL for VGA decode control

intel_gmch_vga_set_state() is a complete lie on ILK+ because
the GMCH_CTRL register is locked and can't actually be written.
But we still need to remove the iGPU from the VGA arbitration
on iGPU+dGPU systems, or else Xorg performance will tank due
to the constant VGA arbiter accesses.

For VGA memory decode we can't turn off the PCI_COMMAND
memory deocde as that would disable even normal MMIO.
Instead we can disable just the VGA memory decode via
the VGA MSR register. And we can do that just once
when disabling the VGA plane. That way we don't have
to touch VGA registers anywhere else.

We can also inform the arbiter that we're no longer decoding
VGA memory. This will stop the arbiter from disabling all
memory decode for the iGPU via PCI_COMMAND (and thus breaking
everything) whenever some other GPU wants to own the VGA memory
accesses.

For IO we can disable all IO decode via the PCI_COMMAND
register, except around the few VGA register accesses that
we need to do in intel_vga_disable(). Unfortunately we can't
disable IO decode permanently as it makes some laptops (eg.
Dell Latitude E5400) hang during reboot/shutdown. One option
would be to re-enable IO decode from the poweroff hooks, but
that won't help the sysrq emergency reboot/shutdown since it
won't call said hooks. So let's try to keep IO decode in its
original setting unless we really need to disable it to
exclude the GPU from VGA arbitration.

I suppose we could keep frobbing GMCH_CTRL on pre-ILK, but
it seems better to not do it since it has other side effects
such as changing the class code of the PCI device.

For discrete GPUs we'll rely on the bridge control instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251208182637.334-9-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com>