]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agodrm/i915/cx0: Use intel_port_to_tc() instead of open coding it
Imre Deak [Thu, 20 Nov 2025 17:23:56 +0000 (19:23 +0200)] 
drm/i915/cx0: Use intel_port_to_tc() instead of open coding it

Use intel_port_to_tc() in mtl_port_to_pll_id(), instead of open coding
the same.

v2: s/USe/Use in commit message.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251120172358.1282765-3-imre.deak@intel.com
2 months agodrm/i915/tc: Add separate intel_tc_phy_port_to_tc() for TC DDI/PHY ports
Imre Deak [Thu, 20 Nov 2025 17:23:55 +0000 (19:23 +0200)] 
drm/i915/tc: Add separate intel_tc_phy_port_to_tc() for TC DDI/PHY ports

intel_port_to_tc() returns the PORT_TC1..6 -> TC_PORT_1..6 mapping only
for DDI ports that are connected to a TypeC PHY. In some cases this
mapping is also required for TypeC DDI ports which are not connected to
a TypeC PHY. Such DDI ports are the PORT_TC1..4 ports on RKL/ADLS/BMG.

Add a separate intel_tc_phy_to_tc() helper to return the mapping for
ports connected to a TypeC PHY, and make all the current users - which
expect this semantic - call this helper. A follow-up change will need to
get the same mapping for TypeC DDI ports not connected to a TypeC PHY,
leave intel_port_to_tc() exported for that.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251120172358.1282765-2-imre.deak@intel.com
2 months agodrm/i915/cx0: Fix port to PLL ID mapping on BMG
Imre Deak [Thu, 20 Nov 2025 17:23:54 +0000 (19:23 +0200)] 
drm/i915/cx0: Fix port to PLL ID mapping on BMG

The intel_port_to_tc() call in mtl_port_to_pll_id() assumed that all
TypeC DDI ports are connected to a TypeC PHY. This is not true on BMG
where all the ports - including the PORT_TC1..4 TypeC DDI ports - are
connected to a non-TypeC PHY. For these ports intel_port_to_tc()
returns TC_PORT_NONE, which results in an incorrect port -> PLL ID
mapping. Fix this up by using the expected PORT_TC1..4 port ->
TC_PORT_1..4 tc_port mapping on BMG as well.

Fixes: ca1eda5cd476c ("drm/i915/cx0: Add MTL+ .get_dplls hook")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251120172358.1282765-1-imre.deak@intel.com
2 months agodrm/i915/psr: Reject async flips when selective fetch is enabled
Ville Syrjälä [Wed, 5 Nov 2025 17:10:15 +0000 (19:10 +0200)] 
drm/i915/psr: Reject async flips when selective fetch is enabled

The selective fetch code doesn't handle asycn flips correctly.
There is a nonsense check for async flips in
intel_psr2_sel_fetch_config_valid() but that only gets called
for modesets/fastsets and thus does nothing for async flips.

Currently intel_async_flip_check_hw() is very unhappy as the
selective fetch code pulls in planes that are not even async
flips capable.

Reject async flips when selective fetch is enabled, until
someone fixes this properly (ie. disable selective fetch while
async flips are being issued).

Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251105171015.22234-1-ville.syrjala@linux.intel.com
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
2 months agodrm/xe/vga: use the same intel_gmch_vga_set_decode() as i915
Jani Nikula [Wed, 19 Nov 2025 18:52:52 +0000 (20:52 +0200)] 
drm/xe/vga: use the same intel_gmch_vga_set_decode() as i915

Drop the #ifdef I915, and use the same intel_gmch_vga_set_decode() for
both i915 and xe.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/f4121e6c70bac6c26ef3cf51aaf72822f2cb2d54.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: merge soc/intel_gmch.[ch] to display/intel_vga.c
Jani Nikula [Wed, 19 Nov 2025 18:52:51 +0000 (20:52 +0200)] 
drm/i915: merge soc/intel_gmch.[ch] to display/intel_vga.c

The sole user of the remaining functions in intel_gmch.[ch] is in
intel_vga.c. Move everything there.

Since intel_gmch.c hasn't been part of xe, use a dummy function
relocated from xe_display_misc.c, with #ifdef. This is purely to keep
this change non-functional.

This allows us to remove soc/intel_gmch.[ch] from i915, compat
soc/intel_gmch.h from xe, and xe_display_misc.c from xe.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/b0f853ad7eae686738defa9e8f08a8848df8f226.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/gmch: convert intel_gmch.c to struct intel_display
Jani Nikula [Wed, 19 Nov 2025 18:52:50 +0000 (20:52 +0200)] 
drm/i915/gmch: convert intel_gmch.c to struct intel_display

Convert intel_gmch.[ch] to struct intel_display. Remove the final
dependency on struct drm_i915_private and i915_drv.h. This is in
preparation of moving the code under display/.

intel_gmch_vga_set_state() is only used internally, make it static while
at it.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/a4b317656eef0781d4f53ae337083fb05ce602bc.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/gmch: switch to use pci_bus_{read,write}_config_word()
Jani Nikula [Wed, 19 Nov 2025 18:52:49 +0000 (20:52 +0200)] 
drm/i915/gmch: switch to use pci_bus_{read,write}_config_word()

Switch to use pci_bus_{read,write}_config_word(), and stop using
i915->gmch.pdev reference for the bridge.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/5c432540e254108bf73dbdec347d69ad87682fc9.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/gmch: split out i915_gmch.[ch] from soc
Jani Nikula [Wed, 19 Nov 2025 18:52:48 +0000 (20:52 +0200)] 
drm/i915/gmch: split out i915_gmch.[ch] from soc

Most of the soc/intel_gmch.[ch] code is i915 core specific. Split it out
to i915_gmch.[ch].

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/f4f8cc931ef2a5958cebe3ca44d40aedad01626f.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe: remove remaining platform checks from compat i915_drv.h
Jani Nikula [Wed, 19 Nov 2025 18:52:47 +0000 (20:52 +0200)] 
drm/xe: remove remaining platform checks from compat i915_drv.h

With xe no longer building anything from soc/, we can remove the compat
platform checks from i915_drv.h, reducing the file to just the to_i915()
pointer conversion helper.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/a9947337f81e04db342bae6af727e4f75f9818ae.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: move intel_rom.[ch] from soc/ to display/
Jani Nikula [Wed, 19 Nov 2025 18:52:46 +0000 (20:52 +0200)] 
drm/i915: move intel_rom.[ch] from soc/ to display/

The sole user of intel_rom.[ch] has always been in display. Move them
under display.

This allows us to remove the compat soc/intel_rom.h from xe, as well as
the Makefile rules to build anything from soc/.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/352ec255a6e9b81c7d1e35d8fbf7018d4049d4d3.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: move dram_info to struct intel_display
Jani Nikula [Wed, 19 Nov 2025 18:52:45 +0000 (20:52 +0200)] 
drm/i915: move dram_info to struct intel_display

With all of dram code under display, also move dram_info to struct
intel_display.

This further cleans up struct xe_device from display related members.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/cbbca93003952ea24ae60e66d79d901dba78ccd8.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dram: convert to struct intel_display
Jani Nikula [Thu, 20 Nov 2025 16:18:46 +0000 (18:18 +0200)] 
drm/i915/dram: convert to struct intel_display

Convert everything except uncore access to struct
intel_display. Converting the graphics version checks to display version
checks needs a tweak for display version 13, which have graphics version
12.

While at it, convert logging to drm_dbg_kms().

v2: Handle display version 13

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251120161846.3128999-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe: remove MISSING_CASE() from compat i915_utils.h
Jani Nikula [Wed, 19 Nov 2025 18:52:43 +0000 (20:52 +0200)] 
drm/xe: remove MISSING_CASE() from compat i915_utils.h

There are no longer users for MISSING_CASE() in the compat
i915_utils.h. Remove it to prevent new users from showing up.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/b967e605ff9d9ad459f3d12a9dfc9244458d83a1.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: move intel_dram.[ch] from soc/ to display/
Jani Nikula [Wed, 19 Nov 2025 18:52:42 +0000 (20:52 +0200)] 
drm/i915: move intel_dram.[ch] from soc/ to display/

The remaining users of intel_dram.[ch] are all in display. Move them
under display.

This allows us to remove the compat soc/intel_dram.h from xe.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/4c0fbdab989a70d287536a7eafb002dc836ced12.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: split out i915_freq.[ch]
Jani Nikula [Wed, 19 Nov 2025 18:52:41 +0000 (20:52 +0200)] 
drm/i915: split out i915_freq.[ch]

The i915 core only needs three rather specific functions from
soc/intel_dram.[ch]: i9xx_fsb_freq(), ilk_fsb_freq(), and
ilk_mem_freq(). Add new i915_freq.[ch] and duplicate those functions for
i915 to reduce the dependency on soc/ code.

Wile duplication in general is bad, here it's a tradeoff to simplify the
i915, xe and display interactions.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/7bac1b194afdc20cd45e625a0a32fcbcd0b1136e.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/edram: extract i915_edram.[ch] for edram detection
Jani Nikula [Wed, 19 Nov 2025 18:52:40 +0000 (20:52 +0200)] 
drm/i915/edram: extract i915_edram.[ch] for edram detection

While edram detection ostensibly belongs with the rest of the dram stuff
in soc/intel_dram.c, it's only required by i915 core, not
display. Extract it to a separate i915_edram.[ch] file.

This allows us to drop the edram_size_mb member from struct xe_device.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/612edb7b70755655fbf193ba8af1c539fb93b698.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe/rps: build RPS as part of xe
Jani Nikula [Mon, 17 Nov 2025 09:16:17 +0000 (11:16 +0200)] 
drm/xe/rps: build RPS as part of xe

Reduce the conditional compilation in i915 by building
intel_display_rps.c as part of the xe module. This doesn't actually
enable RPS on xe, because there's no parent interface implementation on
xe side, but it's a step in the right direction.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/93df0bb727fce14aa9a542dbd2c0826a0fa0a16f.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: add .fence_priority_display to parent interface
Jani Nikula [Mon, 17 Nov 2025 09:16:16 +0000 (11:16 +0200)] 
drm/i915: add .fence_priority_display to parent interface

Add .fence_priority_display() to display parent interface, removing a
display dependency on gem/i915_gem_object.h.

This allows us to remove the xe compat gem/i915_gem_object.h.

v2: Don't mix this with the rps interface (Ville)

v3: Rebase

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/c7782862956e3aa59eaeb6dcf80906c1fc063ae1.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/rps: postpone i915 fence check to boost
Jani Nikula [Mon, 17 Nov 2025 09:16:15 +0000 (11:16 +0200)] 
drm/i915/rps: postpone i915 fence check to boost

Make the RPS boost code independent of i915 request code by moving the
dma_fence_is_i915() check to the RPS boost call.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/2653395523ee04c9ca3216f197f08c25a9f7716d.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/rps: call RPS functions via the parent interface
Jani Nikula [Mon, 17 Nov 2025 09:16:14 +0000 (11:16 +0200)] 
drm/i915/rps: call RPS functions via the parent interface

Add struct intel_display_rps_interface to the display parent interface,
and call the RPS functions through it. The RPS interface is optional.

v2: s/boost/boost_if_not_started/ and keep comment in caller (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/6a6c4420d9f2d9a545ee6df4cad5fdc32a86636b.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/rps: store struct dma_fence in struct wait_rps_boost
Jani Nikula [Mon, 17 Nov 2025 09:16:13 +0000 (11:16 +0200)] 
drm/i915/rps: store struct dma_fence in struct wait_rps_boost

Prefer the more generic pointer rather than i915 specific data
type. Also use dma_fence_put() for symmetry with the dma_fence_get()

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/950948ae6d3d5fbc4af3401ea77e609945b73a77.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: add .has_fenced_regions to parent interface
Jani Nikula [Mon, 17 Nov 2025 09:16:12 +0000 (11:16 +0200)] 
drm/i915: add .has_fenced_regions to parent interface

Add .has_fenced_regions() to display parent interface, removing more
dependencies on struct drm_i915_private, i915_drv.h, and
gt/intel_gt_types.h.

This allows us to remove the xe compat gt/intel_gt_types.h.

v2: s/fence_support_legacy/has_fenced_regions/ (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/309f61a8742c3bf731c820b2f9e1024143db8598.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: add .vgpu_active to parent interface
Jani Nikula [Mon, 17 Nov 2025 09:16:11 +0000 (11:16 +0200)] 
drm/i915: add .vgpu_active to parent interface

Add .vgpu_active() to display parent interface, removing more
dependencies on struct drm_i915_private, i915_drv.h, and i915_vgpu.h.

This also allows us to remove the xe compat i915_vgpu.h.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/a2d4043ebaaf8f69bb738d5d1332afd2847550ad.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/{i915,xe}/display: move irq calls to parent interface
Jani Nikula [Mon, 17 Nov 2025 09:16:10 +0000 (11:16 +0200)] 
drm/{i915,xe}/display: move irq calls to parent interface

Add an irq parent driver interface for the .enabled and .synchronize
calls. This lets us drop the dependency on i915_drv.h and i915_irq.h in
multiple places, and subsequently remove the compat i915_irq.h and
i915_irq.c files along with the display/ext directory from xe
altogether.

Introduce new intel_parent.[ch] as the wrapper layer to chase the
function pointers and convert between generic and more specific display
types.

v2: Keep static wrappers in intel_display_irq.c (Ville)

v3: Full blown wrappers in intel_parent.[ch] (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/dd62dd52ef10d9ecf77da3bdf6a70f71193d141c.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/display: convert the display irq interfaces to struct intel_display
Jani Nikula [Mon, 17 Nov 2025 09:16:09 +0000 (11:16 +0200)] 
drm/i915/display: convert the display irq interfaces to struct intel_display

Convert the irq/error init/reset interfaces from struct intel_uncore to
struct intel_display, and drop the dependency on intel_uncore.h.

Since the intel_de_*() calls handle the DMC wakelock internally, we can
drop the wrappers handling wakelocks completely.

v2: Drop the wakelock wrappers (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/710e03906da91244208839b357fe9171e37441ba.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/{i915, xe}/display: duplicate gen2 irq/error init/reset in display irq
Jani Nikula [Mon, 17 Nov 2025 09:16:08 +0000 (11:16 +0200)] 
drm/{i915, xe}/display: duplicate gen2 irq/error init/reset in display irq

Duplicate gen2_irq_reset(), gen2_assert_iir_is_zero(), gen2_irq_init(),
gen2_error_reset(), and gen2_error_init() in intel_display_irq.c.

This allows us to drop the duplicates from xe, and prepares for future
cleanups. Although duplication is undesirable in general, in this case
the local duplicates lead to a cleaner end result.

There's a slight wrinkle in gen2_assert_iir_is_zero(). We need to use
non-device based logging until we pass in struct intel_display in a
separate change.

v2:
- Keep xe compat stuff due to series reorder and rebase
- Keep the WARN as regular WARN
- Rename the functions in the same go

Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/296d74731cce57ab7534c57969d3146294adda57.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dram: Fix ICL DIMM_S decoding
Ville Syrjälä [Wed, 29 Oct 2025 20:42:15 +0000 (22:42 +0200)] 
drm/i915/dram: Fix ICL DIMM_S decoding

Unfortunately the MAD_DIMM DIMM_S and DIMM_L bits on ICL are
not idential, so we are currently decoding DIMM_S incorrectly.

Fix the problem by defining the DIMM_S and DIMM_L bits separately.
And for consistency do that same for SKL, even though there the
bits do match between the two DIMMs. The result is rather
repetitive in places, but I didn't feel like obfuscatign things
with cpp macros/etc.

Broken decoding on Dell XPS 13 7390 2-in-1:
 CH0 DIMM L size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH0 DIMM S size: 32 Gb, width: X32, ranks: 3, 16Gb+ DIMMs: no
 CH0 ranks: 2, 16Gb+ DIMMs: no
 CH1 DIMM L size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH1 DIMM S size: 32 Gb, width: X32, ranks: 3, 16Gb+ DIMMs: no
 CH1 ranks: 2, 16Gb+ DIMMs: no
 Memory configuration is symmetric? no

Fixed decoding on Dell XPS 13 7390 2-in-1:
 CH0 DIMM L size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH0 DIMM S size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH0 ranks: 2, 16Gb+ DIMMs: no
 CH1 DIMM L size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH1 DIMM S size: 32 Gb, width: X16, ranks: 2, 16Gb+ DIMMs: no
 CH1 ranks: 2, 16Gb+ DIMMs: no
 Memory configuration is symmetric? yes

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251029204215.12292-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dram: Sort SKL+ DIMM register bits
Ville Syrjälä [Wed, 29 Oct 2025 20:42:14 +0000 (22:42 +0200)] 
drm/i915/dram: Sort SKL+ DIMM register bits

Use the customary big endian order when defining the
SKL/ICL DIMM registers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251029204215.12292-3-ville.syrjala@linux.intel.com
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 months agodrm/i915/dram: Use REG_GENMASK() & co. for the SKL+ DIMM regs
Ville Syrjälä [Wed, 29 Oct 2025 20:42:13 +0000 (22:42 +0200)] 
drm/i915/dram: Use REG_GENMASK() & co. for the SKL+ DIMM regs

Modernize the SKL/ICL DIMM registers with REG_GENMASK() & co.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251029204215.12292-2-ville.syrjala@linux.intel.com
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 months agodrm/i915/cx0: Enable dpll framework for MTL+
Mika Kahola [Tue, 18 Nov 2025 13:28:59 +0000 (15:28 +0200)] 
drm/i915/cx0: Enable dpll framework for MTL+

MTL+ platforms are supported by dpll framework remove a separate
check for hw comparison and rely solely on dpll framework
hw comparison.

Finally, all required hooks are now in place so initialize
PLL manager for MTL+ platforms and remove the redirections
to the legacy code paths from the following interfaces:

* intel_encoder::clock_enable/disable()
* intel_encoder::get_config()
* intel_dpll_funcs::get_hw_state()
* intel_ddi_update_active_dpll()
* pipe_config_pll_mismatch()

v2: Rebase on !HAS_LT_PHY check in intel_ddi_update_active_dpll()
v3: Rebase on !display->dpll.mgr check in intel_ddi_update_active_dpll()
    Add check for NVL as the platform is not part of pll framework (Suraj)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251118132859.2584452-1-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ Thunderbolt PLL hooks
Imre Deak [Mon, 17 Nov 2025 10:46:01 +0000 (12:46 +0200)] 
drm/i915/cx0: Add MTL+ Thunderbolt PLL hooks

Add the PLL hooks for the TBT PLL on MTL+. These are simple stubs
similarly to the TBT PLL on earlier platforms, since this PLL is always
on from the display POV - so no PLL enable/disable programming is
required as opposed to the non-TBT PLLs - and the clocks for different
link rates are enabled/disabled at a different level, via the
intel_encoder::enable_clock()/disable_clock() interface.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-32-mika.kahola@intel.com
2 months agodrm/i915/cx0: Get encoder configuration for C10 and C20 PHY PLLs
Mika Kahola [Mon, 17 Nov 2025 10:46:00 +0000 (12:46 +0200)] 
drm/i915/cx0: Get encoder configuration for C10 and C20 PHY PLLs

For DDI initialization get encoder configuration for C10 and C20
chips.

v2: Get configuration either for a C10 or on the PTL port B
    eDP on TypeC PHY case for a C20 PHY PLL. Hence refer to this
    case as "non_tc_phy" instead of "c10phy".

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-31-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .enable_clock/.disable clock hooks on DDI
Mika Kahola [Mon, 17 Nov 2025 10:45:59 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .enable_clock/.disable clock hooks on DDI

To enable pll clock on DDI move part of the pll enabling
sequence into a ddi clock enabling function.

Simililarly, do the same for pll disabling sequence.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-30-mika.kahola@intel.com
2 months agodrm/i915/cx0: PLL verify debug state print
Imre Deak [Mon, 17 Nov 2025 10:45:58 +0000 (12:45 +0200)] 
drm/i915/cx0: PLL verify debug state print

Print out hw and sw pll states for better debugging support.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-29-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .crtc_get_dpll hook
Mika Kahola [Mon, 17 Nov 2025 10:45:57 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .crtc_get_dpll hook

Add .crtc_get_dpll function pointer to support MTL+
platforms.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-28-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .get_freq hook
Mika Kahola [Mon, 17 Nov 2025 10:45:56 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .get_freq hook

Add .get_freq hook to support dpll framework for MTL+
platforms.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-27-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .get_hw_state hook
Mika Kahola [Mon, 17 Nov 2025 10:45:55 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .get_hw_state hook

Add .get_hw_state hook to MTL+ platforms for dpll framework.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-26-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add .compare_hw_state hook
Mika Kahola [Mon, 17 Nov 2025 10:45:54 +0000 (12:45 +0200)] 
drm/i915/cx0: Add .compare_hw_state hook

Add .compare_hw_state function pointer for MTL+ platforms
to support dpll framework.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-25-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .dump_hw_state hook
Mika Kahola [Mon, 17 Nov 2025 10:45:53 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .dump_hw_state hook

Add .dump_hw_state function pointer for MTL+ platforms
to support dpll framework. While at it, switch to use
drm_printer structure to print hw state information.

v2: Keep debug messages on one line if they not
    necessarily needed to split into two or more
    lines (Suraj)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-24-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .update_dpll_ref_clks hook
Mika Kahola [Mon, 17 Nov 2025 10:45:52 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .update_dpll_ref_clks hook

Add .update_dpll_ref_clks function pointer to MTL+
platforms to support dpll framework. Reuse ICL
function pointer.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-23-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .update_active_dpll hook
Mika Kahola [Tue, 18 Nov 2025 13:28:30 +0000 (15:28 +0200)] 
drm/i915/cx0: Add MTL+ .update_active_dpll hook

Add .update_active_dpll function pointer to support
dpll framework. Reuse ICL function pointer.

v2: Add check for !HAS_LT_PHY (Suraj)
v3: Remove the incorrect !HAS_LT_PHY condition and
    check for existing dpll_mgr

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> # v1
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251118132830.2584422-1-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .put_dplls hook
Mika Kahola [Mon, 17 Nov 2025 10:45:50 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .put_dplls hook

Add .put_dplls function pointer to support MTL+ platforms
on dpll framework. Reuse ICL function pointer.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-21-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add MTL+ .get_dplls hook
Mika Kahola [Mon, 17 Nov 2025 10:45:49 +0000 (12:45 +0200)] 
drm/i915/cx0: Add MTL+ .get_dplls hook

Add .get_dplls function pointer for MTL+ platforms
to support dpll framework. Reuse the ICL function
pointer.

v2: Getting configuration either for a C10 or on the PTL port B
    eDP on TypeC PHY case for a C20 PHY PLL. Hence refer to this
    case as "non_tc_phy" instead of "c10phy".
v3: Fix comment to "eDP over TypeC" (Suraj)
    Fix pll id as separate variable (Suraj)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-20-mika.kahola@intel.com
2 months agodrm/i915/cx0: Compute plls for MTL+ platform
Mika Kahola [Mon, 17 Nov 2025 10:45:48 +0000 (12:45 +0200)] 
drm/i915/cx0: Compute plls for MTL+ platform

To bring MTL+ platform aligned call and calculate PLL state
from dpll framework.

v2: Rename mtl_compute_c10phy_dpll() to mtl_compute_non_tc_phy_dpll().
    The state is computed either for a C10 or on the PTL port B eDP
    over TypeC PHY case for a C20 PHY PLL. Hence refer to this case as
    "non_tc_phy" instead of "c10phy".

    Rename mtl_compute_c20phy_dplls() to mtl_compute_tc_phy_dplls() for
    symmetry with mtl_compute_non_tc_phy_dpll().
v3: Reword commit message (Suraj)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-19-mika.kahola@intel.com
2 months agodrm/i915/cx0: Update C10/C20 state calculation
Mika Kahola [Mon, 17 Nov 2025 10:45:47 +0000 (12:45 +0200)] 
drm/i915/cx0: Update C10/C20 state calculation

Update several functions in intel_cx0_phy.c to make PLL state
management more explicit.

Changes include
 * add 'const' qualifiers to intel_crtc_state parameter for
   cx0 state calculation functions
 * refactor C10/C20 PLL state calculations helpers to take
   explicit hardware state pointers instead of directly modifying
   'crtc_state->dpll_hw_state'

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-18-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add PLL information for MTL+
Mika Kahola [Mon, 17 Nov 2025 10:45:46 +0000 (12:45 +0200)] 
drm/i915/cx0: Add PLL information for MTL+

Start bringing MTL+ platforms as part of PLL framework.
The work is started by adding PLL information and related
function hooks.

BSpec: 55726

v2: Revise commit message and add BSpec ID (Suraj)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-17-mika.kahola@intel.com
2 months agodrm/i915/cx0: Remove state verification
Mika Kahola [Mon, 17 Nov 2025 10:45:45 +0000 (12:45 +0200)] 
drm/i915/cx0: Remove state verification

When pll's are moved to dpll framework we no longer
need Cx0 specific state verification as we can rely
on dpll state verification instead.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-16-mika.kahola@intel.com
2 months agodrm/i915/cx0: Print additional Cx0 PLL HW state
Imre Deak [Mon, 17 Nov 2025 10:45:44 +0000 (12:45 +0200)] 
drm/i915/cx0: Print additional Cx0 PLL HW state

Print all the Cx0 PLL state in the PLL state dumper.

v2: Use BUILD_BUG_ON() instead of WARN_ON() (Jani)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-15-mika.kahola@intel.com
2 months agodrm/i915/cx0: Zero Cx0 PLL state before compute and HW readout
Imre Deak [Mon, 17 Nov 2025 10:45:43 +0000 (12:45 +0200)] 
drm/i915/cx0: Zero Cx0 PLL state before compute and HW readout

Ensure Cx0 pll state is initialized to zero before any computation or HW
readouts, to prevent leaving some parameter in the state uninitialized
in the actual compute/HW readout functions later.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-14-mika.kahola@intel.com
2 months agodrm/i915/cx0: Determine Cx0 PLL port clock from PLL state
Imre Deak [Mon, 17 Nov 2025 10:45:42 +0000 (12:45 +0200)] 
drm/i915/cx0: Determine Cx0 PLL port clock from PLL state

The port clock is tracked in the PLL state, so there is no need to pass
it separately to __intel_cx0pll_enable(). Drop the port clock function
param accordingly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-13-mika.kahola@intel.com
2 months agodrm/i915/cx0: Determine Cx0 PLL DP mode from PLL state
Imre Deak [Mon, 17 Nov 2025 10:45:41 +0000 (12:45 +0200)] 
drm/i915/cx0: Determine Cx0 PLL DP mode from PLL state

The Cx0 PLL enable programming needs to know if the PLL is in DP or HDMI
mode. The PLL manager framework doesn't pass the CRTC state to the PLL's
enable hook, so prepare here for the conversion to use the PLL manager
for Cx0 PHY PLLs by determining the DP/HDMI mode from the PLL state.

For C10 PHYs use the fact that the HDMI divider value in the PLL
registers are set if and only if the PLL is in HDMI mode.

For C20 PHYs use the DP mode flag programmed to the VDR SERDES register,
which is set if and only if the PLL is in DP mode.

Assert that the above PLL/VDR SERDES register values match the DP/HDMI
mode being configured already during state computation.

This also allows dropping the is_dp param from the
__intel_cx0pll_enable() function, since it can retrieve this now from
the PLL state.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-12-mika.kahola@intel.com
2 months agodrm/i915/cx0: Read out the Cx0 PHY SSC enabled state
Imre Deak [Mon, 17 Nov 2025 10:45:40 +0000 (12:45 +0200)] 
drm/i915/cx0: Read out the Cx0 PHY SSC enabled state

Read out the C10, C20 PHY PLLs SSC enabled state, so the PLL HW/SW state
verification can check this state as well.

C10 PHY PLLs program some PLL registers zeroed out for the non-SSC case,
while programming non-zero values to the same registers for the SSC
case, so check that these PLL registers being zero or non-zero matches
the PLL's overall SSC-enabled state (stored in the
intel_c10pll_state::ssc_enabled flag).

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-11-mika.kahola@intel.com
2 months agodrm/i915/cx0: Sanitize C10 PHY PLL SSC register setup
Imre Deak [Mon, 17 Nov 2025 10:45:39 +0000 (12:45 +0200)] 
drm/i915/cx0: Sanitize C10 PHY PLL SSC register setup

Define the C10 PLL SSC register range via macros, so the HW/SW state of
these register can be verified by a follow-up change, reusing these
macros.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-10-mika.kahola@intel.com
2 months agodrm/i915/cx0: Track the Cx0 PHY enabled lane count in the PLL state
Imre Deak [Mon, 17 Nov 2025 10:45:38 +0000 (12:45 +0200)] 
drm/i915/cx0: Track the Cx0 PHY enabled lane count in the PLL state

The Cx0 PLL enable programming requires the enabled lane count. The PLL
manager framework doesn't pass the CRTC state to the PLL's enable hook,
so prepare here for the conversion to use the PLL manager, by tracking
the enabled lane count in the PLL state as well. This has the advantage,
that the enabled lane count can be verified against the PHY/PLL's
enabled TX lanes.

This also allows dropping the lane count param from the
__intel_cx0pll_enable() function, since it can retrieve this now from
the PLL state.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-9-mika.kahola@intel.com
2 months agodrm/i915/cx0: Add macro to get DDI port width from a register value
Imre Deak [Mon, 17 Nov 2025 10:45:37 +0000 (12:45 +0200)] 
drm/i915/cx0: Add macro to get DDI port width from a register value

A follow-up change will need to retrieve the DDI port field from the
register value, add a macro for this. Make things symmetric with setting
the field in the register.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-8-mika.kahola@intel.com
2 months agodrm/i915/cx0: Move definition of Cx0 PHY functions earlier
Imre Deak [Mon, 17 Nov 2025 10:45:36 +0000 (12:45 +0200)] 
drm/i915/cx0: Move definition of Cx0 PHY functions earlier

Move the definitions of the
  intel_c10pll_calc_port_clock()
  intel_c20_get_dp_rate()
  intel_c20_get_hdmi_rate()
  is_hdmi_frl()
  is_dp2()
  intel_get_c20_custom_width()
functions earlier to avoid the forward declarations.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-7-mika.kahola@intel.com
2 months agodrm/i915/cx0: Track the C20 PHY VDR state in the PLL state
Imre Deak [Mon, 17 Nov 2025 10:45:35 +0000 (12:45 +0200)] 
drm/i915/cx0: Track the C20 PHY VDR state in the PLL state

The Cx0 PLL enable programming needs to know if the PLL is in DP or HDMI
mode. The PLL manager framework doesn't pass the CRTC state to the PLL's
enable hook, so prepare here for the conversion to use the PLL manager
for Cx0 PHY PLLs by tracking the DP/HDMI mode in the PLL state.

This change has the advantage, that the VDR HW/SW state can be verified
now.

A follow up change will convert the PLL enable function to retrieve the
DP/HDMI mode parameter from the PLL state.

This also allows dropping the is_dp and port clock params from the
intel_c20_pll_program() function, since it can retrieve these now from
the PLL state.

v2: Fix comment to under same multicomment line (Suraj)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-6-mika.kahola@intel.com
2 months agodrm/i915/cx0: Sanitize calculating C20 PLL state from tables
Imre Deak [Mon, 17 Nov 2025 10:45:34 +0000 (12:45 +0200)] 
drm/i915/cx0: Sanitize calculating C20 PLL state from tables

A follow up change adds a computation for the C20 PLL VDR state, which
is common to both the HDMI algorithmic and DP/HDMI table based method.
To prepare for that streamline the code. The C10 counterpart would
benefit from the same change, leave that for later adding a TODO
comment.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-5-mika.kahola@intel.com
2 months agodrm/i915/cx0: Sanitize setting the Cx0 PLL use_c10 flag
Imre Deak [Mon, 17 Nov 2025 10:45:33 +0000 (12:45 +0200)] 
drm/i915/cx0: Sanitize setting the Cx0 PLL use_c10 flag

Sanitize setting the Cx0 PLL use_c10 flag during state computation and
HW readout, making sure they happen the same way in the
intel_c{10,20}pll_calc_state() and intel_c{10,20}pll_readout_hw_state()
functions.

Follow-up changes will add more state computation/HW readout, this
change prepares for those as well.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-4-mika.kahola@intel.com
2 months agodrm/i915/cx0: Factor out C10 msgbus access start/end helpers
Imre Deak [Mon, 17 Nov 2025 10:45:32 +0000 (12:45 +0200)] 
drm/i915/cx0: Factor out C10 msgbus access start/end helpers

Factor out functions to begin and complete C10 PHY programming
sequences to make the code more concise.

v2: Rename msgbus_update_config() to more descriptive
    msg_bus_access_commit() (Jani)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-3-mika.kahola@intel.com
2 months agodrm/i915/cx0: Rename TBT functions to be ICL specific
Mika Kahola [Mon, 17 Nov 2025 10:45:31 +0000 (12:45 +0200)] 
drm/i915/cx0: Rename TBT functions to be ICL specific

Rename pll functions to include ICL platform as these are
used from ICL onwards.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20251117104602.2363671-2-mika.kahola@intel.com
2 months agodrm/i915/fbdev: Hold runtime PM ref during fbdev BO creation
Dibin Moolakadan Subrahmanian [Tue, 11 Nov 2025 13:54:03 +0000 (19:24 +0530)] 
drm/i915/fbdev: Hold runtime PM ref during fbdev BO creation

During fbdev probe, the xe driver allocates and pins a framebuffer
BO (via xe_bo_create_pin_map_novm() → xe_ggtt_insert_bo()).

Without a runtime PM reference, xe_pm_runtime_get_noresume() warns about
missing outer PM protection as below:

xe 0000:03:00.0: [drm] Missing outer runtime PM protection

Acquire a runtime PM reference before framebuffer allocation to ensure
xe_ggtt_insert_bo()  executes  under active runtime PM context.

Changes in v2:
 - Update commit message to add Fixes tag (Jani Nikula)

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6350
Fixes: 44e694958b95 ("drm/xe/display: Implement display support")
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20251111135403.3415947-1-dibin.moolakadan.subrahmanian@intel.com
2 months agodrm/i915/fbc: Apply Wa_15018326506
Vinod Govindapillai [Tue, 11 Nov 2025 12:46:06 +0000 (14:46 +0200)] 
drm/i915/fbc: Apply Wa_15018326506

Disable FBC in bmg as per the wa recommendation.

v2: use the bmg platform instead of a specific stepping

v3: wa to Wa

Bspec: 74212
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20251111124606.402380-1-vinod.govindapillai@intel.com
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
3 months agodrm/i915/display: Add default case to mipi_exec_send_packet
Jonathan Cavitt [Tue, 4 Nov 2025 16:41:51 +0000 (16:41 +0000)] 
drm/i915/display: Add default case to mipi_exec_send_packet

Add a default case to the switch case statement in mipi_exec_send_packet
to prevent attempts to read an uninitialized ret value.  It's unlikely
the default case will ever occur during regular exeuction, but if more
MIPI DSI Processor-to-Peripheral transaction types are ever added, then
having this in place will be a useful safety guard.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Fixes: 23db1577ce2d ("drm/i915/dsi: log send packet sequence errors")
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20251104164150.16795-2-jonathan.cavitt@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/xe: remove stale runtime_pm member
Jani Nikula [Wed, 12 Nov 2025 18:55:47 +0000 (20:55 +0200)] 
drm/xe: remove stale runtime_pm member

This has become unused and unnecessary. Remove.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20251112185547.172113-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/ltphy: include intel_display_utils.h instead of i915_utils.h
Jani Nikula [Wed, 12 Nov 2025 18:13:42 +0000 (20:13 +0200)] 
drm/i915/ltphy: include intel_display_utils.h instead of i915_utils.h

Display code stopped using i915_utils.h in favour of
intel_display_utils.h. Fix recent additions.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20251112181342.107911-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/cursor: Initialize 845 vs 865 cursor size separately
Ville Syrjälä [Fri, 7 Nov 2025 18:11:26 +0000 (20:11 +0200)] 
drm/i915/cursor: Initialize 845 vs 865 cursor size separately

The if+ternary combo used for the max cursor width initialization
on 845/865 is rather cumbersome. Just split this into a straight
up if ladder.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-10-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/cursor: Extract intel_cursor_mode_config_init()
Ville Syrjälä [Fri, 7 Nov 2025 18:11:25 +0000 (20:11 +0200)] 
drm/i915/cursor: Extract intel_cursor_mode_config_init()

Move the max cursor size initialization into intel_cursor.c
so that all the platform specific details about cursors are
concentrated in one file.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915: Use mode_config->cursor_width for cursor DDB allocation
Ville Syrjälä [Fri, 7 Nov 2025 18:11:24 +0000 (20:11 +0200)] 
drm/i915: Use mode_config->cursor_width for cursor DDB allocation

Replace the hardcoded 256 with mode_config->cursor_width
when doing the cursor DDB allocation. Currently 256 is correct
for all SKL+, but this might change in the future. One less place
to change should that happen.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/wm: Use drm_get_format_info() in SKL+ cursor DDB allocation
Ville Syrjälä [Fri, 7 Nov 2025 18:11:23 +0000 (20:11 +0200)] 
drm/i915/wm: Use drm_get_format_info() in SKL+ cursor DDB allocation

Replace the technically inaccurate drm_format_info() with the
accurate drm_get_format_info() in the SKL+ cursor DDB
allocation code.

Since we're only interested in the linear modifier here, the two
functions do actually return the same information. But let's not
use drm_format_info() to avoid setting a bad example.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/fb: Init 'ret' in each error branch in intel_framebuffer_init()
Ville Syrjälä [Fri, 7 Nov 2025 18:11:22 +0000 (20:11 +0200)] 
drm/i915/fb: Init 'ret' in each error branch in intel_framebuffer_init()

Make the order of things a bit less fragile in
intel_framebuffer_init() by assigning 'ret' in each
error branch instead of depending on some earlier
assignment.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915: Nuke intel_plane_config.tiling
Ville Syrjälä [Fri, 7 Nov 2025 18:11:21 +0000 (20:11 +0200)] 
drm/i915: Nuke intel_plane_config.tiling

Use intel_fb_modifier_to_tiling() to convert the modifier into
the fence tiling mode during BIOS FB readout, rather than hand
rolling it. With this we can also stop tracking the tiling mode
in the intel_plane_config.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915: Populate fb->format accurately in BIOS FB readout
Ville Syrjälä [Fri, 7 Nov 2025 18:11:20 +0000 (20:11 +0200)] 
drm/i915: Populate fb->format accurately in BIOS FB readout

Use drm_get_format_info() instead of drm_format_info() to populate
fb->format during the BIOS FB readout. The difference being that
drm_get_format_info() knows about compressed formats whereas
drm_format_info() doesn't.

This doesn't actually matter in practice since the BIOS FB should
never be compressed, but no reason we shouldn't use the more accurate
function here anyway.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915: Pass drm_format_info into plane->max_stride()
Ville Syrjälä [Fri, 7 Nov 2025 18:11:19 +0000 (20:11 +0200)] 
drm/i915: Pass drm_format_info into plane->max_stride()

Pass the format info into plane->max_stride() from the
caller instead of doing yet another drm_format_info()
lookup on the spot.

drm_format_info() is both rather expensive, and technically
incorrect since it doesn't return the correct format info
for compressed formats (though that doesn't actually matter
for the current .max_stride() implementations since they
are just interested in the cpp value).

Most callers already have the format info available. The
only exception is intel_dumb_fb_max_stride() where we shall
use the actually correct drm_get_format_info() variant.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915: Introduce intel_dumb_fb_max_stride()
Ville Syrjälä [Fri, 7 Nov 2025 18:11:18 +0000 (20:11 +0200)] 
drm/i915: Introduce intel_dumb_fb_max_stride()

Wrap intel_plane_fb_max_stride() in intel_dumb_fb_max_stride()
for the purposes of dumb fb creation. I want to change
intel_plane_fb_max_stride() to take a 'struct drm_format_info'
instead of the 'u32 pixel_format' so we need an excplicit format
info lookup in the dumb fb path and I don't really want to have
that in i915_gem_dumb_create() directly.

This makes intel_plane_fb_max_stride() internal to the display
code again, and thus we can pass in struct intel_display instead
of struct drm_device.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/dpio: Use the intel_de_wait_ms() out value
Ville Syrjälä [Mon, 10 Nov 2025 17:27:55 +0000 (19:27 +0200)] 
drm/i915/dpio: Use the intel_de_wait_ms() out value

Utilize the 'out_value' output parameter of intel_de_wait_ms()
instead of re-reading the DPLL/DPIO_PHY_STATUS register after
polling has finished.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-17-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/power: Use the intel_de_wait_ms() out value
Ville Syrjälä [Mon, 10 Nov 2025 17:27:54 +0000 (19:27 +0200)] 
drm/i915/power: Use the intel_de_wait_ms() out value

Utilize the 'out_value' output parameter of intel_de_wait_ms()
instead of re-reading the PHY_CONTROL register after polling
has finished.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-16-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Replace __intel_de_wait_for_register_nowl() with intel_de_wait_fw_us_ato...
Ville Syrjälä [Mon, 10 Nov 2025 17:27:53 +0000 (19:27 +0200)] 
drm/i915/de: Replace __intel_de_wait_for_register_nowl() with intel_de_wait_fw_us_atomic()

Nuke the remaining _nowl() stuff from the wakelock code in the
form of __intel_de_wait_for_register_nowl(), and replace it with
intel_de_wait_fw_us_atomic() that uses the low level _fw() register
accessors in line with the rest of the code.

No change in behaviour since wakelocks are only supported on xe,
and xe doesn't have uncore.lock nor unclaimed register detection
stuff.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-15-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Nuke wakelocks from intel_de_wait_fw_ms()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:52 +0000 (19:27 +0200)] 
drm/i915/de: Nuke wakelocks from intel_de_wait_fw_ms()

The low level _fw() register accessors aren't supposed to
grab the wakelock. Stop doing so in intel_de_wait_fw_ms().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-14-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Replace __intel_de_rmw_nowl() with intel_de_rmw_fw()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:51 +0000 (19:27 +0200)] 
drm/i915/de: Replace __intel_de_rmw_nowl() with intel_de_rmw_fw()

We already have the lower level intel_de_*_fw() stuff, so use
that instead of hand rolling something custom for the DMC
wakelock stuff.

As the wakelock stuff exists only on platforms supported
by the xe driver this doesn't even result in any functional
changes since xe doesn't have uncore.lock nor unclaimed
register access detection.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-13-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/1915/dpio: Stop using intel_de_wait_fw_ms()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:50 +0000 (19:27 +0200)] 
drm/1915/dpio: Stop using intel_de_wait_fw_ms()

_bxt_dpio_phy_init() doesn't us the _fw() register accessors
for anything else, so stop using them for the register polling
as well.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-12-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Use intel_de_wait_for_{set,clear}_ms()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:49 +0000 (19:27 +0200)] 
drm/i915/de: Use intel_de_wait_for_{set,clear}_ms()

Use intel_de_wait_for_{set,clear}_ms() instead of
intel_de_wait_ms() where appropriate.

Done with cocci (with manual formatting fixes):
@@
identifier func !~ "intel_de_wait_for";
expression display, reg, mask, timeout_ms;
@@
func(...)
{
<...
(
- intel_de_wait_ms(display, reg, mask, mask, timeout_ms, NULL)
+ intel_de_wait_for_set_ms(display, reg, mask, timeout_ms)
|
- intel_de_wait_ms(display, reg, mask, 0, timeout_ms, NULL)
+ intel_de_wait_for_clear_ms(display, reg, mask, timeout_ms)
)
...>
}

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-11-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Use intel_de_wait_for_{set,clear}_us()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:48 +0000 (19:27 +0200)] 
drm/i915/de: Use intel_de_wait_for_{set,clear}_us()

Use intel_de_wait_for_{set,clear}_us() instead of
intel_de_wait_us() where appropriate.

Done with cocci (with manual formatting fixes):
@@
identifier func !~ "intel_de_wait_for";
expression display, reg, mask, timeout_us;
@@
func(...)
{
<...
(
- intel_de_wait_us(display, reg, mask, mask, timeout_us, NULL)
+ intel_de_wait_for_set_us(display, reg, mask, timeout_us)
|
- intel_de_wait_us(display, reg, mask, 0, timeout_us, NULL)
+ intel_de_wait_for_clear_us(display, reg, mask, timeout_us)
)
...>
}

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-10-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Introduce intel_de_wait_for_{set,clear}_us()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:47 +0000 (19:27 +0200)] 
drm/i915/de: Introduce intel_de_wait_for_{set,clear}_us()

Add intel_de_wait_for_set_us() and intel_de_wait_for_clear_us()
as the microsecond counterparts to intel_de_wait_for_set_ms()
and intel_de_wait_for_clear_ms().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-9-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Nuke intel_de_wait_custom()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:46 +0000 (19:27 +0200)] 
drm/i915/de: Nuke intel_de_wait_custom()

intel_de_wait_custom() is finally unused. Get rid of it
before people start abusing it more.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-8-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Use intel_de_wait_ms() for the obvious cases
Ville Syrjälä [Mon, 10 Nov 2025 17:27:45 +0000 (19:27 +0200)] 
drm/i915/de: Use intel_de_wait_ms() for the obvious cases

Replace some users of intel_de_wait_custom() with intel_de_wait_ms().

This includes the cases where we pass in the default 2 microsecond
fast timeout, which is also what intel_de_wait_ms() uses so there
are no functional changes here.

Done with cocci (with manual formatting fixes):
@@
expression display, reg, mask, value, timeout_ms, out_value;
@@
- intel_de_wait_custom(display, reg, mask, value, 2, timeout_ms, out_value)
+ intel_de_wait_ms(display, reg, mask, value, timeout_ms, out_value)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-7-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Use intel_de_wait_us()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:44 +0000 (19:27 +0200)] 
drm/i915/de: Use intel_de_wait_us()

Convert some of the intel_de_wait_custom() users over to
intel_de_wait_us(). We'll eventually want to eliminate
intel_de_wait_custom() as it's a hinderance towards using
poll_timeout_us().

This includes all the obvious cases where we only specify
a microsecond timeout to intel_de_wait_custom().

Done with cocci (with manual formatting fixes):
@@
expression display, reg, mask, value, timeout_us, out_value;
@@
- intel_de_wait_custom(display, reg, mask, value, timeout_us, 0, out_value)
+ intel_de_wait_us(display, reg, mask, value, timeout_us, out_value)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-6-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Introduce intel_de_wait_us()
Ville Syrjälä [Mon, 10 Nov 2025 17:27:43 +0000 (19:27 +0200)] 
drm/i915/de: Introduce intel_de_wait_us()

Introduce intel_de_wait_us() as the microsecond based
counterpart to the millisecond based intel_de_wait_ms().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-5-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Include units in intel_de_wait*() function names
Ville Syrjälä [Mon, 10 Nov 2025 17:27:42 +0000 (19:27 +0200)] 
drm/i915/de: Include units in intel_de_wait*() function names

intel_de_wait*() take the timeout in milliseconds. Include
that information in the function name to make life less
confusing. I'll also be introducing microsecond variants
of these later.

Done with cocci:
@@
@@
(
static int
- intel_de_wait
+ intel_de_wait_ms
 (...)
{
...
}
|
static int
- intel_de_wait_fw
+ intel_de_wait_fw_ms
 (...)
{
...
}
|
static int
- intel_de_wait_for_set
+ intel_de_wait_for_set_ms
 (...)
{
...
}
|
static int
- intel_de_wait_for_clear
+ intel_de_wait_for_clear_ms
 (...)
{
...
}
)

@@
@@
(
- intel_de_wait
+ intel_de_wait_ms
|
- intel_de_wait_fw
+ intel_de_wait_fw_ms
|
- intel_de_wait_for_set
+ intel_de_wait_for_set_ms
|
- intel_de_wait_for_clear
+ intel_de_wait_for_clear_ms
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-4-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Have intel_de_wait() hand out the final register value
Ville Syrjälä [Mon, 10 Nov 2025 17:27:41 +0000 (19:27 +0200)] 
drm/i915/de: Have intel_de_wait() hand out the final register value

We currently have a bunch of places that want the final register
value after register polling. Currently those places are mostly
using intel_de_wait_custom(). That is not a function that we
want to keep around as it pretty much prevents conversion to
poll_timeout_us().

Have intel_de_wait() also return the final register value so
that some of the current users can be converted over to the
simpler interface.

Done with cocci:
@@
@@
int intel_de_wait(...
+ ,u32 *out_value
 )
{
...
__intel_wait_for_register(...,
- NULL
+ out_value
 )
...
}

@@
@@
 intel_de_wait(...
+ ,NULL
 )

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-3-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/de: Implement register waits one way
Ville Syrjälä [Mon, 10 Nov 2025 17:27:40 +0000 (19:27 +0200)] 
drm/i915/de: Implement register waits one way

Currently we use a messy mix of intel_wait_for_register*()
and __intel_wait_for_register*() to implement various
register polling functions. Make the mess a bit more understandable
by always using the __intel_wait_for_register*() stuff.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251110172756.2132-2-ville.syrjala@linux.intel.com
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/rom: convert intel_rom interfaces to struct drm_device
Jani Nikula [Mon, 10 Nov 2025 11:20:48 +0000 (13:20 +0200)] 
drm/i915/rom: convert intel_rom interfaces to struct drm_device

Reduce the display dependency on struct drm_i915_private and i915_drv.h
by converting the rom interface to struct drm_device.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251110112048.2366725-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agoMerge drm/drm-next into drm-intel-next
Jani Nikula [Tue, 11 Nov 2025 10:32:07 +0000 (12:32 +0200)] 
Merge drm/drm-next into drm-intel-next

Primarily sync with the drm_print.h changes from drm-misc.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/i915/dp_mst: Disable Panel Replay
Imre Deak [Fri, 7 Nov 2025 12:41:41 +0000 (14:41 +0200)] 
drm/i915/dp_mst: Disable Panel Replay

Disable Panel Replay on MST links until it's properly implemented. For
instance the required VSC SDP is not programmed on MST and FEC is not
enabled if Panel Replay is enabled.

Fixes: 3257e55d3ea7 ("drm/i915/panelreplay: enable/disable panel replay")
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15174
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: stable@vger.kernel.org # v6.8+
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251107124141.911895-1-imre.deak@intel.com
3 months agodrm/i915/ltphy: Return lowest portclock for HDMI from reverse algorithm
Suraj Kandpal [Mon, 10 Nov 2025 06:19:41 +0000 (11:49 +0530)] 
drm/i915/ltphy: Return lowest portclock for HDMI from reverse algorithm

Return the lowest port clock for HDMI when the reverse algorithm
calculates it to be 0 to avoid errors later but throw a warn.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20251110061940.545183-2-suraj.kandpal@intel.com
3 months agodrm/i915/ltphy: Implement HDMI Algo for Pll state
Suraj Kandpal [Mon, 10 Nov 2025 06:19:40 +0000 (11:49 +0530)] 
drm/i915/ltphy: Implement HDMI Algo for Pll state

Implement the HDMI Algorithm to dynamically create LT PHY state
based on the port clock provided.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20251110061940.545183-1-suraj.kandpal@intel.com
3 months agodrm/i915/pmdemand: Use the default 2 usec fast polling timeout
Ville Syrjälä [Thu, 6 Nov 2025 15:20:49 +0000 (17:20 +0200)] 
drm/i915/pmdemand: Use the default 2 usec fast polling timeout

For whatever unknown reason the pmdemand code is using a custom
50 usec fast polling timeout instead of the normal 2 usec
value. Switch to the standard value to get rid of the special
case.

The eventual aim is to get rid of the fast vs. slow timeout
entirely and switch over to poll_timeout_us().

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251106152049.21115-11-ville.syrjala@linux.intel.com
3 months agodrm/i915/hdcp: Use the default 2 usec fast polling timeout
Ville Syrjälä [Thu, 6 Nov 2025 15:20:48 +0000 (17:20 +0200)] 
drm/i915/hdcp: Use the default 2 usec fast polling timeout

For whatever unknown reason the HDCP code is using a custom
10 usec fast polling timeout instead of the normal 2 usec
value. Switch to the standard value to get rid of the special
case.

The eventual aim is to get rid of the fast vs. slow timeout
entirely and switch over to poll_timeout_us().

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251106152049.21115-10-ville.syrjala@linux.intel.com
3 months agodrm/i915/ltphy: Nuke bogus weird timeouts
Ville Syrjälä [Thu, 6 Nov 2025 15:20:47 +0000 (17:20 +0200)] 
drm/i915/ltphy: Nuke bogus weird timeouts

The LT PHY code is abusing intel_de_wait_custom() in all kinds of weird
ways. Get rid of the weird fast timeouts, and just use the slow ones.
For consistency with intel_wait_for_register() we'll stick to the
default 2 usec fast timeout for all cases.

Someone really needs to properly document where all these magic numbers
came from...

This will let us eventually nuke intel_de_wait_custom() and convert
over to poll_timeout_us().

v2: Go for the longer (ms) timeout in case it actually matters

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