]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
3 weeks agodrm/i915/bios: Apply vlv_fixup_mipi_sequences() to v2 mipi-sequences too
Hans de Goede [Mon, 7 Jul 2025 21:14:12 +0000 (23:14 +0200)] 
drm/i915/bios: Apply vlv_fixup_mipi_sequences() to v2 mipi-sequences too

It turns out that the fixup from vlv_fixup_mipi_sequences() is necessary
for some DSI panel's with version 2 mipi-sequences too.

Specifically the Acer Iconia One 8 A1-840 (not to be confused with the
A1-840FHD which is different) has the following sequences:

BDB block 53 (1284 bytes) - MIPI sequence block:
Sequence block version v2
Panel 0 *

Sequence 2 - MIPI_SEQ_INIT_OTP
GPIO index 9, source 0, set 0 (0x00)
Delay: 50000 us
GPIO index 9, source 0, set 1 (0x01)
Delay: 6000 us
GPIO index 9, source 0, set 0 (0x00)
Delay: 6000 us
GPIO index 9, source 0, set 1 (0x01)
Delay: 25000 us
Send DCS: Port A, VC 0, LP, Type 39, Length 5, Data ff aa 55 a5 80
Send DCS: Port A, VC 0, LP, Type 39, Length 3, Data 6f 11 00
...
Send DCS: Port A, VC 0, LP, Type 05, Length 1, Data 29
Delay: 120000 us

Sequence 4 - MIPI_SEQ_DISPLAY_OFF
Send DCS: Port A, VC 0, LP, Type 05, Length 1, Data 28
Delay: 105000 us
Send DCS: Port A, VC 0, LP, Type 05, Length 2, Data 10 00
Delay: 10000 us

Sequence 5 - MIPI_SEQ_ASSERT_RESET
Delay: 10000 us
GPIO index 9, source 0, set 0 (0x00)

Notice how there is no MIPI_SEQ_DEASSERT_RESET, instead the deassert
is done at the beginning of MIPI_SEQ_INIT_OTP, which is exactly what
the fixup from vlv_fixup_mipi_sequences() fixes up.

Extend it to also apply to v2 sequences, this fixes the panel not working
on the Acer Iconia One 8 A1-840.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14605
Signed-off-by: Hans de Goede <hansg@kernel.org>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250703143824.7121-1-hansg@kernel.org
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
4 weeks agodrm/ttm: Remove unneeded blank line in comment
Jocelyn Falempe [Mon, 30 Jun 2025 14:41:08 +0000 (16:41 +0200)] 
drm/ttm: Remove unneeded blank line in comment

There is an unneeded blank line in the documentation of the function
ttm_bo_kmap_try_from_panic().

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506290453.NeTXAb7S-lkp@intel.com/
Fixes: 718370ff28328 ("drm/ttm: Add ttm_bo_kmap_try_from_panic()")
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250630144154.44661-1-jfalempe@redhat.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
5 weeks agodrm/i915/power: use intel_de_wait_for_clear() instead of wait_for()
Jani Nikula [Thu, 26 Jun 2025 19:26:32 +0000 (22:26 +0300)] 
drm/i915/power: use intel_de_wait_for_clear() instead of wait_for()

Prefer the register read specific wait function over i915 wait_for_us().

The existing condition is quite complicated. Simplify by checking for
requesters first, and determine timeout based on that. Refresh
requesters in case of timeouts, should one have popped up during the
wait. The downside is that this does not cut the wait short if
requesters show up *during* the wait, but we're talking about 1 ms so
shouldn't be an issue.

v2: Refresh requesters only if there were none before (Imre)

Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250626192632.2330349-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/display: drop a number of dependencies on i915_drv.h
Jani Nikula [Thu, 26 Jun 2025 10:16:36 +0000 (13:16 +0300)] 
drm/i915/display: drop a number of dependencies on i915_drv.h

With the switch to an unordered workqueue dedicated to display, we've
stopped using struct drm_i915_private in a number of places, and can
drop the dependencies on i915_drv.h.

Cc: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250626101636.1896365-1-jani.nikula@intel.com
5 weeks agodrm/i915/fb: use struct intel_display for DISPLAY_VER()
Jani Nikula [Thu, 26 Jun 2025 10:17:12 +0000 (13:17 +0300)] 
drm/i915/fb: use struct intel_display for DISPLAY_VER()

Convert a leftover struct drm_i915_private use to struct intel_display.

Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250626101712.1898434-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/display: Fix macro HAS_ULTRAJOINER
Ankit Nautiyal [Wed, 11 Jun 2025 05:30:39 +0000 (11:00 +0530)] 
drm/i915/display: Fix macro HAS_ULTRAJOINER

Currently, Ultrajoiner is supported only on Xe2_HPD.
Update the HAS_ULTRAJOINER macro to reflect the same.

v2: Clarify the commit message to specify platform. (Jani)

Bspec: 69556
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
Link: https://lore.kernel.org/r/20250611053039.377695-1-ankit.k.nautiyal@intel.com
5 weeks agodrm/xe: Fix conflicting intel_pcode_* symbols
Lucas De Marchi [Fri, 27 Jun 2025 20:30:34 +0000 (13:30 -0700)] 
drm/xe: Fix conflicting intel_pcode_* symbols

If CONFIG_DRM_XE_DISPLAY is set, the xe module can only be built as
module to avoid duplicate symbols from i915. The interface for pcode was
added without considering that, so the build breaks if both xe and i915
are built-in.

Since the intel_pcode_* functions should only be called from the display
side (xe side should call the xe interface directly) and there's already
a protection in Kconfig to avoid the problematic configuration, ifdef it
out in case CONFIG_DRM_XE_DISPLAY is disabled.

Closes: https://lore.kernel.org/r/3667a992-a24b-4e49-aab2-5ca73f2c0a56@infradead.org
Fixes: d9465cc8ac2d ("drm/xe/pcode: add struct drm_device based interface")
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250627-xe-kunit-v2-1-756fe5cd56cf@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
5 weeks agodrm/i915/flipq: Add intel_flipq_dump()
Ville Syrjälä [Tue, 24 Jun 2025 17:00:48 +0000 (20:00 +0300)] 
drm/i915/flipq: Add intel_flipq_dump()

Add a function for dumping the entries of a specific flip queue.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-9-ville.syrjala@linux.intel.com
5 weeks agodrm/i915/flipq: Implement Wa_18034343758
Ville Syrjälä [Tue, 24 Jun 2025 17:00:46 +0000 (20:00 +0300)] 
drm/i915/flipq: Implement Wa_18034343758

Implement the driver side of Wa_18034343758, which is supposed to
prevent the DSB and DMC from accessing registers in parallel, and
thus potentially corrupting the registers due to a hardware issue
(which should be fixed in PTL-B0).

The w/a sequence goes as follows:
DMC starts the DSB
 |                 \
DMC halts itself    | DSB waits a while for DMC to have time to halt
 .                  | DSB executes normally
 .     | DSB unhalts the DMC at the very end
 .                 /
DMC resumes execution

v2: PTL-B0+ firmware no longer has the w/a since the hw got fixed
v3: Do the w/a on all PTL for now since we only have the A0 firmware
    binaries which issues the halt instructions unconditionally
v4: PTL DMC binaries do in fact have the A0 vs. B0 split, so skip
    the w/a on PTL-B0+

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-7-ville.syrjala@linux.intel.com
5 weeks agodrm/i915/flipq: Implement flip queue based commit path
Ville Syrjälä [Tue, 24 Jun 2025 17:00:45 +0000 (20:00 +0300)] 
drm/i915/flipq: Implement flip queue based commit path

Support commits via the flip queue (as opposed to DSB or MMIO).

As it's somewhat unknown if we can actually use it is currently
gated behind the new use_flipq modparam, which defaults to disabled.

The implementation has a bunch of limitations that would need
real though to solve:
- disabled when PSR is used
- disabled when VRR is used
- color management updates not performed via the flip queue

v2: Don't use flip queue if there is no dmc
v3: Use intel_flipq_supported()
v3: Configure PKG_C_LATENCY appropriately
    Ignore INT_VECTOR if there is a real PIPEDMC interrupt
    (nothing in the hw appears to clear INT_VECTOR)
v4: Leave added_wake_time=0 when flip queue isn't used, to
    avoid needleslly increasing pkg_c_latency on lnl/ptl due
    to Wa_22020432604. This is a bit racy though...
    Use IS_DISPLAY_VER()

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-6-ville.syrjala@linux.intel.com
5 weeks agodrm/i915/flipq: Provide the nuts and bolts code for flip queue
Ville Syrjälä [Tue, 24 Jun 2025 17:00:44 +0000 (20:00 +0300)] 
drm/i915/flipq: Provide the nuts and bolts code for flip queue

Provide the lower level code for PIPEDMC based flip queue.

We'll use the so called semi-full flip queue mode where the
PIPEDMC will start the provided DSB on a scanline a little
ahead of the vblank. We need to program the triggering scanline
early enough so that the DSB has enough time to complete writing
all the double buffered registers before they get latched (at
start of vblank).

The firmware implements several queues:
- 3 "plane queues" which execute a single DSB per entry
- 1 "general queue" which can apparently execute 2 DSBs per entry
- 1 vestigial "fast queue" that replaced the "simple flip queue"
  on ADL+, but this isn't supposed to be used due to issues.

But we only need a single plane queue really, and we won't actually
use it as a real queue because we don't allow queueing multiple commits
ahead of time. So the whole thing is perhaps useless. I suppose
there migth be some power saving benefits if we would get the flip
scheduled by userspace early and then could keep some hardware powered
off a bit longer until the DMC kicks off the flipq programming. But that
is pure speculation at this time and needs to be proven.

The code to hook up the flip queue into the actual atomic commit
path will follow later.

TODO: need to think how to do the "wait for DMC firmware load" nicely
      need to think about VRR and PSR
      etc.

v2: Don't write DMC_FQ_W2_PTS_CFG_SEL on pre-lnl
    Don't oops at flipq init if there is no dmc
v3: Adapt to PTL+ flipq changes (different queue entry
    layout, different trigger event, need VRR TG)
    Use the actual CDCLK frequency
    Ask the DSB code how long things are expected to take
v3: Adjust the cdclk rounding (docs are 100% vague, Windows
    rounds like this)
    Initialize some undocumented magic DMC variables on PTL
v4: Use PIPEDMC_FQ_STATUS for busy check (the busy bit in
    PIPEDMC_FQ_CTRL is apparently gone on LNL+)
    Based the preempt timeout on the max exec time
    Preempt before disabling the flip queue
    Order the PIPEDMC_SCANLINECMP* writes a bit more carefully
    Fix some typos
v5: Try to deal with some clang-20 div-by-zero false positive (Nathan)
    Add some docs (Jani)

Cc: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
epr
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-5-ville.syrjala@linux.intel.com
5 weeks agodrm/i915/dmc: Define flip queue related PIPEDMC registers
Ville Syrjälä [Tue, 24 Jun 2025 17:00:43 +0000 (20:00 +0300)] 
drm/i915/dmc: Define flip queue related PIPEDMC registers

Add the register definitions for a bunch of flip queue related
PIPEDMC registers.

v2: The layout of flip queue entries changed on PTL
    Bump the DMC_FQ_W2_PTS_CFG_SEL bitfields sizes (Uma)
    Reduce the scanlines to 21 bits for now (Uma)
v3: Also define some undocumented DMC variables we need on PTL
v3: Drop PIPEDMC_FQ_CTRL_BUSY as it seems to no longer exist
    on LNL+
    Fix up some typos

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-4-ville.syrjala@linux.intel.com
5 weeks agodrm/i915: Try to program PKG_C_LATENCY more correctly
Ville Syrjälä [Tue, 24 Jun 2025 17:00:42 +0000 (20:00 +0300)] 
drm/i915: Try to program PKG_C_LATENCY more correctly

The current PKG_C_LATENCY stuff looks busted in several ways:
- doesn't account for multiple pipes from different commits
  correctly
- WM_LINETIME is in units of 0.125usec, PKG_C_LATENCY wants
  units on 1 usec
- weird VRR state stuff being checked
- use of pointless RMW

Fix it all up. Note that it's still a bit unclear how all this
works, especially how the added_wake_time ties into the flipq
triggers in DMC, and how we need to sequence updates to
PKG_C_LATENCY when enabling/disabling pipes/etc. We may also
need to think what to about the WM1+ disabling and the related
PSR chicken bits when we can use PKG_C_LATENCY for early wake...

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-3-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
5 weeks agodrm/i915: Set PKG_C_LATENCY.added_wake_time to 0
Ville Syrjälä [Tue, 24 Jun 2025 17:00:41 +0000 (20:00 +0300)] 
drm/i915: Set PKG_C_LATENCY.added_wake_time to 0

AFAIK PKG_C_LATENCY.added_wake_time only matters for flip queue.
As long as we're not using that there's no point in adding any
extra wake time.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250624170049.27284-2-ville.syrjala@linux.intel.com
5 weeks agodrm/i915/dsi: Fix NULL pointer deref in vlv_dphy_param_init()
Hans de Goede [Thu, 26 Jun 2025 14:33:17 +0000 (16:33 +0200)] 
drm/i915/dsi: Fix NULL pointer deref in vlv_dphy_param_init()

Commit 77ba0b856225 ("drm/i915/dsi: convert vlv_dsi.[ch] to struct
intel_display") added a to_intel_display(connector) call to
vlv_dphy_param_init() but when vlv_dphy_param_init() gets called
the connector object has not been initialized yet, so this leads
to a NULL pointer deref:

 BUG: kernel NULL pointer dereference, address: 000000000000000c
 ...
 Hardware name: ASUSTeK COMPUTER INC. T100TA/T100TA, BIOS T100TA.314 08/13/2015
 RIP: 0010:vlv_dsi_init+0x4e6/0x1600 [i915]
 ...
 Call Trace:
  <TASK>
  ? intel_step_name+0x4be8/0x5c30 [i915]
  intel_setup_outputs+0x2d6/0xbd0 [i915]
  intel_display_driver_probe_nogem+0x13f/0x220 [i915]
  i915_driver_probe+0x3d9/0xaf0 [i915]

Use to_intel_display(&intel_dsi->base) instead to fix this.

Fixes: 77ba0b856225 ("drm/i915/dsi: convert vlv_dsi.[ch] to struct intel_display")
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250626143317.101706-1-hansg@kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/psr: Add intel_psr2_panic_force_full_update
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:20 +0000 (11:01 +0200)] 
drm/i915/psr: Add intel_psr2_panic_force_full_update

When the panic handler is called, configure the psr to send the full
framebuffer to the monitor, otherwise the panic screen is only
partially visible.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-12-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/display: Add drm_panic support for 4-tiling with DPT
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:19 +0000 (11:01 +0200)] 
drm/i915/display: Add drm_panic support for 4-tiling with DPT

On Alder Lake and later, it's not possible to disable tiling when DPT
is enabled.
So this commit implements 4-Tiling support, to still be able to draw
the panic screen.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-11-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/display: Add drm_panic support for Y-tiling with DPT
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:18 +0000 (11:01 +0200)] 
drm/i915/display: Add drm_panic support for Y-tiling with DPT

On Alder Lake and later, it's not possible to disable tiling when DPT
is enabled.
So this commit implements Y-Tiling support, to still be able to draw
the panic screen.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-10-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/display: Add drm_panic support
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:17 +0000 (11:01 +0200)] 
drm/i915/display: Add drm_panic support

This adds drm_panic support for a wide range of Intel GPU. I've
tested it only on 4 laptops, Haswell (with 128MB of eDRAM),
Comet Lake, Raptor Lake, and Lunar Lake.
For hardware using DPT, it's not possible to disable tiling, as you
will need to reconfigure the way the GPU is accessing the
framebuffer, so this will be handled by the following patches.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-9-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915: Add intel_bo_panic_setup() and intel_bo_panic_finish()
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:16 +0000 (11:01 +0200)] 
drm/i915: Add intel_bo_panic_setup() and intel_bo_panic_finish()

Implement both functions for i915 and xe, they prepare the work for
drm_panic support.
They both use kmap_try_from_panic(), and map one page at a time, to
write the panic screen on the framebuffer.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-8-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915: Add intel_bo_alloc_framebuffer()
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:15 +0000 (11:01 +0200)] 
drm/i915: Add intel_bo_alloc_framebuffer()

Encapsulate the struct intel_framebuffer into an xe_framebuffer
or i915_framebuffer, and allow to add specific fields for each
variant for the panic use-case.
This is particularly needed to have a struct xe_res_cursor available
to support drm panic on discrete GPU.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-7-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/ttm: Add ttm_bo_kmap_try_from_panic()
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:14 +0000 (11:01 +0200)] 
drm/ttm: Add ttm_bo_kmap_try_from_panic()

If the ttm bo is backed by pages, then it's possible to safely kmap
one page at a time, using kmap_try_from_panic().
Unfortunately there is no way to do the same with ioremap, so it
only supports the kmap case.
This is needed for proper drm_panic support with xe driver.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250624091501.257661-6-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/display: Add a disable_tiling() for skl planes
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:13 +0000 (11:01 +0200)] 
drm/i915/display: Add a disable_tiling() for skl planes

drm_panic draws in linear framebuffer, so it's easier to re-use the
current framebuffer, and disable tiling in the panic handler, to show
the panic screen.

This assumes that the alignment restriction is always smaller in
linear than in tiled.
It also assumes that the linear framebuffer size is always smaller
than the tiled.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-5-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/display/i9xx: Add a disable_tiling() for i9xx planes
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:12 +0000 (11:01 +0200)] 
drm/i915/display/i9xx: Add a disable_tiling() for i9xx planes

drm_panic draws in linear framebuffer, so it's easier to re-use the
current framebuffer, and disable tiling in the panic handler, to show
the panic screen.
This assumes that the alignment restriction is always smaller in
linear than in tiled.
It also assumes that the linear framebuffer size is always smaller
than the tiled.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-4-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/fbdev: Add intel_fbdev_get_map()
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:11 +0000 (11:01 +0200)] 
drm/i915/fbdev: Add intel_fbdev_get_map()

The vaddr of the fbdev framebuffer is private to the struct
intel_fbdev, so this function is needed to access it for drm_panic.
Also the struct i915_vma is different between i915 and xe, so it
requires a few functions to access fbdev->vma->iomap.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-3-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/panic: Add a private field to struct drm_scanout_buffer
Jocelyn Falempe [Tue, 24 Jun 2025 09:01:10 +0000 (11:01 +0200)] 
drm/panic: Add a private field to struct drm_scanout_buffer

This allows driver to set some private data in get_scanout_buffer(),
and re-use them in set_pixel() callback.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-2-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
5 weeks agodrm/i915/power: convert {SKL, ICL}_PW_CTL_IDX_TO_PG() macros to a function
Jani Nikula [Wed, 25 Jun 2025 12:39:38 +0000 (15:39 +0300)] 
drm/i915/power: convert {SKL, ICL}_PW_CTL_IDX_TO_PG() macros to a function

Add pw_ctl_idx_to_pg() helper function to deduplicate the open-coded
usage of the {SKL,ICL}_PW_CTL_IDX_TO_PG() macros.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/3aa74825db0b900f93b94aa89d0242a354929b85.1750855148.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/power: relocate {SKL,ICL}_PW_CTL_IDX_TO_PG()
Jani Nikula [Wed, 25 Jun 2025 12:39:37 +0000 (15:39 +0300)] 
drm/i915/power: relocate {SKL,ICL}_PW_CTL_IDX_TO_PG()

Move the {SKL,ICL}_PW_CTL_IDX_TO_PG() macros from intel_display_regs.h
to intel_display_power_well.c. The mapping from index to PG can be
hidden there.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/18e40b77eeb3517a056f1e567672163ec568ec55.1750855148.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/power: move enum skl_power_gate under display
Jani Nikula [Wed, 25 Jun 2025 12:39:36 +0000 (15:39 +0300)] 
drm/i915/power: move enum skl_power_gate under display

When the display registers were split off from i915_reg.h, enum
skl_power_gate was left behind. Move it to intel_display_regs.h.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/495054983b74163ca7dcbf5a1b6a24099047bc64.1750855148.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/selftests: Change mock_request() to return error pointers
Dan Carpenter [Wed, 25 Jun 2025 15:21:58 +0000 (10:21 -0500)] 
drm/i915/selftests: Change mock_request() to return error pointers

There was an error pointer vs NULL bug in __igt_breadcrumbs_smoketest().
The __mock_request_alloc() function implements the
smoketest->request_alloc() function pointer.  It was supposed to return
error pointers, but it propogates the NULL return from mock_request()
so in the event of a failure, it would lead to a NULL pointer
dereference.

To fix this, change the mock_request() function to return error pointers
and update all the callers to expect that.

Fixes: 52c0fdb25c7c ("drm/i915: Replace global breadcrumbs with per-context interrupt tracking")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/685c1417.050a0220.696f5.5c05@mx.google.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 weeks agodrm/i915/display: move unordered works to new private workqueue
Luca Coelho [Fri, 20 Jun 2025 09:15:30 +0000 (12:15 +0300)] 
drm/i915/display: move unordered works to new private workqueue

Create a new unordered workqueue to be used by the display code
instead of relying on the i915 one.  Then move all the unordered works
used in the display code to use this new queue.

Since this is an unordered workqueue, by definition there can't be any
order dependency with non-display works, so no extra care is needed
in regard to that.

This is part of the effort to isolate the display code from i915.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250620091632.1256135-1-luciano.coelho@intel.com
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 weeks agodrm/i915/cdclk: make struct intel_cdclk_state opaque
Jani Nikula [Wed, 25 Jun 2025 10:32:34 +0000 (13:32 +0300)] 
drm/i915/cdclk: make struct intel_cdclk_state opaque

With all the code touching struct intel_cdclk_state moved inside
intel_cdclk.c, we move the struct definition there too, and make the
type opaque. This nicely reduces includes from intel_cdclk.h.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/2b58c52e8cbcb66a48ecd4a1453e49dc7bd66289.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_actual() and intel_cdclk_actual_voltage_level()
Jani Nikula [Wed, 25 Jun 2025 10:32:33 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_actual() and intel_cdclk_actual_voltage_level()

Add intel_cdclk_actual() and intel_cdclk_actual_voltage_level() helpers
to avoid looking at struct intel_cdclk_state internals outside of
intel_cdclk.c.

v2: Better location (Imre)

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/241a9b80a8262b82fded54707ca5622af215dd86.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_read_hw()
Jani Nikula [Wed, 25 Jun 2025 10:32:32 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_read_hw()

Add intel_cdclk_read_hw() function to avoid looking at struct
intel_cdclk_state internals outside of intel_cdclk.c.

intel_cdclk_init_hw() would be a better name, but we already have that.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/ef720d37bfeee933d59b64e382dc976f3c9fade1.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_force_min_cdclk()
Jani Nikula [Wed, 25 Jun 2025 10:32:31 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_force_min_cdclk()

Add intel_cdclk_force_min_cdclk() helper to avoid modifying struct
intel_cdclk_state internals outside of intel_cdclk.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/0bf8a94a1a7d3ac564406ba427d12c4c8eefb5bb.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_pmdemand_needs_update()
Jani Nikula [Wed, 25 Jun 2025 10:32:30 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_pmdemand_needs_update()

Add intel_cdclk_pmdemand_needs_update() helper to avoid looking at
struct intel_cdclk_state internals outside of intel_cdclk.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/d0d4f073707a2badb432187f6e02d6d7f9fe431b.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_bw_min_cdclk()
Jani Nikula [Wed, 25 Jun 2025 10:32:29 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_bw_min_cdclk()

Add intel_cdclk_bw_min_cdclk() helper to avoid looking at struct
intel_cdclk_state internals outside of intel_cdclk.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/d07499174ebe55fa8fb98d4cb5ff541b6f5ec95b.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_min_cdclk()
Jani Nikula [Wed, 25 Jun 2025 10:32:28 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_min_cdclk()

Add intel_cdclk_min_cdclk() helper to avoid looking at struct
intel_cdclk_state internals outside of intel_cdclk.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/af768e7fc32d8fa8ddcbbe2683266c30ae3b925d.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/cdclk: abstract intel_cdclk_logical()
Jani Nikula [Wed, 25 Jun 2025 10:32:27 +0000 (13:32 +0300)] 
drm/i915/cdclk: abstract intel_cdclk_logical()

Add intel_cdclk_logical() helper to avoid looking at struct
intel_cdclk_state internals outside of intel_cdclk.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/e965667550e82307341d6abbeedc67b93cae9fc6.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/bw: make struct intel_bw_state opaque
Jani Nikula [Wed, 25 Jun 2025 10:32:26 +0000 (13:32 +0300)] 
drm/i915/bw: make struct intel_bw_state opaque

With all the code touching struct intel_bw_state moved inside
intel_bw.c, we move the struct definition there too, and make the type
opaque. to_intel_bw_state() needs to be turned into a proper
function. All of this nicely reduces includes from intel_bw.h.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/743ba67e4e3c5dac4f5e58ab4d2357edea601d09.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/bw: abstract intel_bw_qgv_point_peakbw()
Jani Nikula [Wed, 25 Jun 2025 10:32:25 +0000 (13:32 +0300)] 
drm/i915/bw: abstract intel_bw_qgv_point_peakbw()

Add intel_bw_qgv_point_peakbw() helper to avoid looking at struct
intel_bw_state internals outside of intel_bw.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/49a723e0f23e06a6045f8f9e0d06648a6bc899c7.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915: move icl_sagv_{pre, post}_plane_update() to intel_bw.c
Jani Nikula [Wed, 25 Jun 2025 10:32:24 +0000 (13:32 +0300)] 
drm/i915: move icl_sagv_{pre, post}_plane_update() to intel_bw.c

Prefer only looking at struct intel_bw_state internals inside
intel_bw.c. To that effect, move icl_sagv_{pre,post}_plane_update()
there.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/dedcbeb3389ecd50195aa37de75e9992fae5d197.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/bw: relocate intel_can_enable_sagv() and rename to intel_bw_can_enable_sagv()
Jani Nikula [Wed, 25 Jun 2025 10:32:23 +0000 (13:32 +0300)] 
drm/i915/bw: relocate intel_can_enable_sagv() and rename to intel_bw_can_enable_sagv()

Prefer only looking at struct intel_bw_state internals inside
intel_bw.c. To that effect, move intel_can_enable_sagv() there, and
rename to intel_bw_can_enable_sagv() to have consistent naming.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/dd6e3857bd1343c07a36826e99c1c04f7dd5ddb5.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/bw: abstract intel_bw_pmdemand_needs_update()
Jani Nikula [Wed, 25 Jun 2025 10:32:22 +0000 (13:32 +0300)] 
drm/i915/bw: abstract intel_bw_pmdemand_needs_update()

Add intel_bw_pmdemand_needs_update() helper to avoid looking at struct
intel_bw_state internals outside of intel_bw.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/163fda39da2e1cf0f0c4fcb9c71103c98863179e.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/wm: make struct intel_dbuf_state opaque type
Jani Nikula [Wed, 25 Jun 2025 10:32:21 +0000 (13:32 +0300)] 
drm/i915/wm: make struct intel_dbuf_state opaque type

With all the code touching struct intel_dbuf_state moved inside
skl_watermark.c, we move the struct definition there too, and make the
type opaque. This nicely reduces includes from skl_watermark.h.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/83ae5f022a1d6d83c031e5c079b04dc739102565.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/wm: add more accessors to dbuf state
Jani Nikula [Wed, 25 Jun 2025 10:32:20 +0000 (13:32 +0300)] 
drm/i915/wm: add more accessors to dbuf state

Add intel_dbuf_num_enabled_slices() and intel_dbuf_num_active_pipes()
helpers to avoid looking at struct intel_dbuf_state internals outside of
skl_watermark.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/7d555e7b4e93632b732b8b5a3cd4076baf781bee.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/wm: abstract intel_dbuf_pmdemand_needs_update()
Jani Nikula [Wed, 25 Jun 2025 10:32:19 +0000 (13:32 +0300)] 
drm/i915/wm: abstract intel_dbuf_pmdemand_needs_update()

Add intel_dbuf_pmdemand_needs_update() helper to avoid looking at struct
intel_dbuf_state internals outside of skl_watermark.c.

With this, we can also move to_intel_dbuf_state(),
intel_atomic_get_old_dbuf_state(), and intel_atomic_get_new_dbuf_state()
inside skl_watermark.c.

Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/b493f259d0d3db047151fee18d7e801ad469fa88.1750847509.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915: remove unused DISPLAY_PLANE_FLIP_PENDING() macro
Jani Nikula [Wed, 25 Jun 2025 13:21:40 +0000 (16:21 +0300)] 
drm/i915: remove unused DISPLAY_PLANE_FLIP_PENDING() macro

DISPLAY_PLANE_FLIP_PENDING() has been unused since commit fd3a40242e87
("drm/i915: Rip out legacy page_flip completion/irq handling"). Remove.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250625132140.1564473-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
5 weeks agodrm/i915/display: Implement wa_16011342517
Nemesa Garg [Wed, 25 Jun 2025 07:49:11 +0000 (13:19 +0530)] 
drm/i915/display: Implement wa_16011342517

While doing voltage swing for type-c phy
for DP 1.62 and HDMI write the
LOADGEN_SHARING_PMD_DISABLE bit to 1.

-v2: Update commit.
     Add bspec[Suraj]
-v3: Move w/a before DKL_TX_PMD_LANE_SUS.
     Use DKL_TX_DPCNTL2[Ville]
-v4: Use intel_encoder_is_dp and
     intel_encoder_is_hdmi. [Suraj]

Bspec: 55359
Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250625074911.194085-1-nemesa.garg@intel.com
5 weeks agodrm/i915/panel: register drm_panel and call prepare/unprepare for eDP
Arun R Murthy [Tue, 24 Jun 2025 06:54:58 +0000 (12:24 +0530)] 
drm/i915/panel: register drm_panel and call prepare/unprepare for eDP

Allocate and register drm_panel to allow the panel_follower framework to
detect the eDP panel and pass drm_connector::kdev device to drm_panel
allocation for matching.
Call drm_panel_prepare/unprepare in ddi_enable for eDP to allow the
followers to get notified of the panel power state changes.

Note: This is for eDP with DDI platforms only.

v2: remove backlight setup from panel_register (Jani)
v3: Updated the commit message (Jani)

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250624-edp_panel-v3-1-e8197b6d9fde@intel.com
6 weeks agodrm/i915/wm: reduce stack usage in skl_print_wm_changes()
Arnd Bergmann [Fri, 20 Jun 2025 11:37:45 +0000 (13:37 +0200)] 
drm/i915/wm: reduce stack usage in skl_print_wm_changes()

When KMSAN is enabled, this function causes has a rather excessive stack usage:

drivers/gpu/drm/i915/display/skl_watermark.c:2977:1: error: stack frame size (1432) exceeds limit (1408) in 'skl_compute_wm' [-Werror,-Wframe-larger-than]

This is apparently all caused by the varargs calls to drm_dbg_kms(). Inlining
this into skl_compute_wm() means that any function called by skl_compute_wm()
has its own stack on top of that.

Move the worst bit into a separate function marked as noinline_for_stack to
limit that to the one code path that actually needs it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250620113748.3869160-1-arnd@kernel.org
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
6 weeks agodrm/i915/hdcp: Use HDCP2_STREAM_STATUS instead of HDCP2_AUTH_STREAM
Suraj Kandpal [Thu, 19 Jun 2025 11:33:40 +0000 (17:03 +0530)] 
drm/i915/hdcp: Use HDCP2_STREAM_STATUS instead of HDCP2_AUTH_STREAM

From PTL we need to move to using HDCP2_STREAM_STATUS as a WARN_ON
to see if written content type info is not the same since
HDCP2_AUTH_STREAM is inaccessible to us now.

--v2
-Fix commit message [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250619113340.3379200-3-suraj.kandpal@intel.com
6 weeks agodrm/i915/hdcp: Do not use inline intel_de_read
Suraj Kandpal [Thu, 19 Jun 2025 11:33:39 +0000 (17:03 +0530)] 
drm/i915/hdcp: Do not use inline intel_de_read

Do not use intel_de_read() inline in the WARN_ON functions.
While we are at it make the comparision for stream_type u8 to u8.

--v2
-Use REG_GENMASK() [Jani]
-USe REG_FIELD_GET() [Jani]
-Fix the WARN_ON() condition [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250619113340.3379200-2-suraj.kandpal@intel.com
6 weeks agodrm/xe/compat: remove old pcode compat interface
Jani Nikula [Mon, 23 Jun 2025 11:43:49 +0000 (14:43 +0300)] 
drm/xe/compat: remove old pcode compat interface

With display code using the struct drm_device based pcode interface, we
can drop the old pcode compat interface.

We can also drop the __compat_uncore_to_tile() helper from
intel_uncore.h compat header.

Turns out a couple of headers depended on the intel_uncore.h include via
intel_pcode.h. Fix them.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/948016a031dcb2acef0c97071aac09fa49613e07.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/dram: switch to struct drm_device based pcode interface
Jani Nikula [Mon, 23 Jun 2025 11:43:48 +0000 (14:43 +0300)] 
drm/i915/dram: switch to struct drm_device based pcode interface

With the struct drm_device based pcode interface in place in both i915
and xe, we can switch dram code to use that.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/e0d74a3317cc61d1cbb096b962cfbd7c60f038d4.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/display: switch to struct drm_device based pcode interface
Jani Nikula [Mon, 23 Jun 2025 11:43:47 +0000 (14:43 +0300)] 
drm/i915/display: switch to struct drm_device based pcode interface

With the struct drm_device based pcode interface in place in both i915
and xe, we can switch display code to use that, and ditch a number of
struct drm_i915_private uses. Also drop the dependency on i915_drv.h
from a couple of files.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/f948fad1b8208522e15140692c17cf493ef305d9.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/xe/pcode: add struct drm_device based interface
Jani Nikula [Mon, 23 Jun 2025 11:43:46 +0000 (14:43 +0300)] 
drm/xe/pcode: add struct drm_device based interface

In preparation for dropping the dependency on struct intel_uncore or
struct xe_tile from display code, add a struct drm_device based
interface to pcode.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/eeaa9cc8438caab2e22f9cb2142fbc18cc0fd861.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/pcode: add struct drm_device based interface
Jani Nikula [Mon, 23 Jun 2025 11:43:45 +0000 (14:43 +0300)] 
drm/i915/pcode: add struct drm_device based interface

In preparation for dropping the dependency on struct intel_uncore from
display code, add a struct drm_device based interface to pcode.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/e4ee176ca5454cfc636cbe71feb9f55d9e91f4ea.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/pcode: drop fast wait from snb_pcode_write_timeout()
Jani Nikula [Mon, 23 Jun 2025 11:43:44 +0000 (14:43 +0300)] 
drm/i915/pcode: drop fast wait from snb_pcode_write_timeout()

Only use the ms granularity wait in snb_pcode_write_timeout(), primarily
to better align with the xe driver, which also only has the millisecond
wait.

Use an arbitrary 250 us fast wait before the specified ms wait, and have
snb_pcode_write() default to 1 ms.

This means snb_pcode_write() and snb_pcode_write_timeout() will always
be sleeping functions. There should not be any atomic users for pcode
writes though, and any display code using pcode via xe has already been
non-atomic. The uncore wait will do a might_sleep() annotation that
should catch any problems.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/ba86280f53cea2d020308db35f1ecbd615d07d8a.1750678991.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/dmc: Do not enable the pipe DMC on TGL when PSR is possible
Ville Syrjälä [Tue, 17 Jun 2025 17:07:59 +0000 (20:07 +0300)] 
drm/i915/dmc: Do not enable the pipe DMC on TGL when PSR is possible

On TGL/derivatives the pipe DMC state is lost when PG1 is disabled,
and the main DMC does not restore any of it. This means the state will
also be lost during PSR+DC5/6. It seems safest to not even enable the
pipe DMC in that case (the main DMC does restore the pipe DMC enable
bit in PIPEDMC_CONTROL_A for some reason).

Since pipe DMC is only needed for "fast LACE" on these platforms we aren't
actually losing anything here. In the future if we do want to enable
"fast LACE" we'll just have to remember that it won't be compatible with
PSR.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-10-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Pass crtc_state to intel_dmc_{enable,disable}_pipe()
Ville Syrjälä [Tue, 17 Jun 2025 17:07:58 +0000 (20:07 +0300)] 
drm/i915/dmc: Pass crtc_state to intel_dmc_{enable,disable}_pipe()

I'll need to examine the crtc state during intel_dmc_enable_pipe().
To that end pass the whole crtc into intel_dmc_{enable,disable}_pipe().

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-9-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Assert DMC is loaded harder
Ville Syrjälä [Tue, 17 Jun 2025 17:07:57 +0000 (20:07 +0300)] 
drm/i915/dmc: Assert DMC is loaded harder

Currently we have some asserts to make sure the main DMC has been
loaded. Add similar asserts for the pipe DMCs. And we might as well
just check all the mmio registers the firmware has asked us to
initialize. That also covers the hardcoded SSP/HTP registers we were
checking for the main DMC.

TODO: Maybe always configure DMC_EVT_CTL_ENABLE the way the firmware
      has it set so that we wouldn't need to special case in the assert?

v2: Also assert in intel_dmc_load_program()

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-8-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Reload pipe DMC MMIO registers for pipe C/D on various platforms
Ville Syrjälä [Tue, 17 Jun 2025 17:07:56 +0000 (20:07 +0300)] 
drm/i915/dmc: Reload pipe DMC MMIO registers for pipe C/D on various platforms

On ADL/MTL pipe DMC MMIO state evidently lives in PG0. The main DMC
saves/restores it for pipes A/B, but for pipes C/D we have to do it
in the driver.

On PTL the situation is mostly the same, except the main DMC firmware
doesn't seem to have the PG0 save/restore code anymore, and instead the
hardware (or maybe Punit?) seems to take care of this job now. Pipes
C/D still need a manual restore by the driver.

On LNL I've been unable to lose any pipe DMC state, despite the main
DMC firmware still implementing the PG0 save/restore for pipes A/B.
Not sure what's going on here.

On DG2 I've also not been able to lose the pipe DMC state. DG2
doesn't support DC6, so that might explain part of it. But even
DC9 doesn't make a difference here. Perhaps PG0 is just always on
for DG2?

BMG I've not tested at all. The main DMC firmware does appaer to
implement the PG0 pipe A/B save/restore logic.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-7-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
6 weeks agodrm/i915/dmc: Reload pipe DMC state on TGL when enabling pipe A
Ville Syrjälä [Tue, 17 Jun 2025 17:07:55 +0000 (20:07 +0300)] 
drm/i915/dmc: Reload pipe DMC state on TGL when enabling pipe A

On TGL/derivatives the entire pipe DMC state (program + MMIO) is
lost when PG1 is disabled, and the main DMC does not restore
any of it. Reload the state when enabling a pipe.

The other option would be to not load the pipe DMC at all since
it's only needed for "fast LACE" (which we don't use) on these
platforms. But let's keep it around just in case we ever decide
that "fast LACE" is something we want.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-6-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Extract dmc_load_program()
Ville Syrjälä [Tue, 17 Jun 2025 17:07:54 +0000 (20:07 +0300)] 
drm/i915/dmc: Extract dmc_load_program()

We'll be needing to reload the program for individual DMCs.
To make that possible pull the code to load the program for
a single DMC into a new function.

This does change the order of things during init/resume
a bit; previously we loaded the program RAM for all DMCs first,
and then loaded the MMIO registers for all DMCs. Now those
operations will be interleaved between different DMCs.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-5-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Shuffle code around
Ville Syrjälä [Tue, 17 Jun 2025 17:07:53 +0000 (20:07 +0300)] 
drm/i915/dmc: Shuffle code around

Shuffle the DMC_EVT_CTL related stuff around once more. We'll need
this stuff during intel_dmc_enable_pipe(), and this lets us avoid
forward declarations.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-4-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Parametrize MTL_PIPEDMC_GATING_DIS
Ville Syrjälä [Tue, 17 Jun 2025 17:07:52 +0000 (20:07 +0300)] 
drm/i915/dmc: Parametrize MTL_PIPEDMC_GATING_DIS

The MTL+ pipe DMC clock gating bits can be parametrized.
Make it so.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-3-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/dmc: Limit pipe DMC clock gating w/a to just ADL/DG2/MTL
Ville Syrjälä [Tue, 17 Jun 2025 17:07:51 +0000 (20:07 +0300)] 
drm/i915/dmc: Limit pipe DMC clock gating w/a to just ADL/DG2/MTL

Supposedly nothing post-MTL (even BMG) needs the pipe DMC clock
gating w/a (Wa_16015201720), so don't apply it.

TODO: check if the ADL/DG2 "clock gating needed during DMC loading" part
      is actually needed, not seeing anything in the docs about it...

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250617170759.19552-2-ville.syrjala@linux.intel.com
6 weeks agodrm/i915/panel: make panel funcs static
Jani Nikula [Thu, 12 Jun 2025 12:46:17 +0000 (15:46 +0300)] 
drm/i915/panel: make panel funcs static

The drm panel funcs should be static, fix it.

Fixes: 3fdd5bfbd638 ("drm/i915/panel: register drm_panel and call prepare/unprepare for ICL+ DSI")
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/20250612124617.626958-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agoMerge drm/drm-next into drm-intel-next
Jani Nikula [Mon, 23 Jun 2025 07:57:13 +0000 (10:57 +0300)] 
Merge drm/drm-next into drm-intel-next

Sync with drm_panel changes from drm-misc-next, and xe driver changes
from drm-xe-next.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/xe/display: read PCON capability only when present
Chaitanya Kumar Borah [Thu, 19 Jun 2025 04:26:29 +0000 (09:56 +0530)] 
drm/xe/display: read PCON capability only when present

Avoid reading the PCON capabilities redundantly on non-branch devices.

v2:
 - Make commit description more accurate. (Imre)
 - Clear intel_dp->pcon_dsc_dpcd irrespective of presense of PCON. (Imre)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250619042629.3980244-1-chaitanya.kumar.borah@intel.com
6 weeks agoMerge tag 'drm-intel-next-2025-06-18' of https://gitlab.freedesktop.org/drm/i915...
Dave Airlie [Mon, 23 Jun 2025 00:49:25 +0000 (10:49 +1000)] 
Merge tag 'drm-intel-next-2025-06-18' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

drm/i915 feature pull for v6.17:

Features and functionality:
- Add support for DSC fractional link bpp on DP MST (Imre)
- Add support for simultaneous Panel Replay and Adaptive Sync (Jouni)
- Add support for PTL+ double buffered LUT registers (Chaitanya, Ville)
- Add PIPEDMC event handling in preparation for flip queue (Ville)

Refactoring and cleanups:
- Rename lots of DPLL interfaces to unify them (Suraj)
- Allocate struct intel_display dynamically (Jani)
- Abstract VLV IOSF sideband better (Jani)
- Use str_true_false() helper (Yumeng Fang)
- Refactor DSB code in preparation for flip queue (Ville)
- Use drm_modeset_lock_assert_held() instead of open coding (Luca)
- Remove unused arg from skl_scaler_get_filter_select() (Luca)
- Split out a separate display register header (Jani)
- Abstract DRAM detection better (Jani)
- Convert LPT/WPT SBI sideband to struct intel_display (Jani)

Fixes:
- Fix DSI HS command dispatch with forced pipeline flush (Gareth Yu)
- Fix BMG and LNL+ DP adaptive sync SDP programming (Ankit)
- Fix error path for xe display workqueue allocation (Haoxiang Li)
- Disable DP AUX access probe where not required (Imre)
- Fix DKL PHY access if the port is invalid (Luca)
- Fix PSR2_SU_STATUS access on ADL+ (Jouni)
- Add sanity checks for porch and sync on BXT/GLK DSI (Ville)

DRM core changes:
- Change AUX DPCD access probe address (Imre)
- Refactor EDID quirks, amd make them available to drivers (Imre)
- Add quirk for DPCD access probe (Imre)
- Add DPCD definitions for Panel Replay capabilities (Jouni)

Merges:
- Backmerges to sync with v6.15-rcs and v6.16-rc1 (Jani)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/fff9f231850ed410bd81b53de43eff0b98240d31@intel.com
6 weeks agoMerge tag 'drm-misc-next-2025-06-19' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Fri, 20 Jun 2025 01:33:41 +0000 (11:33 +1000)] 
Merge tag 'drm-misc-next-2025-06-19' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for 6.17:

UAPI Changes:
- Add Task Information for the wedge API

Cross-subsystem Changes:

Core Changes:
- Fix warnings related to export.h
- fbdev: Make CONFIG_FIRMWARE_EDID available on all architectures
- fence: Fix UAF issues
- format-helper: Improve tests

Driver Changes:
- ivpu: Add turbo flag, Add Wildcat Lake Support
- rz-du: Improve MIPI-DSI Support
- vmwgfx: fence improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250619-perfect-industrious-whippet-8ed3db@houat
6 weeks agoMerge tag 'drm-xe-next-2025-06-18' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Thu, 19 Jun 2025 23:07:49 +0000 (09:07 +1000)] 
Merge tag 'drm-xe-next-2025-06-18' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

UAPI Changes:
- Expose media OA units (Ashutosh)

Merge:
 - Restore GuC submit UAF fix around queue destruction
   accidentally removed in a drm-xe-fixes merge (Auld)

Core Changes:
- drm/gpusvm: Introduce devmem_only flag for allocation (Himal)
- drm/gpusvm: Add timeslicing support to GPU SVM (Brost)

Driver Changes:
 - Make gem shrinker drm managed (Thomas)
 - SRIOV VF Post-migration recovery of GGTT nodes and CTB (Tomasz)
 - Some W/A additions and updates (Aradhya, Shekhar, Vinay, Daniele)
 - Prefetch Support for svm ranges (Himal, Brost)
 - Don't allocate managed BO for each policy change (Michal)
 - Simplify and fix diff calculation in GuC submit (Lucas)
 - Track FAST_REQ GuC H2Gs to report where errors came from (John)
 - SRIOV PF: Don't allow LMEM provisioning if LMTT isn't available (Piotr)
 - Check if all domains awake for MOCS dump (Tejas)
 - Make creation of SLPC debugfs files conditional (Aradhya)
 - Default auto_link_downgrade status to false (Aradhya)
 - Use xe_mmio_read32() to read mtcfg register (Shuicheng)
 - Updates in PCI ID tables (Atwood, Shekhar)
 - SRIOV VF:  Fail migration recovery if fixups needed but not supported (Tomasz)
 - Add missing documentation around freq and RPa (Rodrigo)
 - Some other SVM related fixes (Himal, Auld, Brost, Maarten)
 - Allow to trigger GT resets using debugfs writes (Michal)
 - Optimise CCS case for WB pages (Auld)
 - Create LRC BO without VM (Niranjana)
 - Initialize MOCS index early (Bala)
 - HWMON fixes for BMG (Karthik, Lucas)
 - Drop redundant conversion to bool (Raag)
 - Rework eviction rejection of bound external bos (Thomas)
 - Stop re-submitting signalled jobs (Auld)
 - Small fixes and cleanups for PXP (Daniele)
 - Convert some print messages to GT-oriented ones (Michal)
 - Resend potentially lost GuC H2G MMIO request (Michal)
 - Add configfs to load with fewer engines (Lucas)
 - Remove unmatched xe_vm_unlock from __xe_exec_queue_init (Maciej)
 - SRIOV VF: Small updates around GGTT handling (Michal)
 - Make VMA tile_present, tile_invalidated access rules clear (Brost)
 - Xe3 Tuning: Disable NULL query for Anyhit Shader (Nitin)
 - Fixes for VF GuC version (Daniele)
 - Don't store the xe device pointer inside xe_ttm_tt (Dave)
 - Small improvements in topology code (Michal)
 - Stop relying on GGTT internals (Maarten)
 - GSM size should be constant on most platforms (Roper)
 - Reorder 'Get pages failed' message (Brost)
 - WA BB related fixes and improvements (Lucas, Brost)
 - Fix early wedge on GuC load failure (Daniele)
 - Add helper function to inject fault into ct_dead_capture (Satyanarayana)
 - Determine ATS / PTA programming during early sw init (Roper)
 - Consolidate PAT programming logic for pre-Xe2 and post-Xe2 (Roper)
 - Fix kconfig prompt (Lucas)
 - Convert xe_pci tests to parametrized tests (Michal)
 - Do not kill VM in PT code on -ENODATA (Brost)
 - Move LRC_ENGINE_ID_PPHWSP_OFFSET outside of parallel offset (Brost)
 - Enable media OA (Ashutosh)
 - GuC log level tuning (Lucas)
 - Add xe_vm_has_valid_gpu_mapping helper (Brost)
 - Opportunistically skip TLB invalidaion on unbind (Brost)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/aFMb_NVF_oCW7UVl@intel.com
6 weeks agodrm/i915/snps_hdmi_pll: Use clamp() instead of max(min())
Ankit Nautiyal [Wed, 18 Jun 2025 13:09:51 +0000 (18:39 +0530)] 
drm/i915/snps_hdmi_pll: Use clamp() instead of max(min())

The values of ana_cp_int, and ana_cp_prop are clamped between 1 and 127.
Use the more intuitive and readable clamp() macro instead of using
nested max(min(...)).

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250618130951.1596587-3-ankit.k.nautiyal@intel.com
6 weeks agodrm/i915/snps_hdmi_pll: Fix 64-bit divisor truncation by using div64_u64
Ankit Nautiyal [Wed, 18 Jun 2025 13:09:50 +0000 (18:39 +0530)] 
drm/i915/snps_hdmi_pll: Fix 64-bit divisor truncation by using div64_u64

DIV_ROUND_CLOSEST_ULL uses do_div(), which expects a 32-bit divisor.
When passing a 64-bit constant like CURVE2_MULTIPLIER, the value is
silently truncated to u32, potentially leading to incorrect results
on large divisors.

Replace DIV_ROUND_CLOSEST_ULL with DIV64_U64_ROUND_CLOSEST which correctly
handles full 64-bit division.

v2: Use DIV64_U64_ROUND_CLOSEST instead of div64_u64 macro. (Jani)

Fixes: 5947642004bf ("drm/i915/display: Add support for SNPS PHY HDMI PLL algorithm for DG2")
Reported-by: Vas Novikov <vasya.novikov@gmail.com>
Closes: https://lore.kernel.org/all/8d7c7958-9558-4c8a-a81a-e9310f2d8852@gmail.com/
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Vas Novikov <vasya.novikov@gmail.com>
Cc: stable@vger.kernel.org # v6.15+
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250618130951.1596587-2-ankit.k.nautiyal@intel.com
6 weeks agodrm/i915/plane: rename intel_atomic_add_affected_planes() to intel_plane_add_affected()
Jani Nikula [Tue, 17 Jun 2025 08:13:40 +0000 (11:13 +0300)] 
drm/i915/plane: rename intel_atomic_add_affected_planes() to intel_plane_add_affected()

Rename to follow filename based naming.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/c37bc557f831090c934b76d03485823bd45ebba8.1750147992.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/plane: rename intel_atomic_check_planes() to intel_plane_atomic_check()
Jani Nikula [Tue, 17 Jun 2025 08:13:39 +0000 (11:13 +0300)] 
drm/i915/plane: rename intel_atomic_check_planes() to intel_plane_atomic_check()

Align with all the other atomic check functions.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/57c59e33e31fbea564f61c2ffaa81e979e33f106.1750147992.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/plane: make intel_plane_atomic_check() static and rename
Jani Nikula [Tue, 17 Jun 2025 08:13:38 +0000 (11:13 +0300)] 
drm/i915/plane: make intel_plane_atomic_check() static and rename

intel_plane_atomic_check() isn't used outside of intel_plane.c. Make it
static. While at it, rename to vacate the name for subsequent changes.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/9da965c23c1485625d8713152751470ee758d540.1750147992.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/plane: drop atomic from intel_atomic_plane_check_clipping()
Jani Nikula [Tue, 17 Jun 2025 08:13:37 +0000 (11:13 +0300)] 
drm/i915/plane: drop atomic from intel_atomic_plane_check_clipping()

Align with intel_plane_check_src_coordinates(). The "atomic" is
superfluous.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/0bebd67e583b6ca56f788bd795ffe77db342e809.1750147992.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/plane: rename intel_atomic_plane.[ch] to intel_plane.[ch]
Jani Nikula [Tue, 17 Jun 2025 08:13:36 +0000 (11:13 +0300)] 
drm/i915/plane: rename intel_atomic_plane.[ch] to intel_plane.[ch]

It's all atomic, no need to emphasize this.

v2: Also update Documentation/gpu/i915.rst (Gustavo)

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/ba5f304e9fe71723191d872e6828d461e1a572bd.1750147992.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/vrr: fix register file style
Jani Nikula [Wed, 18 Jun 2025 15:51:37 +0000 (18:51 +0300)] 
drm/i915/vrr: fix register file style

Fix indents, use of spaces vs. tabs, grouping, remove superfluous
comments, remove some line continuations, wrap macro arguments in
parens, rename dev_priv to display. This is the way.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250618155137.1651865-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
6 weeks agodrm/i915/xe3lpd: Add support for display version 30.02
Matt Roper [Fri, 13 Jun 2025 19:31:38 +0000 (01:01 +0530)] 
drm/i915/xe3lpd: Add support for display version 30.02

Display version 30.02 should be treated the same as other Xe3 IP, but
will have a slightly different set of workarounds.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-2-dnyaneshwar.bhadane@intel.com
6 weeks agodrm/i915/xe3lpd: Extend WA 16023981245 for display 30.02
Dnyaneshwar Bhadane [Fri, 13 Jun 2025 19:31:46 +0000 (01:01 +0530)] 
drm/i915/xe3lpd: Extend WA 16023981245 for display 30.02

wa_16023981245 need to be extended for display version 30.02

Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-10-dnyaneshwar.bhadane@intel.com
6 weeks agodrm/i915/wcl: C10 phy connected to port A and B
Dnyaneshwar Bhadane [Fri, 13 Jun 2025 19:31:45 +0000 (01:01 +0530)] 
drm/i915/wcl: C10 phy connected to port A and B

WCL added a c10 phy connected to port B. PTL code is currently
restricting c10 to phy_a only.

PTL doesn't have a PHY connected to PORT B; as such,there will
never be a case where PTL uses PHY B.
WCL uses PORT A and B with the C10 PHY.Reusing the condition
for WCL and extending it for PORT B should not cause any issues
for PTL.

-v2: Reuse and extend PTL condition for WCL (Matt)

Bspec: 73944
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-9-dnyaneshwar.bhadane@intel.com
6 weeks agodrm/i915/xe3lpd: Extend DMC load path for display
Dnyaneshwar Bhadane [Fri, 13 Jun 2025 19:31:44 +0000 (01:01 +0530)] 
drm/i915/xe3lpd: Extend DMC load path for display

Display version 30.02 should be treated the same as other Xe3 IP.
So exteding DMC load path the condition for it.

Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-8-dnyaneshwar.bhadane@intel.com
6 weeks agodrm/i915: Set max cdclk for display 30.02
Matt Atwood [Fri, 13 Jun 2025 19:31:42 +0000 (01:01 +0530)] 
drm/i915: Set max cdclk for display 30.02

Display version 30.02 has a lower max cdclk rate than 30.00.

Bspec: 68861
Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-6-dnyaneshwar.bhadane@intel.com
6 weeks agodrm/i915/xe3lpd: Update bandwidth parameters for display version 30.02
Matt Atwood [Fri, 13 Jun 2025 19:31:41 +0000 (01:01 +0530)] 
drm/i915/xe3lpd: Update bandwidth parameters for display version 30.02

Bandwidth parameters for WCL have been updated with respect to
previous display releases. Encode them into xe3lpd_3002_sa_info and use
that new struct.

-v2: Resolve conflict to apply patch.

Bspec: 68859
Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613193146.3549862-5-dnyaneshwar.bhadane@intel.com
7 weeks agodrm/xe/hwmon: Fix xe_hwmon_power_max_write
Karthik Poosa [Tue, 17 Jun 2025 12:00:30 +0000 (17:30 +0530)] 
drm/xe/hwmon: Fix xe_hwmon_power_max_write

Prevent other bits of mailbox power limit from being overwritten with 0.
This issue was due to a missing read and modify of current power limit,
before setting a requested mailbox power limit, which is added in this
patch.

v2:
 - Improve commit message. (Anshuman)

v3:
 - Rebase.
 - Rephrase commit message. (Riana)
 - Add read-modify-write variant of xe_hwmon_pcode_write_power_limit()
   i.e. xe_hwmon_pcode_rmw_power_limit(). (Badal)
 - Use xe_hwmon_pcode_rmw_power_limit() to set mailbox power limits.
 - Remove xe_hwmon_pcode_write_power_limit() as all mailbox power limits
   writes use xe_hwmon_pcode_rmw_power_limit() only.

v4:
 - Use PWR_LIM in place of (PWR_LIM_EN | PWR_LIM_VAL) wherever
   applicable. (Riana)

Fixes: 7596d839f6228 ("drm/xe/hwmon: Add support to manage power limits though mailbox")
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
Link: https://lore.kernel.org/r/20250617120030.612819-1-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
7 weeks agodrm/format-helper: Move drm_fb_build_fourcc_list() to sysfb helpers
Thomas Zimmermann [Mon, 16 Jun 2025 08:37:06 +0000 (10:37 +0200)] 
drm/format-helper: Move drm_fb_build_fourcc_list() to sysfb helpers

Only sysfb drivers use drm_fb_build_fourcc_list(). Move the function
to sysfb helpers and rename it accordingly. Update drivers and tests.

v3:
- update naming in tests
v2:
- select DRM_SYSFB_HELPER (kernel test robot)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250616083846.221396-4-tzimmermann@suse.de
7 weeks agodrm/tests: Test drm_fb_build_fourcc_list() in separate test suite
Thomas Zimmermann [Mon, 16 Jun 2025 08:37:05 +0000 (10:37 +0200)] 
drm/tests: Test drm_fb_build_fourcc_list() in separate test suite

Only sysfb drivers use drm_fb_build_fourcc_list(). The helper will
be moved from format helpers to sysfb helpers. Moving the related
tests to their own test suite.

v3:
- rename tests according to filename (José)
v2:
- rename filename to match tested code (Maxime)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250616083846.221396-3-tzimmermann@suse.de
7 weeks agodrm/tests: Do not use drm_fb_blit() in format-helper tests
Thomas Zimmermann [Mon, 16 Jun 2025 08:37:04 +0000 (10:37 +0200)] 
drm/tests: Do not use drm_fb_blit() in format-helper tests

Export additional helpers from the format-helper library and open-code
drm_fb_blit() in tests. Prepares for the removal of drm_fb_blit(). Only
sysfb drivers use drm_fb_blit(). The function will soon be removed from
format helpers and be refactored within sysfb helpers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: José Expósito <jose.exposito89@gmail.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250616083846.221396-2-tzimmermann@suse.de
7 weeks agodrm/vmwgfx: Fix Host-Backed userspace on Guest-Backed kernel
Ian Forbes [Tue, 29 Apr 2025 20:34:27 +0000 (15:34 -0500)] 
drm/vmwgfx: Fix Host-Backed userspace on Guest-Backed kernel

Running 3D applications with SVGA_FORCE_HOST_BACKED=1 or using an
ancient version of mesa was broken because the buffer was pinned in
VMW_BO_DOMAIN_SYS and could not be moved to VMW_BO_DOMAIN_MOB during
validation.

The compat_shader buffer should not pinned.

Fixes: 668b206601c5 ("drm/vmwgfx: Stop using raw ttm_buffer_object's")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/r/20250429203427.1742331-1-ian.forbes@broadcom.com
7 weeks agodrm/vmwgfx: Implement dma_fence_ops properly
Ian Forbes [Fri, 30 May 2025 18:35:09 +0000 (13:35 -0500)] 
drm/vmwgfx: Implement dma_fence_ops properly

vmwgfx's fencing predates dma_fence and as a result dma_fence_ops was never
properly implemented, especially with respect to enabling signaling.

Because of this dma_fence callbacks don't work properly. This change
implements enable_signaling properly so that dma_fence callbacks now
work as expected.

It also removes vmwgfx's custom implementation of fence callbacks
and removes vmwgfx's custom dma_fence_ops::wait function which is no
longer necessary now that enable_signaling works.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/r/20250530183510.733175-2-ian.forbes@broadcom.com
7 weeks agodrm/vmwgfx: Update last_read_seqno under the fence lock
Ian Forbes [Fri, 30 May 2025 18:35:08 +0000 (13:35 -0500)] 
drm/vmwgfx: Update last_read_seqno under the fence lock

There was a possible race in vmw_update_seqno. Because of this race it
was possible for last_read_seqno to go backwards. Remove this function
and replace it with vmw_update_fences which now sets and returns the
last_read_seqno while holding the fence lock. This serialization via the
fence lock ensures that last_read_seqno is monotonic again.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/r/20250530183510.733175-1-ian.forbes@broadcom.com
7 weeks agodrm/xe: Opportunistically skip TLB invalidaion on unbind
Matthew Brost [Mon, 16 Jun 2025 06:30:24 +0000 (23:30 -0700)] 
drm/xe: Opportunistically skip TLB invalidaion on unbind

If a range or VMA is invalidated and scratch page is disabled, there
is no reason to issue a TLB invalidation on unbind, skip TLB
innvalidation is this condition is true. This is an opportunistic check
as it is done without the notifier lock, thus it possible for the range
to be invalidated after this check is performed.

This should improve performance of the SVM garbage collector, for
example, xe_exec_system_allocator --r many-stride-new-prefetch, went
~20s to ~9.5s on a BMG.

v2:
 - Use helper for valid check (Thomas)
v3:
 - Avoid skipping TLB invalidation if PTEs are removed at a higher
   level than the range
 - Never skip TLB invalidations for VMA
 - Drop Himal's RB

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://lore.kernel.org/r/20250616063024.2059829-3-matthew.brost@intel.com
7 weeks agodrm/xe: Add xe_vm_has_valid_gpu_mapping helper
Matthew Brost [Mon, 16 Jun 2025 06:30:23 +0000 (23:30 -0700)] 
drm/xe: Add xe_vm_has_valid_gpu_mapping helper

Rather than having multiple READ_ONCE of the tile_* fields and comments
in code, use helper with kernel doc for single access point and clear
rules.

v3:
 - s/xe_vm_has_valid_gpu_pages/xe_vm_has_valid_gpu_mapping

Suggested-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://lore.kernel.org/r/20250616063024.2059829-2-matthew.brost@intel.com
7 weeks agoMerge tag 'drm-misc-next-2025-06-12' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Tue, 17 Jun 2025 22:09:27 +0000 (08:09 +1000)] 
Merge tag 'drm-misc-next-2025-06-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for 6.17:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
 - atomic-helpers: Tune the enable / disable sequence
 - bridge: Add destroy hook
 - color management: Add helpers for hardware gamma LUT handling
 - HDMI: Add CEC handling, YUV420 output support
 - sched: tracing improvements

Driver Changes:
 - hyperv: Move out of simple-kms, drm_panic support
 - i915: drm_panel_follower support
 - imx: Add IMX8qxq Display Controller Support
 - lima: Add Rockchip RK3528 GPU Support
 - nouveau: fence handling cleanup
 - panfrost: Add BO labeling, 64-bit registers access
 - qaic: Add RAS Support
 - rz-du: Add RZ/V2H(P) Support, MIPI-DSI DCS Support
 - sun4i: Add H616 Support
 - tidss: Add TI AM62L Support
 - vkms: YUV and R* formats support

 - bridges:
   - Switched to reference counted drm_bridge allocations

 - panels:
   - Switched to reference counted drm_panel allocations
   - Add support for fwnode-based panel lookup
   - himax-hx8394: Support for Huiling hl055fhv028c
   - ilitek-ili9881c: Support for 7" Raspberry Pi 720x1280
   - panel-edp: Support for KDC KD116N3730A05, N160JCE-ELL CMN,
   - panel-simple: Support for AUO P238HAN01
   - st7701: Support for Winstar wf40eswaa6mnn0
   - visionox-rm69299: Support for rm69299-shift
   - New panels: Renesas R61307, Renesas R69328

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250612-coucal-of-impossible-cleaning-a5eecf@houat
7 weeks agodrm/xe: Extend WA 14018094691 to BMG
Daniele Ceraolo Spurio [Fri, 13 Jun 2025 23:11:29 +0000 (16:11 -0700)] 
drm/xe: Extend WA 14018094691 to BMG

This WA is applicable to BMG as well.

Note that this is a GSC WA and we don't load the GSC on BMG, so
extending the WA to BMG won't do anything right now. However, it helps
future-proof the driver so that if we ever turn the GSC on we won't have
to remember to extend this WA.

v2: don't use VERSION_RANGE from 2001 to 2004 (Matt)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20250613231128.1261815-2-daniele.ceraolospurio@intel.com
7 weeks agodrm/xe: Fix memset on iomem
Lucas De Marchi [Thu, 12 Jun 2025 22:14:12 +0000 (15:14 -0700)] 
drm/xe: Fix memset on iomem

It should rather use xe_map_memset() as the BO is created with
XE_BO_FLAG_VRAM_IF_DGFX in xe_guc_pc_init().

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250612-vmap-vaddr-v1-1-26238ed443eb@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>