Dave Airlie
0d9f0083f7
Merge tag 'v6.17-rc6' into drm-next
...
This is a backmerge of Linux 6.17-rc6, needed for msm,
also requested by misc.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2025-09-15 17:51:07 +10:00
Dave Airlie
b1c1c52448
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
2025-09-12 12:17:10 +10:00
Jani Nikula
cfa7b76597
drm/i915/power: fix size for for_each_set_bit() in abox iteration
...
for_each_set_bit() expects size to be in bits, not bytes. The abox mask
iteration uses bytes, but it works by coincidence, because the local
variable holding the mask is unsigned long, and the mask only ever has
bit 2 as the highest bit. Using a smaller type could lead to subtle and
very hard to track bugs.
Fixes: 62afef2811 ("drm/i915/rkl: RKL uses ABOX0 for pixel transfers")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: stable@vger.kernel.org # v5.9+
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://lore.kernel.org/r/20250905104149.1144751-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
(cherry picked from commit 7ea3baa6ef )
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net >
2025-09-09 09:08:37 +01:00
Juha-Pekka Heikkila
70a9b201cf
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
2025-09-05 15:24:46 +03:00
Juha-Pekka Heikkila
1de89eca20
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
2025-09-05 15:24:45 +03:00
Juha-Pekka Heikkila
7d8a7ec813
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
2025-09-05 15:24:44 +03:00
Ville Syrjälä
4dfd3a56d6
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 >
2025-09-05 14:37:32 +03:00
Ville Syrjälä
115cebc303
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 >
2025-09-05 14:37:32 +03:00
Ville Syrjälä
413439008c
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 >
2025-09-05 14:37:32 +03:00
Ville Syrjälä
8d87f08ba0
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 >
2025-09-05 14:37:32 +03:00
Imre Deak
2ce575d6a1
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
2025-09-05 14:20:55 +03:00
Jouni Högander
d074a40b88
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
2025-09-05 08:35:47 +03:00
Jouni Högander
cc2189a978
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
2025-09-05 08:35:46 +03:00
Jouni Högander
e9c62c8654
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
2025-09-05 08:35:45 +03:00
Jouni Högander
3b5b2567f8
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
2025-09-05 08:35:45 +03:00
Jani Nikula
f7e60f1570
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
54846c2ea7
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
f141590008
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
19b31edb0a
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
bcd23d8ee0
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
7987b76433
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
46013820f4
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 >
2025-09-04 14:02:59 +03:00
Jani Nikula
476721f28e
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
39b555b3ea
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
e38e3c50a1
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
a8eb4cdced
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
c698a48e9f
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
032a3bd4d6
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
7f38db435c
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
11080a5ea8
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 4e6c2d58ba ("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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
0399a33685
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
17d56494c1
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
e54d34e4b3
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
6f1759df0f
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 >
2025-09-04 14:02:58 +03:00
Jani Nikula
00cbd55557
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 >
2025-09-04 14:02:58 +03:00
Jouni Högander
e9a1d54ed9
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
2025-09-03 13:40:39 +03:00
Jani Nikula
98463a8d9c
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 >
2025-09-03 13:32:33 +03:00
Jani Nikula
38f9262b05
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 >
2025-09-03 12:05:21 +03:00
Mika Kahola
765531faa4
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
2025-09-03 09:48:57 +03:00
Lee Shawn C
5f9bab8081
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
2025-09-02 13:53:33 +03:00
Lee Shawn C
51bfda2e76
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
2025-09-02 13:43:34 +03:00
Suraj Kandpal
e548e04e61
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
2025-09-02 10:31:26 +05:30
Jouni Högander
61a0ef5921
drm/i915/psr: Check PSR pause counter in __psr_wait_for_idle_locked
...
PSR work is using __psr_wait_for_idle_locked to ensure PSR exit is
completed before continuing to PSR activation. __psr_wait_for_idle_locked
is unlocking PSR mutex which allows PSR disable/enable and PSR
pause/resume while PSR idle is being wait. PSR enable status is already
checked after locking again PSR mutex but PSR pause counter check is
missing. Due to this PSR work may continue to PSR activation even PSR is
paused.
Fix this by checking PSR pause counter in __psr_wait_for_idle_locked after
PSR mutex is locked again.
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Reviewed-by: Jeevan B <jeevan.b@intel.com >
Link: https://lore.kernel.org/r/20250826074457.1992524-1-jouni.hogander@intel.com
2025-08-27 09:48:54 +03:00
Jouni Högander
c65ee1b1ff
drm/i915/psr: Do not unnecessarily remove underrun on idle PSR WA
...
We are currently removing underrun on idle PSR WA even if it's not
applied. Fix this by checking pkg_c_latency_used on PSR exit as well.
Fixes: 9b1795e9b0 ("drm/i915/psr: Underrun on idle PSR wa only when pkgc latency > delayed vblank")
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
Link: https://lore.kernel.org/r/20250822105846.1023631-1-jouni.hogander@intel.com
2025-08-26 10:23:21 +03:00
Jouni Högander
9cc10041e9
drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init
...
Currently we are ignoriong drm_dp_dpcd_read return values when reading PSR
and Panel Replay capability DPCD register. Rework intel_psr_dpcd a bit to
take care of checking the return value.
v2: use drm_dp_dpcd_read_data
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://lore.kernel.org/r/20250821045918.17757-1-jouni.hogander@intel.com
2025-08-25 09:12:46 +03:00
Suraj Kandpal
2dbb3d70af
drm/i915/edp: eDP Data Overrride
...
We need override certain link rates in favour of the next available
higher link rate. The Link rates that need to be overridden are
indicated by a mask in VBT. To make sure these modes are skipped we
don't add them in them in the sink rates array.
--v2
-Update the link rates after we have a final set of link rates [Ankit]
-Break this patch up [Ankit]
-Optimize the assingment during loop [Ankit]
--v3
-Add protection against broken VBTs [Jani]
--v4
-Fix build errors
-Create a seprate function to check if edp data override is selected
and using the correct vbt
--v5
-Use correct number to check the num of edp rates [Ankit]
--v6
-No seprate function check if vbt is broken in the reject rate function
[Jani]
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com >
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Link: https://lore.kernel.org/r/20250821042653.269227-4-suraj.kandpal@intel.com
2025-08-25 10:06:47 +05:30
Suraj Kandpal
835a0d544d
drm/i915/bios: Add function to check if edp data override is needed
...
Add a function that helps identify if the rate provided needs to
be overridden. For this we need a function that compares the rate
provided and bitmask of rates provided in VBT.
--v2
-Rename functions [Jani]
-Return the mask instead of parsing it in function [Jani]
-Move the declaration in header [Jani]
--v3
-Change function name to depict what the function does [Ankit]
--v4
-Lets not use hweight [Ankit]
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com >
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Link: https://lore.kernel.org/r/20250821042653.269227-3-suraj.kandpal@intel.com
2025-08-25 09:53:11 +05:30
Suraj Kandpal
4d33c77cf2
drm/i915/vbt: Add eDP Data rate overrride field in VBT
...
Add edp_data_rate_override field VBT which gives us a mask
of rates which needs to be skipped in favour of
subsequent higher rate.
--v2
-Rename vbt field [Jani]
-Fix comment to 263+ [Jani]
-Use BIT_U32 [Jani]
-Fix the bits assignment in vbt [Jani]
--v3
-Add a mask which represents all link rates [Ankit]
Bspec: 20124
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com >
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Link: https://lore.kernel.org/r/20250821042653.269227-2-suraj.kandpal@intel.com
2025-08-25 09:53:10 +05:30
Jouni Högander
7c8c76272e
drm/i915/psr: Check pause counter before continuing to PSR activation
...
Currently intel_psr_work is re-activating PSR even when pause_counter > 0
which is incorrect. Fix this by checking pause_counter before re-activating
PSR.
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14822
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Reviewed-by: Mika Kahola <mika.kahola@intel.com >
Link: https://lore.kernel.org/r/20250815084534.1637030-4-jouni.hogander@intel.com
2025-08-21 13:40:31 +03:00
Jouni Högander
73b60be7f6
drm/i915/psr: Do not activate disabled PSR on irq_aux_error
...
Currently intel_psr_work is continuing to activation of PSR which was just
disabled when irq_aux_error == true.
Fix this by skipping everything else than intel_psr_handle_irq in
intel_psr_work when irq_aux_error == true.
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Reviewed-by: Mika Kahola <mika.kahola@intel.com >
Link: https://lore.kernel.org/r/20250815084534.1637030-3-jouni.hogander@intel.com
2025-08-21 13:40:31 +03:00