]> Gentwo Git Trees - linux/.git/log
linux/.git
3 months agoMerge tag 'drm-intel-next-2025-09-05' of https://gitlab.freedesktop.org/drm/i915...
Dave Airlie [Fri, 12 Sep 2025 02:11:00 +0000 (12:11 +1000)]
Merge tag 'drm-intel-next-2025-09-05' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

Cross-subsystem Changes:
 - iopoll: Generalize read_poll_timeout() into poll_timeout_us() (Ville)

Non-display related:
 - PREEMPT_RT fix (Sebastian)
 - Replace DRM_DEBUG_SELFTEST with DRM_KUNIT_TEST (Ruben, Imre)
 - Some changes oeveral like in RPS, SoC, debugfs targeting display separation (Jani)

Display related:
 - General refactor in favor of intel_display (Suraj)
 - Prune modes for YUV420 (Suraj)
 - Reject HBR3 in any eDP Panel (Ankit)
 - Change AUX DPCD probe address (Imre)
 - Display Wa fix, additions, and updates (Ankit, Vinod, Nemesa, Suraj, Jouni))
 - DP: Fix 2.7 Gbps link training on g4x (Ville)
 - DP: Adjust the idle pattern handling (Ville)
 - DP: Shuffle the link training code a bit (Ville)
 - Don't set/read the DSI C clock divider on GLK (Ville)
 - Precompute plane SURF address/etc (Ville)
 - Enable_psr kernel parameter changes (Jouni)
 - PHY LFPS sending configuration fixes (Jouni)
 - Fix dma_fence_wait_timeout() return value handling (Aakash)
 - DP: Fix disabling training pattern (Imre)
 - Small code clean-ups (Gustavo, Colin, Jani, Juha-Pekka)
 - Change vblank log from err to debug (Suraj)
 - More display clean-up towards intel_display split (Jani)
 - Use the recomended min_hblank values (Arun)
 - Block hpd during suspend (Dibin)
 - DSI: Fix overflow issue in pclk parsing (Jouni)
 - PSR: Do not trigger Frame Change events from frontbuffer flush (Jouni)
 - VBT cleanups and new fields (Jani, Suraj)
 - Type-C enabled/disconnected dp-alt sink (Imre)
 - Optimize panel power-on wait time (Dibin)
 - Wildcat Lake enabling (Imre, Chaitanya)
 - DP HDR updates (Chaitanya)
 - Fix divide by 0 error in i9xx_set_backlight (Suraj)
 - Fixes for PSR (Jouni)
 - Remove the encoder check in hdcp enable (Suraj)
 - Control HDMI output bpc (Lee)
 - Fix possible overflow on tc power (Mika)
 - Convert code towards poll_timeout_* (Jani)
 - Use REG_BIT on FW_BLC_SELF_* macros (Luca)
 - ALPM LFPS and silence period calculation (Jouni)
 - Remove power state verification before HW readout (Imre)
 - Fix HPD mtp_tc_hpd_enable_detection (Ville)
 - DRAM detection (Ville)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/aLtc-gk3jhwcWxZh@intel.com
4 months agodrm/i915/display: Avoid divide by zero
Juha-Pekka Heikkila [Fri, 5 Sep 2025 10:46:26 +0000 (13:46 +0300)]
drm/i915/display: Avoid divide by zero

skl_crtc_allocate_plane_ddb allow iter.data_rate to be zero
which could cause divide by zero in skl_allocate_plane_ddb,
check against that.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250905104626.1274147-3-juhapekka.heikkila@gmail.com
4 months agodrm/i915/display: log fail from intel_sdvo_enable_hotplug
Juha-Pekka Heikkila [Fri, 5 Sep 2025 10:46:25 +0000 (13:46 +0300)]
drm/i915/display: log fail from intel_sdvo_enable_hotplug

Report in log if intel_sdvo_enable_hotplug failed

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250905104626.1274147-2-juhapekka.heikkila@gmail.com
4 months agodrm/i915/display: take out dead code
Juha-Pekka Heikkila [Fri, 5 Sep 2025 10:46:24 +0000 (13:46 +0300)]
drm/i915/display: take out dead code

if __waitfor timeout, ret will have -ETIMEDOUT. Then if condition
was met, and read_ret will have error that's handled.
Then if ret was zero, read_ret was zero ksv_ready must have value.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250905104626.1274147-1-juhapekka.heikkila@gmail.com
4 months agodrm/i915/dram: Print memory details even if something went wrong
Ville Syrjälä [Tue, 2 Sep 2025 13:31:13 +0000 (16:31 +0300)]
drm/i915/dram: Print memory details even if something went wrong

Print the memory details even if the detection failed in some way
but we continued the driver initialization anyway. It'll be easier
to debug issues if we at least know what the final results were.

And while at it also print the number of PSF GV points. Previously
we only printed the QGV points.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Don't call skl_get_dram_info()/skl_get_dram_type() on icl
Ville Syrjälä [Tue, 2 Sep 2025 13:31:12 +0000 (16:31 +0300)]
drm/i915/dram: Don't call skl_get_dram_info()/skl_get_dram_type() on icl

Currently the icl codepaths first determine the memory type from the
memory controller registers (via skl_get_dram_info()->skl_get_dram_type())
and then overwrite the results with icl_pcode_read_mem_global_info().
Get rid of the pointless (and potentially incorrect) skl_get_dram_type()
stuff.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Fix some spelling around the 16Gb DIMM w/a
Ville Syrjälä [Tue, 2 Sep 2025 13:31:11 +0000 (16:31 +0300)]
drm/i915/dram: Fix some spelling around the 16Gb DIMM w/a

Use consistent spelling when talking about the 16Gb DIMM w/a.

Even currently language is a bit off as the w/a is actually
about DIMMs with 16Gb DRAM devices on them, not the total capacity
of the whole DIMM. But this language does more or less match how
Bspec talks about this stuff.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Move 16Gb DIMM detection fully to the skl/icl codepaths
Ville Syrjälä [Tue, 2 Sep 2025 13:31:10 +0000 (16:31 +0300)]
drm/i915/dram: Move 16Gb DIMM detection fully to the skl/icl codepaths

We are incorrectly applying the 16Gb DIMM w/a (adding 1 extra
usec to WM0 latency) on MTL+ even though the w/a is only needed
for SKL/ICL.

The current way of setting this is up is a bit of a disaster:
1. always set has_16gb_dimms=true for all platforms except BXT/GLK
2. has_16gb_dimms potentially gets overwritten with something else
 * BXT/GLK don't do anything since we never set has_16gb_dimms to
   begin with
 * skl_get_dram_info() overwrites has_16gb_dimms with the actual
   detection results for SKL/ICL/derivatives
 * gen12_get_dram_info() (correctly) resets has_16gb_dimms
   for TGL/ADL/derivatives
 * xelpdp_get_dram_info() doesn't do anything, leaving
   has_16gb_dimms incorrectly set for MTL+

Clean up the whole mess by only setting has_16gb_dimms in the
SKL/ICL codepaths where we have the actual detection code for
it. This avois applying the w/a incorrectly on MTL+.

v2: Rewrite commit msg (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: s/wm_lv0.../has_16gb_dimms/
Ville Syrjälä [Tue, 2 Sep 2025 13:31:09 +0000 (16:31 +0300)]
drm/i915/dram: s/wm_lv0.../has_16gb_dimms/

The DRAM code shouldn't know anything about watermarks. Rename
wm_lv_0_adjust_needed to has_16gb_dimms. How this gets used is
up to the watermark code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Pack dram_info better
Ville Syrjälä [Tue, 2 Sep 2025 13:31:08 +0000 (16:31 +0300)]
drm/i915/dram: Pack dram_info better

struct dram_info has two holes in the middle. Shuffle things
around to plug them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Use intel_dram_type_str() for pnv
Ville Syrjälä [Tue, 2 Sep 2025 13:31:07 +0000 (16:31 +0300)]
drm/i915/dram: Use intel_dram_type_str() for pnv

Replace the hand rolled PNV memory type printk string
stuff with intel_dram_type_str().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dram: Populate PNV memory type accurately
Ville Syrjälä [Tue, 2 Sep 2025 13:31:06 +0000 (16:31 +0300)]
drm/i915/dram: Populate PNV memory type accurately

If PNV doesn't have DDR3 then it has DDR2. Add the appropriate memory
type for it.

No functional change since we currently only care about the
DDR3 vs. not difference.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902133113.18778-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/hpd: Fix mtp_tc_hpd_enable_detection()
Ville Syrjälä [Tue, 2 Sep 2025 15:39:15 +0000 (18:39 +0300)]
drm/i915/hpd: Fix mtp_tc_hpd_enable_detection()

Set the MTP TC hotplug bits in the correct register.

Shouldn't matter really as this only gets used for eDP
detection and there should be never eDP on TC ports on
current hw.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250902153915.4423-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/display: Remove power state verification before HW readout
Imre Deak [Wed, 3 Sep 2025 12:21:52 +0000 (15:21 +0300)]
drm/i915/display: Remove power state verification before HW readout

During system resume the display power state verification will print the

"power well x state mismatch (refcount 0/enabled 1)"

error message from the early resume sequence for a power well left
enabled by BIOS. This power well was probably left enabled by BIOS
inadvertently, since BIOS versions on current platforms do not leave any
display output enabled while resuming from an Sx power state, hence the
enabled display power well is unused. In theory however it is possible
that BIOS leaves a display output enabled, in that case the enabled
power well shouldn't be reported as an error.

According to the above, remove the display power state verification from
the early resume phase to avoid incorrectly reporting an enabled power
well without a power reference as an error.

Note: The refcount for any enabled and used power well (i.e. used for an
enabled display output) will be acquired following the early resume
sequence, after the HW state for display outputs (encoder/crtc etc.) is
read out. Any power well enabled but not used (hence not holding a
reference) will be disabled after the HW state readout. The display
power state will be verified afterwards in intel_power_domains_enable().

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6012
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250903122152.2526050-1-imre.deak@intel.com
4 months agodrm/i915/alpm: Use actual lfps cycle and silence periods in wake time
Jouni Högander [Fri, 29 Aug 2025 05:39:28 +0000 (08:39 +0300)]
drm/i915/alpm: Use actual lfps cycle and silence periods in wake time

Currently we are using maximum lfps cycle and silence period times when
calculating AUXLess wake time. Use actual values instead.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250829053929.3585636-5-jouni.hogander@intel.com
4 months agodrm/i915/alpm: Replace hardcoded LFPS cycle with proper calculation
Jouni Högander [Fri, 29 Aug 2025 05:39:27 +0000 (08:39 +0300)]
drm/i915/alpm: Replace hardcoded LFPS cycle with proper calculation

Currently LFPS is hadcoded for different port clocks. Replace this with
proper calculation.

v2: replace hardcoded 20 with 2 * LFPS_CYCLE_COUNT

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250829053929.3585636-4-jouni.hogander@intel.com
4 months agodrm/i915/alpm: Add own define for LFPS count
Jouni Högander [Fri, 29 Aug 2025 05:39:26 +0000 (08:39 +0300)]
drm/i915/alpm: Add own define for LFPS count

Add own define for LFPS count and use it for the configuration. This new
define will be used for calculating ALPM parameters as well.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250829053929.3585636-3-jouni.hogander@intel.com
4 months agodrm/i915/alpm: Calculate silence period
Jouni Högander [Fri, 29 Aug 2025 05:39:25 +0000 (08:39 +0300)]
drm/i915/alpm: Calculate silence period

Calculate silence period instead of hardcoding it in switch case.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250829053929.3585636-2-jouni.hogander@intel.com
4 months agoMerge tag 'drm-misc-next-2025-09-04' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Fri, 5 Sep 2025 01:45:49 +0000 (11:45 +1000)]
Merge tag 'drm-misc-next-2025-09-04' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for v6.18:

Cross-subsystem Changes:

- Update a number of DT bindings for STM32MP25 Arm SoC

Core Changes:

gem:
- Simplify locking for GPUVM

panel-backlight-quirks:
- Add additional quirks for EDID, DMI, brightness

sched:
- Fix race condition in trace code
- Clean up

sysfb:
- Clean up

Driver Changes:

amdgpu:
- Give kernel jobs a unique id for better tracing

amdxdna:
- Improve error reporting

bridge:
- Improve ref counting on bridge management
- adv7511: Provide SPD and HDMI infoframes
- it6505: Replace crypto_shash with sha()
- synopsys: Add support for DW DPTX Controller plus DT bindings

gud:
- Replace simple-KMS pipe with regular atomic helpers

imagination:
- Improve power management
- Add support for TH1520 GPU
- Support Risc-V architectures

ivpu:
- Clean up

nouveau:
- Improve error reporting

panthor:
- Fail VM bind if BO has offset
- Clean up

rcar-du:
- Make number of lanes configurable

rockchip:
- Add support for RK3588 DPTX output

rocket:
- Use kfree() and sizeof() correctly
- Test DMA status
- Clean up

sitronix:
- st7571-i2c: Add support for inverted displays and 2-bit grayscale
- Clean up

stm:
- ltdc: Add support support for STM32MP257F-EV1 plus DT bindings

tidss:
- Convert to kernel's FIELD_ macros

v3d:
- Improve job management and locking

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250904090932.GA193997@linux.fritz.box
4 months agodrm/i915/pps: prefer poll_timeout_us() over read_poll_timeout()
Jani Nikula [Thu, 28 Aug 2025 12:21:02 +0000 (15:21 +0300)]
drm/i915/pps: prefer poll_timeout_us() over read_poll_timeout()

Unify on using poll_timeout_us() throughout instead of mixing with
readx_poll_timeout().

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/260fd455df743453f123d96fc01e7ca96a36f0fa.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/ddi: prefer poll_timeout_us() over readx_poll_timeout()
Jani Nikula [Thu, 28 Aug 2025 12:21:01 +0000 (15:21 +0300)]
drm/i915/ddi: prefer poll_timeout_us() over readx_poll_timeout()

Unify on using poll_timeout_us() throughout instead of mixing with
readx_poll_timeout(). While the latter can be ever so slightly simpler,
they are both complicated enough that it's better to unify on one
approach only.

While at it, better separate the handling of error returns from
drm_dp_dpcd_readb() and the actual status byte. This is best achieved by
inlining the read_fec_detected_status() function, and switching to
drm_dp_dpcd_read_byte().

v2: Use drm_dp_dpcd_read_byte() (Imre)

Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/63b10a36c7ab545c640b24bc8fc007ce2ea74623.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/opregion: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:21:00 +0000 (15:21 +0300)]
drm/i915/opregion: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 1 ms sleep instead. The timeout remains, being
opregion defined, 50 ms by default, and 1500 ms at most.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/63db3a1e1db9e55a18ed322c55f2dffe511a10bb.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/lspcon: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:59 +0000 (15:20 +0300)]
drm/i915/lspcon: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 5 ms sleep instead. The timeouts remain, being
400 ms or 800 ms, depending on the case.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/4065fa96c0ef6afd51a384f365761d2ca802256b.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dsb: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:58 +0000 (15:20 +0300)]
drm/i915/dsb: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 100 us sleep instead. The timeout remains at 1
ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/979eae02af1184b3756746ace61379dd1947a79b.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/tc: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:57 +0000 (15:20 +0300)]
drm/i915/tc: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 200 us sleep for the 5 ms timeout, and 1000 us
sleep for the 500 ms timeout. The timeouts remain the same.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/50cd06b61210f541d5bb52a36af2d8bf059dd3a1.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/vblank: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:56 +0000 (15:20 +0300)]
drm/i915/vblank: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at
100 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/162dff5862d3213304491a6d2eb31a57346b523e.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dp: use generic poll_timeout_us() instead of wait_for() in link training
Jani Nikula [Thu, 28 Aug 2025 12:20:55 +0000 (15:20 +0300)]
drm/i915/dp: use generic poll_timeout_us() instead of wait_for() in link training

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at
500 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/29ab4738758fe844dc1323c4a59d5d6bdcf87308.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dp: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:54 +0000 (15:20 +0300)]
drm/i915/dp: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 1 ms sleep instead. The timeouts remain, being
500 ms or 1000 ms depending on the case.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/83d3417d4e5af1db13eb4c6eaa48b5f9c12caeb4.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/power-well: use generic poll_timeout_us() instead of wait_for() for VLV/CHV
Jani Nikula [Thu, 28 Aug 2025 12:20:53 +0000 (15:20 +0300)]
drm/i915/power-well: use generic poll_timeout_us() instead of wait_for() for VLV/CHV

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at
100 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/c644b7b5611a3c047ea5d3d52acd91830b2fa6b4.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/power-well: use generic poll_timeout_us() instead of wait_for() for DKL PHY
Jani Nikula [Thu, 28 Aug 2025 12:20:52 +0000 (15:20 +0300)]
drm/i915/power-well: use generic poll_timeout_us() instead of wait_for() for DKL PHY

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 100 us sleep instead. The timeout remains at 1
ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/663c9edf4a98b09121d7200f8d734ebc829da85b.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/power: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:51 +0000 (15:20 +0300)]
drm/i915/power: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 100 us sleep instead. The timeout remains at 1
ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/900680516b047ae32e3298b5cdbcede0393e0466.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/cdclk: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:50 +0000 (15:20 +0300)]
drm/i915/cdclk: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at
50 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/6d50031411d5517508867d4b595ce90a2b44073b.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/wm: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:49 +0000 (15:20 +0300)]
drm/i915/wm: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at 3
ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/52c80860ea7b98e84f2386ed6cdd761f03190b1e.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/gmbus: use generic poll_timeout*() instead of wait_for*()
Jani Nikula [Thu, 28 Aug 2025 12:20:48 +0000 (15:20 +0300)]
drm/i915/gmbus: use generic poll_timeout*() instead of wait_for*()

Prefer generic poll helpers over i915 custom helpers.

The "two tier" wait_for_us() + wait_for() combination appeared without
much explanation in commit 4e6c2d58ba86 ("drm/i915: Take forcewake once
for the entire GMBUS transaction"). Try to mimic roughly the same with
the generic helpers.

wait_for_us() with 10 us or shorter timeouts ends up in
_wait_for_atomic(). Thus use poll_timeout_us_atomic() for the first try,
with the same 2 us timeout and no sleep.

For the fallback, the functional change is losing the exponentially
growing sleep of wait_for(), which used to be 10, 20, 40, ..., 640, and
1280 us. Use an arbitrary constant 500 us sleep instead. The timeout
remains at 50 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/564b397352c53a1116519fb2d53050c0426bc0dc.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dsi-pll: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:47 +0000 (15:20 +0300)]
drm/i915/dsi-pll: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 500 us sleep instead. The timeout remains at
20 ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/476fcc5aad9e2ddbf6d8c14bd5ff5cbf071c5dca.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/dsi: use generic poll_timeout_us() instead of wait_for_us()
Jani Nikula [Thu, 28 Aug 2025 12:20:46 +0000 (15:20 +0300)]
drm/i915/dsi: use generic poll_timeout_us() instead of wait_for_us()

Prefer generic poll helpers over i915 custom helpers.

The sleep and timeout remain the same as for wait_for_us().

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/02ebcd2864819b7eaf9cf455aa2b968980a2f671.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/hdcp: use generic poll_timeout_us() instead of wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:45 +0000 (15:20 +0300)]
drm/i915/hdcp: use generic poll_timeout_us() instead of wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 100 us sleep instead. The timeout remains at 1
ms.

While at it, use the last failing value for debug logging instead of
reading it again.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/2871a07337401c25ef3df44073c5e78fedc45e8e.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/hdcp: use generic poll_timeout_us() instead of __wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:44 +0000 (15:20 +0300)]
drm/i915/hdcp: use generic poll_timeout_us() instead of __wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
__wait_for(), which used to be 1, 2, 4, ... 64, and 128 ms in this
particular case.

Use an arbitrary 100 ms sleep instead. The timeout remains at 5000 ms.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/bfc9f941ec1628830644f1419d606e3d085aaba0.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/hdmi: use generic poll_timeout_us() instead of __wait_for()
Jani Nikula [Thu, 28 Aug 2025 12:20:43 +0000 (15:20 +0300)]
drm/i915/hdmi: use generic poll_timeout_us() instead of __wait_for()

Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
__wait_for(), which used to be 1, 2, 4, and 8 ms in this particular
case.

Use an arbitrary constant 4 ms sleep instead. The timeout remains,
varying between 20 ms and 3000 ms.

Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/fc3a67f9de0049f415a276bba1c11a4df97e01d6.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915: use REG_BIT on FW_BLC_SELF_* macros
Luca Coelho [Wed, 27 Aug 2025 10:12:06 +0000 (13:12 +0300)]
drm/i915: use REG_BIT on FW_BLC_SELF_* macros

Use REG_BIT() instead of open coding the shift in the FW_BLC_SELF_*
macro definitions to avoid potentially typing them as 'int'.

For example, this happens when we pass them to _MASKED_BIT_ENABLE(),
because of the typeof() construct there.  When we pass 1 << 15 (the
FW_BLC_SELF_EN macro), we get typeof(1 << 15), which is 'int'.  Then
the value becomes negative (-2147450880) and we try to assign it to a
'u32'.

In practice this is not a problem though, because when we try to
assign -2147450880 to the u32, that becomes 0x80008000, which was the
intended result.

Link: https://lore.kernel.org/intel-gfx/20250827111109.401604-1-luciano.coelho@intel.com/
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 months agodrm/sysfb: Remove double assignment to pointer crtc_state
Colin Ian King [Wed, 3 Sep 2025 08:31:06 +0000 (09:31 +0100)]
drm/sysfb: Remove double assignment to pointer crtc_state

The declaration of pointer crtc_state includes an assignment to
crtc_state. The double assignment of crtc_state is redundant and
can be removed.

Fixes: 061963cd9e5b ("drm/sysfb: Blit to CRTC destination format")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250903083106.2703580-1-colin.i.king@gmail.com
4 months agodrm/bridge: it6505: Use SHA-1 library instead of crypto_shash
Eric Biggers [Thu, 21 Aug 2025 17:56:13 +0000 (13:56 -0400)]
drm/bridge: it6505: Use SHA-1 library instead of crypto_shash

Instead of using the "sha1" crypto_shash, simply call the sha1() library
function.  This is simpler and faster.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20250821175613.14717-1-ebiggers@kernel.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
4 months agodrm: panel-backlight-quirks: Log applied panel brightness quirks
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:41 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Log applied panel brightness quirks

Currently, when a panel brightness quirk is applied, there is no log
indicating that a quirk was applied. Unwrap the drm device on its own
and use drm_info() to log when a quirk is applied.

Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-7-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
(Correct a missing -1 in the message math)
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm: panel-backlight-quirks: Add Steam Deck brightness quirk
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:40 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Add Steam Deck brightness quirk

On the SteamOS kernel, Valve universally makes minimum brightness 0
for all devices. SteamOS is (was?) meant for the Steam Deck, so
enabling it universally is reasonable. However, it causes issues in
certain devices. Therefore, introduce it just for the Steam Deck here.

SteamOS kernel does not have a public mirror, but this replaces commit
806dd74bb225 ("amd/drm: override backlight min value from 12 -> 0")
in the latest, as of this writing, SteamOS kernel (6.11.11-valve24).
See unofficial mirror reconstructed from sources below.

Link: https://gitlab.com/evlaV/linux-integration/-/commit/806dd74bb225
Reviewed-by: Robert Beckett <bob.beckett@collabora.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-6-lkml@antheas.dev
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm: panel-backlight-quirks: Add brightness mask quirk
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:39 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Add brightness mask quirk

Certain OLED devices malfunction on specific brightness levels.
Specifically, when DP_SOURCE_BACKLIGHT_LEVEL is written to with
the first byte being 0x00 and sometimes 0x01, the panel forcibly
turns off until the device sleeps again.

Below are some examples. This was found by iterating over brighness
ranges while printing DP_SOURCE_BACKLIGHT_LEVEL. It was found that
the screen would malfunction on specific values, and some of them
were collected.

Therefore, introduce a quirk where the minor byte of brightness is
OR'd with 0x03 to avoid the range of invalid values.

This quirk was tested by removing the workarounds and iterating
from 0 to 50_000 value ranges with a cadence of 0.2s/it. The
range of the panel is 1000...400_000, so the values were slightly
interpolated during testing. The custom brightness curve added on
6.15 was disabled.

 86016:  10101000000000000
 86272:  10101000100000000
 87808:  10101011100000000
251648: 111101011100000000
251649: 111101011100000001

 86144:  10101000010000000
 87809:  10101011100000001
251650: 111101011100000010

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3803
Tested-by: Philip Müller <philm@manjaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-5-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm: panel-backlight-quirks: Add secondary DMI match
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:38 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Add secondary DMI match

Using a single DMI match only allows matching per manufacturer.
Introduce a second optional match to allow matching make/model.
In addition, make DMI optional to allow matching only by EDID.

Tested-by: Philip Müller <philm@manjaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-4-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm: panel-backlight-quirks: Convert brightness quirk to generic structure
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:37 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Convert brightness quirk to generic structure

Currently, the brightness quirk is limited to minimum brightness only.
Refactor it to a structure, so that more quirks can be added in the
future. Reserve 0 value for "no quirk", and use u16 to allow minimum
brightness up to 255.

Tested-by: Philip Müller <philm@manjaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-3-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm: panel-backlight-quirks: Make EDID match optional
Antheas Kapenekakis [Fri, 29 Aug 2025 14:55:36 +0000 (16:55 +0200)]
drm: panel-backlight-quirks: Make EDID match optional

Currently, having a valid panel_id match is required to use the quirk
system. For certain devices, we know that all SKUs need a certain quirk.
Therefore, allow not specifying ident by only checking for a match
if panel_id is non-zero.

Tested-by: Philip Müller <philm@manjaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250829145541.512671-2-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
4 months agodrm/panthor: check bo offset alignment in vm bind
Chia-I Wu [Thu, 28 Aug 2025 20:01:16 +0000 (13:01 -0700)]
drm/panthor: check bo offset alignment in vm bind

Fail early from panthor_vm_bind_prepare_op_ctx instead of late from
ops->map_pages.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250828200116.3532255-1-olvaffe@gmail.com
4 months agodrm/i915/bios: Remove unnecessary checks of PSR idle frames in VBT binary
Jouni Högander [Mon, 1 Sep 2025 10:10:33 +0000 (13:10 +0300)]
drm/i915/bios: Remove unnecessary checks of PSR idle frames in VBT binary

PSR idle frames in VBT binary is a 4 bits wide bitfield. Checking if it's
below 0 or over 15 doesn't make sense. Remove these checks.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250901101033.4176277-1-jouni.hogander@intel.com
4 months agodrm/i915/power: drop a couple of &i915->drm usages
Jani Nikula [Tue, 2 Sep 2025 14:49:29 +0000 (17:49 +0300)]
drm/i915/power: drop a couple of &i915->drm usages

Switch from &i915->drm to display->drm.

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20250902144929.3026700-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/tidss: dispc: Explicitly include bitfield.h
Nathan Chancellor [Tue, 2 Sep 2025 21:15:50 +0000 (14:15 -0700)]
drm/tidss: dispc: Explicitly include bitfield.h

After a recent series to use FIELD_PREP and FIELD_MODIFY in
tidss_dispc.c, there are many errors when bitfield.h is not implicitly
included, such as when building allmodconfig for ARCH=hexagon:

  drivers/gpu/drm/tidss/tidss_dispc.c:1116:2: error: call to undeclared function 'FIELD_MODIFY'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   1116 |         VP_REG_FLD_MOD(dispc, hw_videoport, DISPC_VP_CONTROL, v,
        |         ^
  drivers/gpu/drm/tidss/tidss_dispc.c:631:3: note: expanded from macro 'VP_REG_FLD_MOD'
    631 |                 FIELD_MODIFY((mask), &_reg, (val));                     \
        |                 ^
  drivers/gpu/drm/tidss/tidss_dispc.c:1140:2: error: call to undeclared function 'FIELD_MODIFY'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   1140 |         FIELD_MODIFY(DISPC_VP_DSS_OLDI_CFG_MAP_MASK, &oldi_cfg,
        |         ^
  drivers/gpu/drm/tidss/tidss_dispc.c:1203:10: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   1203 |                        FIELD_PREP(DISPC_VP_TIMING_H_SYNC_PULSE_MASK, hsw - 1) |
        |                        ^
  ...

Explicitly include bitfield.h to resolve the errors.

Fixes: 9accc8b10de8 ("drm/tidss: dispc: Get rid of FLD_VAL")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-tidss-fix-missing-bitfield-h-v1-1-aaad4a285f98@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/i915/dp: convert open-coded timeout to poll_timeout_us()
Jani Nikula [Fri, 29 Aug 2025 11:33:11 +0000 (14:33 +0300)]
drm/i915/dp: convert open-coded timeout to poll_timeout_us()

Use poll_timeout_us() instead of open-coding the timeout loop.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/20250829113311.1930618-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
4 months agodrm/i915/display: Fix possible overflow on tc power domain selection
Mika Kahola [Fri, 29 Aug 2025 10:12:26 +0000 (13:12 +0300)]
drm/i915/display: Fix possible overflow on tc power domain selection

There is a possibility that intel_encoder_to_tc() function
returns negative i.e. TC_PORT_NONE (-1) value which may cause
tc_port_power_domain() function to overflow. To fix this,
let's add additional check that returns invalid power domain
i.e. POWER_DOMAIN_INVALID in case tc port equals TC_PORT_NONE.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250829101226.4085757-1-mika.kahola@intel.com
4 months agodrm/i915: compute pipe bpp from link bandwidth management
Lee Shawn C [Mon, 1 Sep 2025 05:57:21 +0000 (05:57 +0000)]
drm/i915: compute pipe bpp from link bandwidth management

Since intel_fdi_compute_pipe_bpp() is no longer FDI-specific and
now applies to all connectors. Move it to intel_link_bw.c,
and rename to intel_link_bw_compute_pipe_bpp().

v2: Remove unused header file.

Cc: Shankar Uma <uma.shankar@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
[Imre: Remove unused intel_fdi.h include from intel_hdmi.c]
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250901055721.219995-3-shawn.c.lee@intel.com
4 months agodrm/i915/hdmi: add debugfs to contorl HDMI bpc
Lee Shawn C [Mon, 1 Sep 2025 05:57:20 +0000 (05:57 +0000)]
drm/i915/hdmi: add debugfs to contorl HDMI bpc

While performing HDMI compliance testing, test equipment may request
different bpc output for signal measurement. However, display driver
typically determines the maximum available bpc based on HW bandwidth.
This change leverages the existing debugfs (intel_force_link_bpp)
to manage HDMI bpc, and making it easier to pass HDMI CTS.

v2: Using exist variable max_requested_bpc.
v3: Extend intel_force_link_bpp to support HDMI as suggested by Imre.
v4: Update commit message suggested by Jani.
v5: Remove unused header file.

Cc: Shankar Uma <uma.shankar@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250901055721.219995-2-shawn.c.lee@intel.com
4 months agodrm/display: bridge_connector: use drm_bridge_is_last()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:28 +0000 (19:05 +0200)]
drm/display: bridge_connector: use drm_bridge_is_last()

Simplify code to know whether a bridge is the last in the chain by using
drm_bridge_is_last().

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-6-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/bridge: add drm_bridge_is_last()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:27 +0000 (19:05 +0200)]
drm/bridge: add drm_bridge_is_last()

Some code needing to know whether a bridge is the last in a chain currently
call drm_bridge_get_next_bridge(). However drm_bridge_get_next_bridge()
will soon increment the refcount of the returned bridge, which would make
such code more annoying to write.

In preparation for drm_bridge_get_next_bridge() to increment the refcount,
as well as to simplify such code, introduce a simple bool function to tell
whether a bridge is the last in the chain.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-5-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/omapdrm: use drm_bridge_chain_get_last_bridge()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:26 +0000 (19:05 +0200)]
drm/omapdrm: use drm_bridge_chain_get_last_bridge()

Use drm_bridge_chain_get_last_bridge() instead of open coding a loop with
two invocations of drm_bridge_get_next_bridge() per iteration.

Besides being cleaner and more efficient, this change is necessary in
preparation for drm_bridge_get_next_bridge() to get a reference to the
returned bridge.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-4-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/bridge: imx93-mipi-dsi: use drm_bridge_chain_get_last_bridge()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:25 +0000 (19:05 +0200)]
drm/bridge: imx93-mipi-dsi: use drm_bridge_chain_get_last_bridge()

Use drm_bridge_chain_get_last_bridge() instead of open coding a loop with
two invocations of drm_bridge_get_next_bridge() per iteration.

Besides being cleaner and more efficient, this change is necessary in
preparation for drm_bridge_get_next_bridge() to get a reference to the
returned bridge.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-3-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/bridge: add drm_bridge_chain_get_last_bridge()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:24 +0000 (19:05 +0200)]
drm/bridge: add drm_bridge_chain_get_last_bridge()

Add an equivalent of drm_bridge_chain_get_first_bridge() to get the last
bridge.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-2-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agolist: add list_last_entry_or_null()
Luca Ceresoli [Fri, 1 Aug 2025 17:05:23 +0000 (19:05 +0200)]
list: add list_last_entry_or_null()

Add an equivalent of list_first_entry_or_null() to obtain the last element
of a list.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-1-888912b0be13@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/debugfs: bridges_show: show refcount
Luca Ceresoli [Tue, 19 Aug 2025 09:42:10 +0000 (11:42 +0200)]
drm/debugfs: bridges_show: show refcount

Now that bridges are refcounted, exposing the refcount in debugfs can be
useful.

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250819-drm-bridge-debugfs-removed-v7-1-970702579978@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
4 months agodrm/sched: Fix racy access to drm_sched_entity.dependency
Pierre-Eric Pelloux-Prayer [Mon, 1 Sep 2025 12:40:32 +0000 (14:40 +0200)]
drm/sched: Fix racy access to drm_sched_entity.dependency

The drm_sched_job_unschedulable trace point can access
entity->dependency after it was cleared by the callback
installed in drm_sched_entity_add_dependency_cb, causing:

BUG: kernel NULL pointer dereference, address: 0000000000000020
[...]
Workqueue: comp_1.1.0 drm_sched_run_job_work [gpu_sched]
RIP: 0010:trace_event_raw_event_drm_sched_job_unschedulable+0x70/0xd0 [gpu_sched]

To fix this we either need to keep a reference to the fence before
setting up the callbacks, or move the trace_drm_sched_job_unschedulable
calls into drm_sched_entity_add_dependency_cb where they can be
done earlier.

Fixes: 76d97c870f29 ("drm/sched: Trace dependencies for GPU jobs")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250901124032.1955-1-pierre-eric.pelloux-prayer@amd.com
4 months agodrm/i915/hdcp: Remove the encoder check in hdcp enable
Suraj Kandpal [Tue, 19 Aug 2025 15:07:29 +0000 (20:37 +0530)]
drm/i915/hdcp: Remove the encoder check in hdcp enable

Remove the intel_encoder NULL check from _intel_hdcp_enable. With
all the changes it has gone through this check has become unnecessary
since at this point the connector is supposed to have the encoder
in it.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250819150729.88561-1-suraj.kandpal@intel.com
4 months agoMerge tag 'drm-intel-gt-next-2025-09-01' of https://gitlab.freedesktop.org/drm/i915...
Dave Airlie [Tue, 2 Sep 2025 01:23:39 +0000 (11:23 +1000)]
Merge tag 'drm-intel-gt-next-2025-09-01' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

Driver Changes:

- Apply multiple JSL/EHL/Gen7/Gen6 workaround properly at context level (Sebastian)
- Protect against overflow in active_engine() (Krzysztof)
- Use try_cmpxchg64() in __active_lookup() (Uros)

- Enable GuC CT_DEAD output in regular debug builds (John)
- Static checker and style fixes (Sebastian)
- Selftest improvements (Krzysztof)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://lore.kernel.org/r/aLWZoEZVlBj2d8J9@jlahtine-mobl
4 months agoMerge tag 'drm-xe-next-2025-08-29' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Tue, 2 Sep 2025 00:05:55 +0000 (10:05 +1000)]
Merge tag 'drm-xe-next-2025-08-29' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

UAPI Changes:
 - Add madvise interface (Himal Prasad Ghimiray)
 - Add DRM_IOCTL_XE_VM_QUERY_MEMORY_RANGE_ATTRS to query VMA count and
   memory attributes (Himal Prasad Ghimiray)
 - Handle Firmware reported Hardware Errors notifying userspace with
   device wedged uevent (Riana Tauro)

Cross-subsystem Changes:

 - Add a vendor-specific recovery method to drm device wedged uevent
   (Riana Tauro)

Driver Changes:
 - Use same directory structure in debugfs as in sysfs (Michal Wajdeczko)
 - Cleanup and future-proof VRAM region initialization (Piotr Piórkowski)
 - Add G-states and PCIe link states to debugfs (Soham Purkait)
 - Cleanup eustall debug messages (Harish Chegondi)
 - Add SR-IOV support to restore Compression Control Surface (CCS) to
   Xe2 and later (Satyanarayana K V P)
 - Enable SR-IOV PF mode by default on supported platforms without
   needing CONFIG_DRM_XE_DEBUG and mark some platforms behind
   force_probe as supported (Michal Wajdeczko)
 - More targeted log messages (Michal Wajdeczko)
 - Cleanup STEER_SEMAPHORE/MCFG_MCR_SELECTOR usage (Nitin Gote)
 - Use common code to emit flush (Tvrtko Ursulin)
 - Add/extend more HW workarounds and tunings for Xe2 and Xe3
   (Sk Anirban, Tangudu Tilak Tirumalesh, Nitin Gote, Chaitanya Kumar Borah)
 - Add a generic dependency scheduler to help with TLB invalidations
   and future scenarios (Matthew Brost)
 - Use DRM scheduler for delayed GT TLB invalidations (Matthew Brost)
 - Error out on incorrect device use in configfs
   (Michal Wajdeczko, Lucas De Marchi)
 - Refactor configfs attributes (Michal Wajdeczko / Lucas De Marchi)
 - Allow configuring future VF devices via configfs (Michal Wajdeczko)
 - Implement some missing XeLP workarounds (Tvrtko Ursulin)
 - Generalize WA BB setup/emission and add support for
   mid context restore BB, aka indirect context (Tvrtko Ursulin)
 - Prepare the driver to expose mmio regions to userspace
   in future (Ilia Levi)
 - Add more GuC load error status codes (John Harrison)
 - Document DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING (Priyanka Dandamudi)
 - Disable CSC and RPM on VFs (Lukasz Laguna, Satyanarayana K V P)
 - Fix oops in xe_gem_fault with PREEMPT_RT (Maarten Lankhorst)
 - Skip LMTT update if no LMEM was provisioned (Michal Wajdeczko)
 - Add support to VF migration (Tomasz Lis)
 - Use a helper for guc_waklv_enable functions (Jonathan Cavitt)
 - Prepare GPU SVM for migration of THP (Francois Dugast)
 - Program LMTT directory pointer on all GTs within a tile
   (Piotr Piórkowski)
 - Rename XE_WA to XE_GT_WA to better convey its scope vs the device WAs
   (Matt Atwood)
 - Allow to match devices on PCI devid/vendorid only (Lucas De Marchi)
 - Improve PDE PAT index selection (Matthew Brost)
 - Consolidate ASID allocation in xe_vm_create() vs
   xe_vm_create_ioctl() (Piotr Piórkowski)
 - Resize VF BARS to max possible size according to number of VFs
   (Michał Winiarski)
 - Untangle vm_bind_ioctl cleanup order (Christoph Manszewski)
 - Start fixing usage of XE_PAGE_SIZE vs PAGE_SIZE to improve
   compatibility with non-x86 arch (Simon Richter)
 - Improve tile vs gt initialization order and accounting
   (Gustavo Sousa)
 - Extend WA kunit test to PTL
 - Ensure data is initialized before transferring to pcode
   (Stuart Summers)
 - Add PSMI support for HW validation (Lucas De Marchi,
   Vinay Belgaumkar, Badal Nilawar)
 - Improve xe_dma_buf test (Thomas Hellström, Marcin Bernatowicz)
 - Fix basename() usage in generator with !glibc (Carlos Llamas)
 - Ensure GT is in C0 during resumes (Xin Wang)
 - Add TLB invalidation abstraction (Matt Brost, Stuart Summers)
 - Make MI_TLB_INVALIDATE conditional on migrate (Matthew Auld)
 - Prepare xe_nvm to be initialized early for future use cases
   (Riana Tauro)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/nuejxdhnalyok7tzwkrj67dwjgdafwp4mhdejpyyqnrh4f2epq@nlldovuflnbx
4 months agoMerge tag 'amd-drm-next-6.18-2025-08-29' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Mon, 1 Sep 2025 23:35:11 +0000 (09:35 +1000)]
Merge tag 'amd-drm-next-6.18-2025-08-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.18-2025-08-29:

amdgpu:
- Replay fixes
- RAS updates
- VCN SRAM load fixes
- EDID read fixes
- eDP ALPM support
- AUX fixes
- Documenation updates
- Rework how PTE flags are generated
- DCE6 fixes
- VCN devcoredump cleanup
- MMHUB client id fixes
- SR-IOV fixes
- VRR fixes
- VCN 5.0.1 RAS support
- Backlight fixes
- UserQ fixes
- Misc code cleanups
- SMU 13.0.12 updates
- Expanded PCIe DPC support
- Expanded VCN reset support
- SMU 13.0.x Updates
- VPE per queue reset support
- Cusor rotation fix
- DSC fixes
- GC 12 MES TLB invalidation update
- Cursor fixes
- Non-DC TMDS clock validation fix

amdkfd:
- debugfs fixes
- Misc code cleanups
- Page migration fixes
- Partition fixes
- SVM fixes

radeon:
- Misc code cleanups

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250829190848.1921648-1-alexander.deucher@amd.com
4 months agodrm/ssd130x: Remove the use of dev_err_probe()
Liao Yuanhong [Wed, 20 Aug 2025 13:14:15 +0000 (21:14 +0800)]
drm/ssd130x: Remove the use of dev_err_probe()

Logging messages that show some type of "out of memory" error are generally
unnecessary as there is a generic message and a stack dump done by the
memory subsystem. These messages generally increase kernel size without
much added value[1].

The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore,
remove the useless call to dev_err_probe(), and just return the value
instead.

[1]: https://lore.kernel.org/lkml/1402419340.30479.18.camel@joe-AO725/

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250820131416.500048-1-liaoyuanhong@vivo.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/st7571-i2c: add support for 2bit grayscale for XRGB8888
Marcus Folkesson [Mon, 21 Jul 2025 10:43:36 +0000 (12:43 +0200)]
drm/st7571-i2c: add support for 2bit grayscale for XRGB8888

Add support for 2bit grayscale and use it for XRGB8888 when grayscale is
supported.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-6-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/format-helper: introduce drm_fb_xrgb8888_to_gray2()
Marcus Folkesson [Mon, 21 Jul 2025 10:43:35 +0000 (12:43 +0200)]
drm/format-helper: introduce drm_fb_xrgb8888_to_gray2()

Convert XRGB8888 to 2bit grayscale.

It uses drm_fb_xrgb8888_to_gray8() to convert the pixels to gray8 as an
intermediate step before converting to gray2.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-5-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/st7571-i2c: add support for inverted pixel format
Marcus Folkesson [Mon, 21 Jul 2025 10:43:34 +0000 (12:43 +0200)]
drm/st7571-i2c: add support for inverted pixel format

Depending on which display that is connected to the controller, an
"1" means either a black or a white pixel.

The supported formats (R1/R2/XRGB8888) expects the pixels
to map against (4bit):
    00 => Black
    01 => Dark Gray
    10 => Light Gray
    11 => White

If this is not what the display map against, make it possible to invert
the pixels.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-4-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodt-bindings: display: sitronix,st7567: add optional inverted property
Marcus Folkesson [Mon, 21 Jul 2025 10:43:33 +0000 (12:43 +0200)]
dt-bindings: display: sitronix,st7567: add optional inverted property

Depending on which display that is connected to the controller, an "1"
means either a black or a white pixel.

The supported format (R1) expects the pixels to map against:
    0 => Black
    1 => White

If this is not what the display map against, the controller has support
to invert these values.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-3-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodt-bindings: display: sitronix,st7571: add optional inverted property
Marcus Folkesson [Mon, 21 Jul 2025 10:43:32 +0000 (12:43 +0200)]
dt-bindings: display: sitronix,st7571: add optional inverted property

Depending on which display that is connected to the controller, an "1"
means either a black or a white pixel.

The supported formats (R1/R2/XRGB8888) expects the pixels
to map against (4bit):
00 => Black
01 => Dark Gray
10 => Light Gray
11 => White

If this is not what the display map against, the controller has support
to invert these values.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-2-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/st7571-i2c: correct pixel data format description
Marcus Folkesson [Mon, 21 Jul 2025 10:43:31 +0000 (12:43 +0200)]
drm/st7571-i2c: correct pixel data format description

The comment describes the pixel data format as stated in
the st7571 datasheet, which is not necessary the same
as for the connected display.

Instead, describe the expected pixel data format which is used for
R1/R2/XRGB8888.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20250721-st7571-format-v2-1-159f4134098c@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/imagination: Enable PowerVR driver for RISC-V
Michal Wilczynski [Thu, 21 Aug 2025 22:20:18 +0000 (00:20 +0200)]
drm/imagination: Enable PowerVR driver for RISC-V

Several RISC-V boards feature Imagination GPUs that are compatible with
the PowerVR driver. An example is the IMG BXM-4-64 GPU on the Lichee Pi
4A board. This commit adjusts the driver's Kconfig dependencies to allow
the PowerVR driver to be compiled on the RISC-V architecture.

By enabling compilation on RISC-V, we expand support for these GPUs,
providing graphics acceleration capabilities and enhancing hardware
compatibility on RISC-V platforms.

The RISC-V support is restricted to 64-bit systems (RISCV && 64BIT) as
the driver currently has an implicit dependency on a 64-bit platform.

Add a dependency on MMU to fix a build warning on RISC-V configurations
without an MMU.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://lore.kernel.org/r/20250822-apr_14_for_sending-v13-4-af656f7cc6c3@samsung.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
4 months agodt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU support
Michal Wilczynski [Thu, 21 Aug 2025 22:20:16 +0000 (00:20 +0200)]
dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU support

Rework the PowerVR Rogue GPU binding to use an explicit, per variant
style for defining power domain properties and add support for the
T-HEAD TH1520 SoC's GPU.

To improve clarity and precision, the binding is refactored so that
power domain items are listed explicitly for each variant [1]. The
previous method relied on an implicit, positional mapping between the
`power-domains` and `power-domain-names` properties. This change
replaces the generic rules with self contained if/then blocks for each
GPU variant, making the relationship between power domains and their
names explicit and unambiguous.

The generic if block for img,img-rogue, which previously required
power-domains and power-domain-names for all variants, is removed.
Instead, each specific GPU variant now defines its own power domain
requirements within a self-contained if/then block, making the schema
more explicit.

This new structure is then used to add support for the
`thead,th1520-gpu`. While its BXM-4-64 IP has two conceptual power
domains, the TH1520 SoC integrates them behind a single power gate. The
new binding models this with a specific rule that enforces a single
`power-domains` entry and disallows the `power-domain-names` property.

Link: https://lore.kernel.org/all/4d79c8dd-c5fb-442c-ac65-37e7176b0cdd@linaro.org/
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://lore.kernel.org/r/20250822-apr_14_for_sending-v13-2-af656f7cc6c3@samsung.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
4 months agodrm/imagination: Use pwrseq for TH1520 GPU power management
Michal Wilczynski [Thu, 21 Aug 2025 22:20:15 +0000 (00:20 +0200)]
drm/imagination: Use pwrseq for TH1520 GPU power management

Update the Imagination PVR DRM driver to leverage the pwrseq framework
for managing the complex power sequence of the GPU on the T-HEAD TH1520
SoC.

To cleanly separate platform-specific logic from the generic driver,
this patch introduces an `init` callback to the `pwr_power_sequence_ops`
struct. This allows for different power management strategies to be
selected at probe time based on the device's compatible string.

A `pvr_device_data` struct, associated with each compatible in the
of_device_id table, points to the appropriate ops table (manual or
pwrseq).

At probe time, the driver now calls the `->init()` op. For pwrseq-based
platforms, this callback calls `devm_pwrseq_get("gpu-power")`, deferring
probe if the sequencer is not yet available. For other platforms, it
falls back to the existing manual clock and reset handling. The runtime
PM callbacks continue to call the appropriate functions via the ops
table.

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Link: https://lore.kernel.org/r/20250822-apr_14_for_sending-v13-1-af656f7cc6c3@samsung.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
4 months agoaccel/ivpu: Make function parameter names consistent
Jacek Lawrynowicz [Fri, 8 Aug 2025 11:10:14 +0000 (13:10 +0200)]
accel/ivpu: Make function parameter names consistent

Make ivpu_hw_btrs_dct_set_status() and ivpu_fw_boot_params_setup()
declaration and definition parameter names consistent.

Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://lore.kernel.org/r/20250808111014.328607-1-jacek.lawrynowicz@linux.intel.com
4 months agoaccel/ivpu: Remove unused PLL_CONFIG_DEFAULT
Jacek Lawrynowicz [Fri, 8 Aug 2025 11:10:44 +0000 (13:10 +0200)]
accel/ivpu: Remove unused PLL_CONFIG_DEFAULT

This change removes the unnecessary condition, makes the code clearer,
and silences clang-tidy warning.

Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://lore.kernel.org/r/20250808111044.328800-1-jacek.lawrynowicz@linux.intel.com
4 months agoMAINTAINERS: adjust file entry in DRM ACCEL DRIVER FOR ROCKCHIP NPU
Lukas Bulwahn [Tue, 26 Aug 2025 06:32:48 +0000 (08:32 +0200)]
MAINTAINERS: adjust file entry in DRM ACCEL DRIVER FOR ROCKCHIP NPU

Commit a7352c849492 ("dt-bindings: npu: rockchip,rknn: Add bindings") adds
the device-tree binding rockchip,rk3588-rknn-core.yaml, whereas the commit
ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU") adds the
section DRM ACCEL DRIVER FOR ROCKCHIP NPU in MAINTAINERS with a file entry
referring to rockchip,rknn-core.yaml. Note that the file entry is missing
the part rk3588, compared to the added file above, which it intends to
refer to.

Adjust the file entry to the intended file name.

Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/20250826063248.32153-1-lukas.bulwahn@redhat.com
4 months agoaccel/rocket: Fix some error checking in rocket_core_init()
Dan Carpenter [Thu, 21 Aug 2025 12:30:19 +0000 (15:30 +0300)]
accel/rocket: Fix some error checking in rocket_core_init()

The problem is that pm_runtime_get_sync() can return 1 on success so
checking for zero doesn't work.  Use the pm_runtime_resume_and_get()
function instead.  The pm_runtime_resume_and_get() function does
additional cleanup as well so that's a bonus as well.

Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/aKcRW6fsRP_o5C_y@stanley.mountain
4 months agoaccel/rocket: Check the correct DMA irq status to warn about
Heiko Stuebner [Mon, 18 Aug 2025 18:56:58 +0000 (20:56 +0200)]
accel/rocket: Check the correct DMA irq status to warn about

Right now, the code checks the DMA_READ_ERROR state 2 times, while
I guess it was supposed to warn about both read and write errors.

Change the 2nd check to look at the write-error flag.

Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/20250818185658.2585696-1-heiko@sntech.de
4 months agoaccel/rocket: Fix usages of kfree() and sizeof()
Brigham Campbell [Wed, 13 Aug 2025 16:02:37 +0000 (10:02 -0600)]
accel/rocket: Fix usages of kfree() and sizeof()

Replace usages of kfree() with kvfree() for pointers which were
allocated using kvmalloc(), as required by the kernel memory management
API.

Use sizeof() on the type that a pointer references instead of the
pointer itself. In this case, scheds and *scheds both happen to be
pointers, so sizeof() will expand to the same value in either case, but
using *scheds is more technically correct since scheds is an array of
drm_gpu_scheduler *.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202508120730.PLbjlKbI-lkp@intel.com/
Signed-off-by: Brigham Campbell <me@brighamcampbell.com>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/20250813-rocket-free-fix-v1-1-51f00a7a1271@brighamcampbell.com
Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
4 months agoaccel/rocket: Depend on DRM_ACCEL not just DRM
Heiko Stuebner [Thu, 14 Aug 2025 11:35:19 +0000 (13:35 +0200)]
accel/rocket: Depend on DRM_ACCEL not just DRM

With the current dependency on only DRM, a config of

CONFIG_DRM_ACCEL_ROCKET=y

is possible, but of course wrong, because without DRM_ACCEL the build-
system will never even enter drivers/accel/* .

So depend on DRM_ACCEL instead of just DRM.

Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/20250814113519.1551855-3-heiko@sntech.de
4 months agoaccel/rocket: Fix indentation of Kconfig entry
Heiko Stuebner [Thu, 14 Aug 2025 11:35:18 +0000 (13:35 +0200)]
accel/rocket: Fix indentation of Kconfig entry

The general indentation for the Kconfig lines is one tab, so adapt the
lines accordingly.

The description is correctly indented (1 tab + 2 spaces) so doesn't need
changes.

Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/20250814113519.1551855-2-heiko@sntech.de
4 months agodrm/rcar-du: dsi: Fix 1/2/3 lane support
Marek Vasut [Wed, 13 Aug 2025 21:08:13 +0000 (23:08 +0200)]
drm/rcar-du: dsi: Fix 1/2/3 lane support

Remove fixed PPI lane count setup. The R-Car DSI host is capable
of operating in 1..4 DSI lane mode. Remove the hard-coded 4-lane
configuration from PPI register settings and instead configure
the PPI lane count according to lane count information already
obtained by this driver instance.

Configure TXSETR register to match PPI lane count. The R-Car V4H
Reference Manual R19UH0186EJ0121 Rev.1.21 section 67.2.2.3 Tx Set
Register (TXSETR), field LANECNT description indicates that the
TXSETR register LANECNT bitfield lane count must be configured
such, that it matches lane count configuration in PPISETR register
DLEN bitfield. Make sure the LANECNT and DLEN bitfields are
configured to match.

Fixes: 155358310f01 ("drm: rcar-du: Add R-Car DSI driver")
Cc: stable@vger.kernel.org
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250813210840.97621-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/sitronix/st7571-i2c: Make st7571_panel_data variables static const
Javier Martinez Canillas [Fri, 18 Jul 2025 15:25:25 +0000 (17:25 +0200)]
drm/sitronix/st7571-i2c: Make st7571_panel_data variables static const

The kernel test robot reported that sparse gives the following warnings:

make C=2 M=drivers/gpu/drm/sitronix/
  CC [M]  st7571-i2c.o
  CHECK   st7571-i2c.c
st7571-i2c.c:1027:26: warning: symbol 'st7567_config' was not declared. Should it be static?
st7571-i2c.c:1039:26: warning: symbol 'st7571_config' was not declared. Should it be static?
  MODPOST Module.symvers
  LD [M]  st7571-i2c.ko

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507180503.nfyD9uRv-lkp@intel.com
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250718152534.729770-1-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
4 months agodrm/tidss: dispc: Define field masks being used
Maxime Ripard [Wed, 27 Aug 2025 15:12:45 +0000 (17:12 +0200)]
drm/tidss: dispc: Define field masks being used

Now that we have all the accessors taking masks, we can create defines
for them and reuse them as needed.

It makes the driver easier to read, less prone to consistency issues,
and allows to reuse defines when needed.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-14-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch OVR_REG_FLD_MOD to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:44 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch OVR_REG_FLD_MOD to using a mask

The OVR_REG_FLD_MOD function takes the start and end bits as parameter
and will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change OVR_REG_FLD_MOD to take the mask as an argument instead,
and let the caller create the mask. Eventually, this mask will be moved
to a define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-13-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch VP_REG_FLD_MOD to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:43 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch VP_REG_FLD_MOD to using a mask

The VP_REG_FLD_MOD function takes the start and end bits as parameter
and will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change VP_REG_FLD_MOD to take the mask as an argument instead, and
let the caller create the mask. Eventually, this mask will be moved to a
define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-12-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch VP_REG_GET to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:42 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch VP_REG_GET to using a mask

The VP_REG_GET function takes the start and end bits as parameter and
will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change VP_REG_GET to take the mask as an argument instead, and let
the caller create the mask. Eventually, this mask will be moved to a
define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-11-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch VID_REG_FLD_MOD to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:41 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch VID_REG_FLD_MOD to using a mask

The VID_REG_FLD_MOD function takes the start and end bits as parameter
and will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change VID_REG_FLD_MOD to take the mask as an argument instead,
and let the caller create the mask. Eventually, this mask will be moved
to a define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-10-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch VID_REG_GET to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:40 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch VID_REG_GET to using a mask

The VID_REG_GET function takes the start and end bits as parameter and
will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change VID_REG_GET to take the mask as an argument instead, and
let the caller create the mask. Eventually, this mask will be moved to a
define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-9-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch REG_FLD_MOD to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:39 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch REG_FLD_MOD to using a mask

The REG_FLD_MOD function takes the start and end bits as parameter and
will generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change REG_FLD_MOD to take the mask as an argument instead, and
let the caller create the mask. Eventually, this mask will be moved to a
define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-8-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch REG_GET to using a mask
Maxime Ripard [Wed, 27 Aug 2025 15:12:38 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch REG_GET to using a mask

The REG_GET function takes the start and end bits as parameter and will
generate a mask out of them.

This makes it difficult to share the masks between callers, since we now
need two arguments and to keep them consistent.

Let's change REG_GET to take the mask as an argument instead, and let
the caller create the mask. Eventually, this mask will be moved to a
define.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-7-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Get rid of FLD_MOD
Maxime Ripard [Wed, 27 Aug 2025 15:12:37 +0000 (17:12 +0200)]
drm/tidss: dispc: Get rid of FLD_MOD

The FLD_MOD function is an equivalent to what FIELD_MODIFY + GENMASK
provide, so let's drop it and switch to the latter.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-6-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Get rid of FLD_GET
Maxime Ripard [Wed, 27 Aug 2025 15:12:36 +0000 (17:12 +0200)]
drm/tidss: dispc: Get rid of FLD_GET

The FLD_GET function is an equivalent to what FIELD_GET + GENMASK
provide, so let's drop it and switch to the latter.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-5-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Get rid of FLD_VAL
Maxime Ripard [Wed, 27 Aug 2025 15:12:35 +0000 (17:12 +0200)]
drm/tidss: dispc: Get rid of FLD_VAL

The FLD_VAL function is an equivalent to what FIELD_PREP + GENMASK
provide, so let's drop it and switch to the latter.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-4-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
4 months agodrm/tidss: dispc: Switch to GENMASK instead of FLD_MASK
Maxime Ripard [Wed, 27 Aug 2025 15:12:34 +0000 (17:12 +0200)]
drm/tidss: dispc: Switch to GENMASK instead of FLD_MASK

The dispc FLD_MASK function is an exact equivalent of the GENMASK macro.
Let's convert the dispc driver to the latter.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-3-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>