]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
8 weeks agodrm/i915/dkl: return if tc_port is invalid in dkl_phy_set_hip_idx()
Luca Coelho [Tue, 20 May 2025 08:26:58 +0000 (11:26 +0300)] 
drm/i915/dkl: return if tc_port is invalid in dkl_phy_set_hip_idx()

In dkl_phy_set_hip_idx(), we may try to shift a value negatively,
whose behavior is undefined.  This can happen because we define
TC_PORT_NONE to -1, so theoretically tc_port could be -1.  We will
then use tc_port to shift to the correct address of the specified
port, but if it's negative, anything can happen.

If this happens or tc_port exceeds I915_MAX_TC_PORTS, it's safer to
return with a warning than risk an invalid write.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250520082917.1302665-2-luciano.coelho@intel.com
8 weeks agodrm/i915/dram: allocate struct dram_info dynamically
Jani Nikula [Tue, 27 May 2025 09:25:26 +0000 (12:25 +0300)] 
drm/i915/dram: allocate struct dram_info dynamically

Allocate struct drm_info dynamically, and convert the struct
drm_i915_private and struct xe_device dram_info member into a const
pointer. Move the struct definition to intel_dram.h, and keep it opaque
to everyone not needing it. This also removes the duplication of the
struct definition.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/73625095157346ea0e8614108c9b369208e5df66.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/dram: add return value and handling to intel_dram_detect()
Jani Nikula [Tue, 27 May 2025 09:25:25 +0000 (12:25 +0300)] 
drm/i915/dram: add return value and handling to intel_dram_detect()

We'll want to start returning errors from intel_dram_detect(). As the
first step, add the return value and error handling, even if we still
only return 0.

Do no functional changes, but leave a comment about whether we should
bail out on dram detection failures.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/be2c31c459fb95d8161b719d499403eea5ec17b7.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/dram: pass struct dram_info pointer around
Jani Nikula [Tue, 27 May 2025 09:25:24 +0000 (12:25 +0300)] 
drm/i915/dram: pass struct dram_info pointer around

Figure out the struct dram_info pointer in one place, and pass that
around to be filled in, instead of all places poking at i915->dram_info
directly.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/8ac6b308b210cf4a429d5abfb9bf32737dcab51f.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/wm: DG2 doesn't have dram info to look up wm_lv_0_adjust_needed
Jani Nikula [Tue, 27 May 2025 09:25:23 +0000 (12:25 +0300)] 
drm/i915/wm: DG2 doesn't have dram info to look up wm_lv_0_adjust_needed

There's no dram info on DG2 that we could use. The struct dram_info is
all zero on it, but be explicit about this.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/a866641bff364dcfcaaabaa1d53c4a8cfa94ff3f.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/dram: add accessor for struct dram_info and use it
Jani Nikula [Tue, 27 May 2025 09:25:22 +0000 (12:25 +0300)] 
drm/i915/dram: add accessor for struct dram_info and use it

Add a function to get the (const) pointer to struct dram_info, and use
that to obtain the pointer instead of poking at i915->dram_info
directly.

Clean up a couple of local variables while at it.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/4174edf649e2f6805dab6fd6ce2ec10f4e5f2498.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/bw: pass struct dram_info pointer around
Jani Nikula [Tue, 27 May 2025 09:25:21 +0000 (12:25 +0300)] 
drm/i915/bw: pass struct dram_info pointer around

Have just one place to figure out the pointer to struct dram_info, and
pass that around. This simplifies future changes.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Link: https://lore.kernel.org/r/1752b4987ff39a685c28cebae1be4ce326b67c7b.1748337870.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: clean up SBI register macro definitions and usage
Jani Nikula [Tue, 27 May 2025 10:59:14 +0000 (13:59 +0300)] 
drm/i915/sbi: clean up SBI register macro definitions and usage

Use REG_BIT() and friends for defining the register macros. Switch GVT
to use the same macros, and drop its own copies.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/e148e8621c6055d0441fdf6d651d4ad24be53d09.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: split out intel_sbi_regs.h
Jani Nikula [Tue, 27 May 2025 10:59:13 +0000 (13:59 +0300)] 
drm/i915/sbi: split out intel_sbi_regs.h

Split out display/intel_sbi_regs.h from i915_reg.h. Include both the SBI
interface MMIO as well as the known sideband offsets.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/c96197159e05ebcb63fcc05f0f0801624cd4fdeb.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: convert to intel_de_*()
Jani Nikula [Tue, 27 May 2025 10:59:12 +0000 (13:59 +0300)] 
drm/i915/sbi: convert to intel_de_*()

Convert SBI to use the intel_de_*() interface. This allows us to drop
the dependency in i915_drv.h while at it.

The fast timeout for the status wait drops from 100 us to 2 us on i915,
but that should be of no consequence. The slow timeout remains the same.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/146f9027f565feb827861f06c1ae218b378edd95.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915: add out_value to intel_wait_for_register_fw() and intel_de_wait_fw()
Jani Nikula [Tue, 27 May 2025 10:59:11 +0000 (13:59 +0300)] 
drm/i915: add out_value to intel_wait_for_register_fw() and intel_de_wait_fw()

Future users of intel_de_wait_fw() need the final value. Just return it
for everyone using intel_wait_for_register_fw() and intel_de_wait_fw()
to avoid adding or using another set of specialized functions. There
aren't that many users for these anyway.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/f804b2fe85ad63389e74d82e4c97220e9275f170.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/de: rename timeout parameters timeout_ms to highlight unit
Jani Nikula [Tue, 27 May 2025 10:59:10 +0000 (13:59 +0300)] 
drm/i915/de: rename timeout parameters timeout_ms to highlight unit

The timeout parameters are in ms. Rename the parameters to highlight the
unit.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/cd4c775ad323a577f612e6a942f83b22641fb798.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: move sbi_lock under struct intel_display
Jani Nikula [Tue, 27 May 2025 10:59:09 +0000 (13:59 +0300)] 
drm/i915/sbi: move sbi_lock under struct intel_display

With SBI under display, also move sbi_lock to display->sbi.lock.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/838fa712fc8a691a3f9427e5f4ed551bd1c62c49.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: convert intel_sbi.[ch] to struct intel_display
Jani Nikula [Tue, 27 May 2025 10:59:08 +0000 (13:59 +0300)] 
drm/i915/sbi: convert intel_sbi.[ch] to struct intel_display

Convert intel_sbi.[ch] to struct intel_display, as much as possible
anyway, and as a consequence drop the dependency on i915_drv.h from
intel_pch_refclk.c.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/9fa9f9a828a7e0e93208111566478b16838abe0d.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/sbi: move intel_sbi.[ch] under display/
Jani Nikula [Tue, 27 May 2025 10:59:07 +0000 (13:59 +0300)] 
drm/i915/sbi: move intel_sbi.[ch] under display/

The LPT/WPT SBI is arguably part of south display, and it's only used by
intel_pch_refclk.c anyway. Move it under display/.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/341268d633e9705bc582f1cc985dc4554e39d87d.1748343520.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 weeks agodrm/i915/display: Fix u32 overflow in SNPS PHY HDMI PLL setup
Dibin Moolakadan Subrahmanian [Wed, 28 May 2025 06:45:56 +0000 (12:15 +0530)] 
drm/i915/display: Fix u32 overflow in SNPS PHY HDMI PLL setup

When configuring the HDMI PLL, calculations use DIV_ROUND_UP_ULL and
DIV_ROUND_DOWN_ULL macros, which internally rely on do_div. However, do_div
expects a 32-bit (u32) divisor, and at higher data rates, the divisor can
exceed this limit. This leads to incorrect division results and
ultimately misconfigured PLL values.
This fix replaces do_div calls with  div64_base64 calls where diviser
can exceed u32 limit.

Fixes: 5947642004bf ("drm/i915/display: Add support for SNPS PHY HDMI PLL algorithm for DG2")
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250528064557.4172149-1-dibin.moolakadan.subrahmanian@intel.com
2 months agodrm/i915: drop intel_dpio_phy.h include from VLV IOSF SB
Jani Nikula [Tue, 27 May 2025 11:48:54 +0000 (14:48 +0300)] 
drm/i915: drop intel_dpio_phy.h include from VLV IOSF SB

vlv_iosf_sb.c no longer depends on enum dpio_phy from
intel_dpio_phy.h. Drop the include.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250527114854.3687469-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/psr: Do not disable Panel Replay in case VRR is enabled
Jouni Högander [Mon, 26 May 2025 12:05:12 +0000 (15:05 +0300)] 
drm/i915/psr: Do not disable Panel Replay in case VRR is enabled

Allow Panel Replay with VRR. All VRR modes are supposed to work with
Panel Replay.

Bspec: 68920, 68925
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-13-jouni.hogander@intel.com
2 months agodrm/i915/psr: Fix using wrong mask in REG_FIELD_PREP
Jouni Högander [Mon, 26 May 2025 12:05:11 +0000 (15:05 +0300)] 
drm/i915/psr: Fix using wrong mask in REG_FIELD_PREP

Wrong mask is used in PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION and
PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION.

Fixes: 295099580f04 ("drm/i915/psr: Add missing ALPM AUX-Less register definitions")
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-12-jouni.hogander@intel.com
2 months agodrm/i915/display: Add function to configure LFPS sending
Jouni Högander [Mon, 26 May 2025 12:05:10 +0000 (15:05 +0300)] 
drm/i915/display: Add function to configure LFPS sending

Add function to configre LFPS sending for Panel Replay according to link
training sequence in HAS document.

This assumes we are using AUX Less always if it's supported by the sink and
the source.

v2:
  - drop HAS reference
  - replay kerneldoc comment with a generic comment
  - check display version in intel_lnl_mac_transmit_lfps

Bspec: 68849
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-11-jouni.hogander@intel.com
2 months agodrm/i915/display: Add PHY_CMN1_CONTROL register definitions
Jouni Högander [Mon, 26 May 2025 12:05:09 +0000 (15:05 +0300)] 
drm/i915/display: Add PHY_CMN1_CONTROL register definitions

Add PHY_CMN1_CONTROL register and its definitions to configure port LFPS
sending.

Bspec: 68962
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-10-jouni.hogander@intel.com
2 months agodrm/i915/alpm: Move port alpm configuration
Jouni Högander [Mon, 26 May 2025 12:05:08 +0000 (15:05 +0300)] 
drm/i915/alpm: Move port alpm configuration

It is specified in Bspec where port alpm configuration is supposed to be
performed. Change accordingly.

v2:
  - drop HAS reference
  - ensure PORT_ALPM registers are not writen on older platform

Bspec: 68849
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-9-jouni.hogander@intel.com
2 months agodrm/i915/alpm: Add new interface to check if AUXLess ALPM is used
Jouni Högander [Mon, 26 May 2025 12:05:07 +0000 (15:05 +0300)] 
drm/i915/alpm: Add new interface to check if AUXLess ALPM is used

we need to know if AUXLess ALPM is used when preparing for link
training. Add new interface for this and use it in existing code where
possible.

v2: remove kerneldoc comment

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-8-jouni.hogander@intel.com
2 months agodrm/i915/psr: Add interface to check if AUXLess ALPM is needed by PSR
Jouni Högander [Mon, 26 May 2025 12:05:06 +0000 (15:05 +0300)] 
drm/i915/psr: Add interface to check if AUXLess ALPM is needed by PSR

Currently we spread ugly PSR details into ALPM code to check if AUXLess
ALPM is needed. Prepare to hide these details to PSR code by adding new
interface for checking if AUXLess ALPM is needed.

v2: remove kerneldoc comment

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-7-jouni.hogander@intel.com
2 months agodrm/i915/alpm: Write PR_ALPM_CTL register
Jouni Högander [Mon, 26 May 2025 12:05:05 +0000 (15:05 +0300)] 
drm/i915/alpm: Write PR_ALPM_CTL register

PR_ALPM_CTL register contains configurations related to Adaptive sync
sdp. Configure these if Adaptive Sync SDP is supported.

v2: avoid using hardcoded indices

Bspec: 71014
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-6-jouni.hogander@intel.com
2 months agodrm/i915/alpm: Add PR_ALPM_CTL register definitions
Jouni Högander [Mon, 26 May 2025 12:05:04 +0000 (15:05 +0300)] 
drm/i915/alpm: Add PR_ALPM_CTL register definitions

Add PR_ALPM_CTL register definition and bits for it.

Bspec: 71014
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-5-jouni.hogander@intel.com
2 months agodrm/i915/psr: Read all Panel Replay capability registers from DPCD
Jouni Högander [Mon, 26 May 2025 12:05:03 +0000 (15:05 +0300)] 
drm/i915/psr: Read all Panel Replay capability registers from DPCD

There are several Panel Replay capability register in DPCD. Read them
all for later use.

v2:
  - avoid using hardcoded indices
  - read all Panel Replay capability registers

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-4-jouni.hogander@intel.com
2 months agodrm/dp: Add Panel Replay capability bits from DP2.1 specification
Jouni Högander [Mon, 26 May 2025 12:05:02 +0000 (15:05 +0300)] 
drm/dp: Add Panel Replay capability bits from DP2.1 specification

Add PANEL REPLAY CAPABILITY register (0xb1) bits.

v3:
  - added DP_DSC_DECODE_CAPABILITY definitions
  - use defined shift instead of hardcoded value
v2: comment about DP2.1 changed as DP2.1a

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-3-jouni.hogander@intel.com
2 months agodrm/panelreplay: Panel Replay capability DPCD register definitions
Jouni Högander [Mon, 26 May 2025 12:05:01 +0000 (15:05 +0300)] 
drm/panelreplay: Panel Replay capability DPCD register definitions

Add new definition for size of Panel Replay DPCD capability registers
area. Rename existing definitions to group capability registers together.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://lore.kernel.org/r/20250526120512.1702815-2-jouni.hogander@intel.com
2 months agodrm/i915: Indicate which pipe lied about its interrupts
Ville Syrjälä [Tue, 13 May 2025 09:28:20 +0000 (12:28 +0300)] 
drm/i915: Indicate which pipe lied about its interrupts

Indicate which pipe signalled the spurious DE PIPE interrupt.
Might help with debugging a bit if we know where the interrupt
is supposedly coming from.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250513092820.18715-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe: stop including intel_display_{core, device}.h from xe_device_types.h
Jani Nikula [Thu, 22 May 2025 09:48:44 +0000 (12:48 +0300)] 
drm/xe: stop including intel_display_{core, device}.h from xe_device_types.h

Make xe->display pointer opaque to most of core xe driver. A few places
now need explicit include of intel_display_core.h.

With this dependency broken, changes in display should cause radically
less recompilation of xe.

Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://lore.kernel.org/r/a12918f4d404e2d6d4e963126ce96df01d5064f3.1747907216.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: stop including display/intel_display_{core, limits}.h from i915_drv.h
Jani Nikula [Thu, 22 May 2025 09:48:43 +0000 (12:48 +0300)] 
drm/i915: stop including display/intel_display_{core, limits}.h from i915_drv.h

Make i915->display pointer opaque to most of core i915 driver. Lots of
places now need explicit include of intel_display_core.h, or a more
specific header.

With this dependency broken, changes in display should cause radically
less recompilation of i915.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://lore.kernel.org/r/b381b59acb7e4f600e0282935a68aedf77768109.1747907216.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/display: allocate struct intel_display dynamically
Jani Nikula [Thu, 22 May 2025 09:48:42 +0000 (12:48 +0300)] 
drm/i915/display: allocate struct intel_display dynamically

Allocate struct intel_display dynamically in
intel_display_device_probe() and free in intel_display_device_remove().

v2: Remove duplicate intel_display_device_remove() on error path (Lucas)

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/8cd526a177061cddf71db59bd0901bd1a24e77be.1747907216.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915: Disable updating of LUT values during vblank
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:41 +0000 (11:50 +0530)] 
drm/i915: Disable updating of LUT values during vblank

Do not schedule vblank worker for LUT update if the registers are
double buffered

v2: Do not schedule the worker at all (Ville)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-12-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/color: Do not pre-load LUTs with DB registers
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:40 +0000 (11:50 +0530)] 
drm/i915/color: Do not pre-load LUTs with DB registers

Since Double Buffered LUT registers can be written in active region
no need to preload them.

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-11-chaitanya.kumar.borah@intel.com
2 months agodrm/i915: Program DB LUT registers before vblank
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:39 +0000 (11:50 +0530)] 
drm/i915: Program DB LUT registers before vblank

Double Buffered LUT registers can be programmed in the active region.
This patch implements the MMIO path for it. Program the registers after
evading vblank. The HW latches on to the registers after delayed vblank.
It takes around 1024 cdclk cycles(~one scanline) for this.

Following assumptions have been made while making this change

 - Current vblank evasion time is sufficient for programming
   the LUT registers.
 - Current guardband calculation would be sufficient for the HW
   to latch on to the new values

v2: move loading LUTs to commit_pipe_post_planes() since a vblank
    evasion failure for this is probably less drastic than
    for plane programming. (Ville)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-10-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/display: use GOSUB to program double buffered LUT registers
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:38 +0000 (11:50 +0530)] 
drm/i915/display: use GOSUB to program double buffered LUT registers

With addition of double buffered GAMMA registers in PTL, we can now
program them in the active region. Use GOSUB instruction of DSB to
program them.

It is done in the following steps:
1. intel_color_prepare_commit()
- If the platform supports, prepare a dsb instance (dsb_color)
  hooked to DSB0.
- Add all the register write instructions to dsb_color through
  the load_lut() hook
                - Do not add the vrr_send_push() logic to the buffer as it
  should be taken care by dsb_commit instance of DSB0
                - Finish preparation of the buffer by aligning it to 64 bit

2. intel_atomic_dsb_finish()
- Add the gosub instruction into the dsb_commit instance of DSB0
  using intel_dsb_gosub()
- If needed, add the vrr_send_push() logic to dsb_commit after it

v2: Refactor code to simplify commit completion flow.
    Add some helpers along the way (Ville)
v3: s/doubled/double and add display to commit message prefix (Uma)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-9-chaitanya.kumar.borah@intel.com
2 months agodrm/i915: s/dsb_color_vblank/dsb_color
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:37 +0000 (11:50 +0530)] 
drm/i915: s/dsb_color_vblank/dsb_color

With double buffer gamma registers in the mix, we need not wait for
vblank to execute gamma writes through dsb. Before we implement
that s/dsb_color_vblank/dsb_color.

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-8-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: Add support for GOSUB interrupt
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:36 +0000 (11:50 +0530)] 
drm/i915/dsb: Add support for GOSUB interrupt

DSB raises an interrupt when there is a nested GOSUB command or
illegal Head/Tail. Add support to log such errors in the DSB
interrupt handler.

v2: Enable support only in platforms that support this (Ville)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-7-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: add intel_dsb_gosub_finish()
Chaitanya Kumar Borah [Fri, 23 May 2025 06:20:35 +0000 (11:50 +0530)] 
drm/i915/dsb: add intel_dsb_gosub_finish()

A DSB buffer which will be used for GOSUB execution does not need
the DEWAKE mechanism but still need to be 64 bit aligned. Add helper
to finish preparation of a dsb buffer to be executed with GOSUB
instruction.

v2: Add a cacheline of noops at the end of GOSUB buffer (Ville)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-6-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: Implement intel_dsb_gosub()
Ville Syrjälä [Fri, 23 May 2025 06:20:34 +0000 (11:50 +0530)] 
drm/i915/dsb: Implement intel_dsb_gosub()

Add support for the new GOSUB DSB instruction (available on ptl+),
which instructs the DSB to jump to a different buffer, execute
the commands there, and then return execution to the next
instruction in the original buffer.

There are a few alignment related workarounds that need to
be dealt with when emitting GOSUB instruction.

v2: Right shift head and tail pointer passed to gosub command (chaitanya)
v3: Add macro for right shifting head/tail pointers (Animesh)
v4: Fix typo in commit message (Uma)
    Add comments explaining why right shifting htp is needed (Animesh)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-5-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: Extract intel_dsb_{head,tail}()
Ville Syrjälä [Fri, 23 May 2025 06:20:33 +0000 (11:50 +0530)] 
drm/i915/dsb: Extract intel_dsb_{head,tail}()

Extract the code that calculates the DSB_HEAD/TAIL register
values into small helpers. We already have two copies of this,
and soon there will be a third.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-4-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: Extract assert_dsb_tail_is_aligned()
Ville Syrjälä [Fri, 23 May 2025 06:20:32 +0000 (11:50 +0530)] 
drm/i915/dsb: Extract assert_dsb_tail_is_aligned()

Extract the DSB tail alignment checks into helper. We already
have two uses of this, and soon we'll get a third.

v2: s/soo/soon in commit message (Animesh)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-3-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/dsb: Extract intel_dsb_ins_align()
Ville Syrjälä [Fri, 23 May 2025 06:20:31 +0000 (11:50 +0530)] 
drm/i915/dsb: Extract intel_dsb_ins_align()

Extract the code that alings the next instruction to the next
QW boundary into a small helper. I'll have some more uses for
this later.

Also explain why we don't have to zero out the extra DW.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-2-chaitanya.kumar.borah@intel.com
2 months agodrm/i915/display: Use str_true_false() helper
Yumeng Fang [Fri, 23 May 2025 06:14:22 +0000 (14:14 +0800)] 
drm/i915/display: Use str_true_false() helper

Remove hard-coded strings by using the str_true_false() helper.

Signed-off-by: Yumeng Fang <fang.yumeng@zte.com.cn>
Signed-off-by: Yunjian Long <long.yunjian@zte.com.cn>
Link: https://lore.kernel.org/r/20250523141422844GEA-yzba-OvN0lZirDsS-@zte.com.cn
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dp: Fix the enabling/disabling of audio SDP splitting
Imre Deak [Tue, 20 May 2025 14:22:19 +0000 (17:22 +0300)] 
drm/i915/dp: Fix the enabling/disabling of audio SDP splitting

Adjust the enabling/disabling steps of the DP audio SDP splitting
according to a recent Bspec update. This moves the enabling to the audio
codec enable sequence after the transcoder is enabled and disables SDP
splitting explicitly during the audio disable sequence.

Bspec requires waiting for a vblank event after the transcoder is
enabled and before SDP splitting is enabled. There is no need for an
explicit wait for this, since after the transcoder is enabled this
vblank event is guaranteed to have happened via a flip done wait (see
intel_atomic_commit_tail() -> drm_atomic_helper_wait_for_flip_done()).

The bspec update is for LNL+ only, but the HW team clarified that this
has been always the intended sequence on all platforms and bspec will be
updated everywhere accordingly.

The way SDP splitting was originally enabled matched the version of
bspec at that time. Adding here the Fixes: line still, since this
change fixes a FIFO underrun on PTL during output enabling when DSC is
enabled.

Bspec: 49283, 68943
Fixes: 8853750dbad8 ("drm/i915: Enable SDP split for DP2.0")
Cc: Vinod Govindapillai <vinod.govindapillai@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250520142219.1688401-1-imre.deak@intel.com
2 months agodrm/xe/display: use xe->display to decide whether to do anything
Jani Nikula [Fri, 16 May 2025 12:17:00 +0000 (15:17 +0300)] 
drm/xe/display: use xe->display to decide whether to do anything

Since we only initialize xe->display when xe->info.probe_display, we can
use !xe->display to bail out early. This seems cleaner and more accurate
than relying on xe->info.probe_display, since xe->display may indeed be
NULL.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/945d2a987214044a81f4816684972961b772b45a.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe/display: add notes about how early a few functions can be called
Jani Nikula [Fri, 16 May 2025 12:16:59 +0000 (15:16 +0300)] 
drm/xe/display: add notes about how early a few functions can be called

xe_display_driver_probe_defer() and xe_display_driver_set_hooks() get
called before either struct xe_device or struct intel_display
exist. Make a note of that.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/937ea1e16e970a6f6944b94c6a9c216d36e728d1.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe/display: move xe->display initialization to xe_display_probe()
Jani Nikula [Fri, 16 May 2025 12:16:58 +0000 (15:16 +0300)] 
drm/xe/display: move xe->display initialization to xe_display_probe()

The future goal is to have intel_display_device_probe() create struct
intel_display. As the first step, postpone xe->display initialization
right before that call. This is the same location as in i915.

There's a subtle functional change here: xe->display will now be
initialized only if xe->info.probe_display.

The xe_display_create() function becomes empty, and can be removed. Move
its documentation to xe_display_probe()

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/6c3075739d84cecea258d686c3ef38455a61191c.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/display: move hotplug.dp_wq init from xe and i915 to display
Jani Nikula [Fri, 16 May 2025 12:16:57 +0000 (15:16 +0300)] 
drm/i915/display: move hotplug.dp_wq init from xe and i915 to display

The workqueue init and destroy belongs in display. Move it.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/4730167548a40dc2abe38cd084809b74de988f1a.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe/display: drop duplicate display->fb_tracking.lock init
Jani Nikula [Fri, 16 May 2025 12:16:56 +0000 (15:16 +0300)] 
drm/xe/display: drop duplicate display->fb_tracking.lock init

The spinlock is initialized in intel_display_driver_early_probe(). Drop
the extra init.

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/f895a8a43c61a6e60db8e1eb698919ce0faab27c.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/xe/display: Add check for alloc_ordered_workqueue()
Haoxiang Li [Fri, 16 May 2025 12:16:55 +0000 (15:16 +0300)] 
drm/xe/display: Add check for alloc_ordered_workqueue()

Add check for the return value of alloc_ordered_workqueue()
in xe_display_create() to catch potential exception.

Fixes: 44e694958b95 ("drm/xe/display: Implement display support")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/4ee1b0e5d1626ce1dde2e82af05c2edaed50c3aa.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/display: Add check for alloc_ordered_workqueue() and alloc_workqueue()
Haoxiang Li [Fri, 16 May 2025 12:16:54 +0000 (15:16 +0300)] 
drm/i915/display: Add check for alloc_ordered_workqueue() and alloc_workqueue()

Add check for the return value of alloc_ordered_workqueue()
and alloc_workqueue(). Furthermore, if some allocations fail,
cleanup works are added to avoid potential memory leak problem.

Fixes: 40053823baad ("drm/i915/display: move modeset probe/remove functions to intel_display_driver.c")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20d3d096c6a4907636f8a1389b3b4dd753ca356e.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dp_mst: Work around Thunderbolt sink disconnect after SINK_COUNT_ESI read
Imre Deak [Mon, 19 May 2025 13:34:17 +0000 (16:34 +0300)] 
drm/i915/dp_mst: Work around Thunderbolt sink disconnect after SINK_COUNT_ESI read

Due to a problem in the iTBT DP-in adapter's firmware the sink on a TBT
link may get disconnected inadvertently if the SINK_COUNT_ESI and the
DP_LINK_SERVICE_IRQ_VECTOR_ESI0 registers are read in a single AUX
transaction. Work around the issue by reading these registers in
separate transactions.

The issue affects MTL+ platforms and will be fixed in the DP-in adapter
firmware, however releasing that firmware fix may take some time and is
not guaranteed to be available for all systems. Based on this apply the
workaround on affected platforms.

See HSD #13013007775.

v2: Cc'ing Mika Westerberg.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13760
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14147
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250519133417.1469181-1-imre.deak@intel.com
2 months agodrm/i915/dpll: Rename intel_update_active_dpll
Suraj Kandpal [Thu, 15 May 2025 07:18:01 +0000 (12:48 +0530)] 
drm/i915/dpll: Rename intel_update_active_dpll

Rename intel_update_active_dpll to intel_dpll_update_active in an
effort to have function names which are exported to start with
filenames they are exported from.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-15-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_compute_dpll
Suraj Kandpal [Thu, 15 May 2025 07:18:00 +0000 (12:48 +0530)] 
drm/i915/dpll: Rename intel_compute_dpll

Rename intel_compute_dpll to intel_dpll_compute in an
effort to make sure all function names that are exported have
the filename at start.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-14-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_<release/reserve>_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:59 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_<release/reserve>_dpll

Rename intel_<release/reserve>_dpll to
intel_dpll_<release/reserve> in an effort to keep names of
exported functions start with the filename.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-13-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_reference_dpll_crtc
Suraj Kandpal [Thu, 15 May 2025 07:17:58 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_reference_dpll_crtc

Rename intel_reference_dpll_crtc to intel_dpll_crtc_get in an
effort to have all the exported functions have the name start
with file name.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-12-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_unreference_dpll_crtc
Suraj Kandpal [Thu, 15 May 2025 07:17:57 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_unreference_dpll_crtc

Rename intel_unreference_dpll_crtc to intel_dpll_crtc_put
in an effort to keep names of exported functions start with the filename.

--v2
-Make the new name more sensible [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-11-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_[enable/disable]_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:56 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_[enable/disable]_dpll

Rename  intel_[enable/disable]_dpll to intel_dpll_[enable/disable]
in an effort to make sure all functions that are exported
start with the filename.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-10-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename crtc_get_shared_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:55 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename crtc_get_shared_dpll

Rename crtc_get_shared_dpll to take into the individual PLL framework
which came in at DISPLAY_VER >= 14.
Also having shared dpll stuff also in intel_dpll.c is just confusing.

--v2
-Change naming to dpll_global to keep consistency with rest of the
naming

--v3
-Just use intel_dpll [Jani]

--v4
-Modify commit message [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-9-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Move away from using shared dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:54 +0000 (12:47 +0530)] 
drm/i915/dpll: Move away from using shared dpll

Rename functions to move away from using shared dpll in the dpll
framework as much as possible since dpll may not always be shared.

--v2
-Use intel_dpll_global instead of global_dpll [Jani]

--v3
-Just use intel_dpll [Jani]

--v4
-Drop the global from comments [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-8-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_shared_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:53 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_shared_dpll

Rename intel_shared_dpll to intel_dpll to represent both
shared and individual dplls. Since from MTL each PHY has it's
own PLL making the shared PLL naming a little outdated. In an
effort to make this framework accepting of future changes this
needs to be done.

--v2
-Use intel_dpll_global to make sure names start with the filename
[Jani/Ville]
-Explain the need of this rename [Jani]

--v3
-Just keep it intel_dpll [Jani]

--v4
-Fix comment [Jani]
-Use just num_dpll and dplls [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-7-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_shared_dpll_funcs
Suraj Kandpal [Thu, 15 May 2025 07:17:52 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_shared_dpll_funcs

Rename intel_shared_dpll_funcs to intel_dpll_funcs
since it needs to represent both shared and individual
dplls.

--v2
-Change intel_global_dpll to intel_dpll_global to be more
in line with the naming standard where the name should
start with the file name [Jani]

--v3
-Drop shared and global altogether [Jani]

--v4
-Keep declarations sorted [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-6-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename macro for_each_shared_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:51 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename macro for_each_shared_dpll

Rename the macro for_each_shared_dpll to for_each_dpll since
this loop will not necessarily be used for only shared
dpll in future.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-5-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_shared_dpll_state
Suraj Kandpal [Thu, 15 May 2025 07:17:50 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_shared_dpll_state

Rename intel_shared_dpll_state to just intel_dpll_state since it may
not necessarily store share dpll state info specially since
DISPLAY_VER >= 14 PLL's are not shared.
Also change the name of variables which may have been associated as
a shared_dpll.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-4-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_dpll_funcs
Suraj Kandpal [Thu, 15 May 2025 07:17:49 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_dpll_funcs

Rename intel_dpll_funcs to intel_dpll_global_funcs so that later
on intel_shared_dpll_funcs can be renamed to intel_dpll_funcs.
This is done to move away from the shared naming convention since
starting MTL dpll's are not shared among PHYs.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-3-suraj.kandpal@intel.com
2 months agodrm/i915/dpll: Rename intel_dpll
Suraj Kandpal [Thu, 15 May 2025 07:17:48 +0000 (12:47 +0530)] 
drm/i915/dpll: Rename intel_dpll

Rename intel_dpll to intel_dpll_global so that intel_shared_dpll
can be renamed to intel_dpll in an effort to move away from the shared
naming convention.
Also intel_dpll according to it's comment tracks global dpll rather
than individual hence making more sense this gets changed.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250515071801.2221120-2-suraj.kandpal@intel.com
2 months agodrm/i915/vrr: Program EMP_AS_SDP_TL for DP AS SDP
Ankit Nautiyal [Mon, 5 May 2025 03:39:11 +0000 (09:09 +0530)] 
drm/i915/vrr: Program EMP_AS_SDP_TL for DP AS SDP

The register EMP_AS_SDP_TL (MTL) was introduced for configuring the
double buffering point and transmission line for all
HDMI2.1 Extended Metadata Packets (VT-EMP for VRR, CVT-EMP for DSC etc).
This was also intended to be configured for DP to HDMI2.1 PCON to
support VRR.

From BMG and LNL+ onwards, this register was extended to Display Port
Adaptive Sync SDP to have a common register to configure double
buffering point and transmission line for both HDMI EMPs and DP VRR related
packets.

Currently, we do not support VRR for either native HDMI or via PCON.
However we need to configure this for DP SDP case. As per the spec,
program the register to set Vsync start as the double buffering point
for DP AS SDP.

v2:
-Make the helper more readable. (Jani)
-Add more information in commit message and comment.

Bspec:70984, 71197
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Tested-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/20250505033911.393628-1-ankit.k.nautiyal@intel.com
2 months agodrm/i915/psr: Do not read PSR2_SU_STATUS on AlderLake and onwards
Jouni Högander [Fri, 16 May 2025 06:30:19 +0000 (09:30 +0300)] 
drm/i915/psr: Do not read PSR2_SU_STATUS on AlderLake and onwards

Bspec comment on PSR2_SU_STATUS:

"This register has been tied-off since DG2/ADL-P (it returns zeros only)
and it has been removed on Xe2_LPD."

v2: fix inversed logic

Bspec: 69889
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250516063019.2126702-1-jouni.hogander@intel.com
2 months agodrm/i915/dsi: Enforce pipeline flush with DSI HS transfer
Gareth Yu [Fri, 9 May 2025 09:25:39 +0000 (17:25 +0800)] 
drm/i915/dsi: Enforce pipeline flush with DSI HS transfer

With all of the boundary conditions when streaming the commands B2B in our
validation (part of the reason we added the flush),  the Flush effectively
serializes the transmission of each command enqueued within the command
dispatcher to one per V. Blank line which simplifies the behavior of the
High Speed Arbitration.

So, unless we absolutely have to burst these to the Sink, we should be
using the Pipeline Flush bit to serialize the commands.

Bspec: 19742, 50193
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14247
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Gareth Yu <gareth.yu@intel.com>
Link: https://lore.kernel.org/r/20250509092539.763389-1-gareth.yu@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/dmc: Introduce dmc_configure_event()
Ville Syrjälä [Mon, 12 May 2025 10:33:58 +0000 (13:33 +0300)] 
drm/i915/dmc: Introduce dmc_configure_event()

Instead of hardcoding the event handler indices (for runtime
event handler enable/disable) we can simply look for the handler
with the appropriate event type. This isolates us from the firmware
details a bit better.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-8-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
2 months agodrm/i915/dmc: Extract is_event_handler()
Ville Syrjälä [Mon, 12 May 2025 10:33:57 +0000 (13:33 +0300)] 
drm/i915/dmc: Extract is_event_handler()

Extract the helper to determine if the mmio reg+data are the
event handler register (DMC_EVT_CTL) for a specific event.
We'll have another use for this for runtime event handler
enable/disable.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-7-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
2 months agodrm/i915/dmc: Relocate is_dmc_evt_{ctl,htp}_reg()
Ville Syrjälä [Mon, 12 May 2025 10:33:56 +0000 (13:33 +0300)] 
drm/i915/dmc: Relocate is_dmc_evt_{ctl,htp}_reg()

Move is_dmc_evt_ctl_reg() to a slightly earlier position in the file
so that we can reuse it in the pkgc workaround code. Also move
is_dmc_evt_htp_reg() just to keep the two together.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-6-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
2 months agodrm/i915/dmc: Extract dmc_evt_ctl_disable()
Ville Syrjälä [Mon, 12 May 2025 10:33:55 +0000 (13:33 +0300)] 
drm/i915/dmc: Extract dmc_evt_ctl_disable()

We have two copies of the code to generate the "disable this event"
value for the DMC_EVT_CTL registers. Extract to a helper.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-5-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coeho@intel.com>
2 months agodrm/i915/dmc: Define all DMC event IDs
Ville Syrjälä [Mon, 12 May 2025 10:33:54 +0000 (13:33 +0300)] 
drm/i915/dmc: Define all DMC event IDs

Define all the DMC event IDs to make life less misrable when
having to deal with these.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-4-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
2 months agodrm/i915/dmc: Hook up PIPEDMC interrupts
Ville Syrjälä [Wed, 14 May 2025 17:42:57 +0000 (20:42 +0300)] 
drm/i915/dmc: Hook up PIPEDMC interrupts

Hook up PIPEDMC interrupts. We'll need these for:
- flip queue signalling
- GTT/ATS faults on LNL+
- unclaimed register access errors (supposedly that is what
  the error interrupt indicated according to Windows code).

On LNL+ we get a new level of interrupts registers PIPEDMC_INTERRUPT*.
On earlier platforms we only have the INT_VECTOR field in the
PIPEDMC_STATUS registers, whose values are defined by the firmware.

For now we'll enable the interrupts on LNL+ only. For earlier platforms
it's not clear that there is any use for these interrupts, and some
ADL machines have exhibited spurious DE_PIPE interrupts with the
PIPEDMC interrupts unmasked/enabled. We can revisit enabling these
for earlier platforms in the future.

For some unknown reason LNL pipe B triggers the error interrupt
during the first DC state transition (subsequent transitions are
maybe OK?). No clear idea what's going on here yet, so keep the
error interrupt disabled for now.

Similar to DSB interrupt registers, the unused bits in
PIPEDMC_INTERRUPT* seem to act like randomg r/w bits (instead
of being hardwired to 0 like one would expect), and so we'll try
to avoid setting them so that we don't mistake them for real
interrupts.

v2: Only enable/unmask for LNL+
    Keep the flip queue interrupt masked off for now since
    we don't have a use for it yet
v3: Also keep the error interrupt masked off for now due to
    LNL pipe B triggering it

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250514174257.8708-1-ville.syrjala@linux.intel.com
2 months agodrm/i915/dmc: Drop PIPEDMC faults from the fault mask on LNL+
Ville Syrjälä [Mon, 12 May 2025 10:33:52 +0000 (13:33 +0300)] 
drm/i915/dmc: Drop PIPEDMC faults from the fault mask on LNL+

On LNL+ PIPEDMC faults are reported via PIPEDMC interrupts
instead of the direct DE_PIPE_* reporting used on earlier
platforms. Drop the relevant bits from the fault mask.

The bits are tied to zero on LNL, so there is no danger of
spurious fault interrupts even with an incorrect mask.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250512103358.15724-2-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
2 months agodrm/{i915,xe}: convert i915 and xe display members into pointers
Jani Nikula [Wed, 7 May 2025 15:22:54 +0000 (18:22 +0300)] 
drm/{i915,xe}: convert i915 and xe display members into pointers

As the first step towards making struct intel_display an opaque pointer
in i915 and xe drivers, convert the struct drm_i915_private and struct
xe_device display members into pointers.

Initially, add temporary struct intel_display __display members, and
point display at it to avoid dynamic allocation. In the future, we can
drop this, and switch to dynamic allocation.

The conversion is done simply with sed:

sed -i 's/&\([a-zA-Z0-9_>.-]*\)\(dev_priv\|i915\|xe\)->display\([^.]\)/\1\2->display\3/g' \
    $(git ls-files -- drivers/gpu/drm/i915 drivers/gpu/drm/xe)

sed -i 's/\(dev_priv\|i915\|xe\)->display\./\1->display->/g' \
    $(git ls-files -- drivers/gpu/drm/i915 drivers/gpu/drm/xe)

With a couple of manual tweaks on top.

v2: Initialize i915->display also in selftest mock_gem_device()

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250507152254.2398934-1-jani.nikula@intel.com
2 months agodrm/i915: do not reference i915->display inline
Jani Nikula [Wed, 7 May 2025 09:38:35 +0000 (12:38 +0300)] 
drm/i915: do not reference i915->display inline

Always use a local variable for display instead of referencing
i915->display inline. This makes it easier to convert i915->display into
a pointer.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/afcf305e8c4ea452cee37479530958f36a10c840.1746610601.git.jani.nikula@intel.com
2 months agodrm/xe/display: do not reference xe->display inline
Jani Nikula [Wed, 7 May 2025 09:38:34 +0000 (12:38 +0300)] 
drm/xe/display: do not reference xe->display inline

Always use a local variable for display instead of referencing
xe->display inline. This makes it easier to convert xe->display into a
pointer.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/c99483ad86022d02f780bac73445baaf27a6edce.1746610601.git.jani.nikula@intel.com
2 months agodrm/xe/rpm: use to_xe_device() instead of container_of
Jani Nikula [Wed, 7 May 2025 09:38:33 +0000 (12:38 +0300)] 
drm/xe/rpm: use to_xe_device() instead of container_of

Drop the dependency on display being a sub-struct of xe_device.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/3528f2cd5965e97248c161b8aa25a9df69606a39.1746610601.git.jani.nikula@intel.com
2 months agoMerge drm/drm-next into drm-intel-next
Jani Nikula [Fri, 16 May 2025 07:22:36 +0000 (10:22 +0300)] 
Merge drm/drm-next into drm-intel-next

Backmerge to sync with v6.15-rc, xe, and specifically async flip changes
in drm-misc.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agoMerge tag 'drm-intel-next-fixes-2025-05-15' of https://gitlab.freedesktop.org/drm...
Dave Airlie [Fri, 16 May 2025 00:44:43 +0000 (10:44 +1000)] 
Merge tag 'drm-intel-next-fixes-2025-05-15' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

- Stop writing ALPM registers when PSR is enabled
- Use the correct connector while computing the link BPP limit on MST

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://lore.kernel.org/r/aCWlWk5rTE7TH1pN@jlahtine-mobl
2 months agoMerge tag 'mediatek-drm-next-20250515' of https://git.kernel.org/pub/scm/linux/kernel...
Dave Airlie [Thu, 15 May 2025 21:29:33 +0000 (07:29 +1000)] 
Merge tag 'mediatek-drm-next-20250515' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next

Mediatek DRM Next - 20250515

1. Prepare for support MT8195/88 HDMIv2 and DDCv2
2. DPI: Cleanups and add support for more formats
3. Cleanups and sanitization
4. Replace custom compare_dev with component_compare_of

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/20250514233647.15907-1-chunkuang.hu@kernel.org
2 months agoMerge tag 'drm-misc-next-2025-05-12' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Thu, 15 May 2025 03:17:01 +0000 (13:17 +1000)] 
Merge tag 'drm-misc-next-2025-05-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for v6.16-rc1:

Once more, with async flips.

UAPI Changes:
- Add IN_FORMATS_ASYNC property, use in i915.

Cross-subsystem Changes:
- Remove some unused debug code in dma-buf.

Core Changes:

Driver Changes:
- Add Novatek NT37801 panel.
- Allow submitting empty commands in amdxdna.
- Convert cirrus to use managed request_all_regions.
- Move Sitronix from tiny to their own place.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://lore.kernel.org/r/23ded62c-6a62-4195-9c08-4dfb81eafd72@linux.intel.com
2 months agodrm/mediatek: Replace custom compare_dev with component_compare_of
Tang Dongxing [Thu, 3 Apr 2025 07:54:19 +0000 (15:54 +0800)] 
drm/mediatek: Replace custom compare_dev with component_compare_of

Remove the custom device comparison function compare_dev and replace it
with the existing kernel helper component_compare_of

Signed-off-by: Tang Dongxing <tang.dongxing@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250403155419406T5YhIJKId1FWor70EWWHG@zte.com.cn/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
2 months agodrm/mediatek: mtk_drm_drv: Unbind secondary mmsys components on err
AngeloGioacchino Del Regno [Thu, 3 Apr 2025 10:47:39 +0000 (12:47 +0200)] 
drm/mediatek: mtk_drm_drv: Unbind secondary mmsys components on err

When calling component_bind_all(), if a component that is included
in the list fails, all of those that have been successfully bound
will be unbound, but this driver has two components lists for two
actual devices, as in, each mmsys instance has its own components
list.

In case mmsys0 (or actually vdosys0) is able to bind all of its
components, but the secondary one fails, all of the components of
the first are kept bound, while the ones of mmsys1/vdosys1 are
correctly cleaned up.

This is not right because, in case of a failure, the components
are re-bound for all of the mmsys/vdosys instances without caring
about the ones that were previously left in a bound state.

Fix that by calling component_unbind_all() on all of the previous
component masters that succeeded binding all subdevices when any
of the other masters errors out.

Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250403104741.71045-4-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
2 months agodrm/mediatek: Fix kobject put for component sub-drivers
AngeloGioacchino Del Regno [Thu, 3 Apr 2025 10:47:38 +0000 (12:47 +0200)] 
drm/mediatek: Fix kobject put for component sub-drivers

In function mtk_drm_get_all_drm_priv(), this driver is incrementing
the refcount for the sub-drivers of mediatek-drm with a call to
device_find_child() when taking a reference to all of those child
devices.

When the component bind fails multiple times this results in a
refcount_t overflow, as the reference count is never decremented:
fix that by adding a call to put_device() for all of the mmsys
devices in a loop, in error cases of mtk_drm_bind() and in the
mtk_drm_unbind() callback.

Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250403104741.71045-3-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
2 months agodrm/mediatek: mtk_drm_drv: Fix kobject put for mtk_mutex device ptr
AngeloGioacchino Del Regno [Thu, 3 Apr 2025 10:47:37 +0000 (12:47 +0200)] 
drm/mediatek: mtk_drm_drv: Fix kobject put for mtk_mutex device ptr

This driver is taking a kobject for mtk_mutex only once per mmsys
device for each drm-mediatek driver instance, differently from the
behavior with other components, but it is decrementing the kobj's
refcount in a loop and once per mmsys: this is not right and will
result in a refcount_t underflow warning when mediatek-drm returns
multiple probe deferrals in one boot (or when manually bound and
unbound).

Besides that, the refcount for mutex_dev was not decremented for
error cases in mtk_drm_bind(), causing another refcount_t warning
but this time for overflow, when the failure happens not during
driver bind but during component bind.

In order to fix one of the reasons why this is happening, remove
the put_device(xx->mutex_dev) loop from the mtk_drm_kms_init()'s
put_mutex_dev label (and drop the label) and add a single call to
correctly free the single incremented refcount of mutex_dev to
the mtk_drm_unbind() function to fix the refcount_t underflow.

Moreover, add the same call to the error cases in mtk_drm_bind()
to fix the refcount_t overflow.

Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250403104741.71045-2-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
2 months agodrm/i915/ptl: Use everywhere the correct DDI port clock select mask
Imre Deak [Mon, 12 May 2025 14:26:00 +0000 (17:26 +0300)] 
drm/i915/ptl: Use everywhere the correct DDI port clock select mask

The PTL XELPDP_PORT_CLOCK_CTL register XELPDP_DDI_CLOCK_SELECT field's
size is 5 bits vs. the earlier platforms where its size is 4 bits. Make
sure the field is read-out/programmed everywhere correctly, according to
the above.

Cc: Mika Kahola <mika.kahola@intel.com>
Cc: stable@vger.kernel.org # v6.13+
Tested-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250512142600.824347-1-imre.deak@intel.com
2 months agodrm/i915/alpm: Stop writing ALPM registers when PSR is enabled
Jouni Högander [Tue, 13 May 2025 05:48:14 +0000 (08:48 +0300)] 
drm/i915/alpm: Stop writing ALPM registers when PSR is enabled

Currently we are seeing these on PTL:

xe 0000:00:02.0: [drm] *ERROR* Timeout waiting for DDI BUF A to get active

These seem to be caused by writing ALPM registers while Panel Replay is
enabled.

Fix this by writing ALPM registers only when Panel Replay is about to be
enabled.

v4: improve comment on intel_psr_panel_replay_enable_sink call
v3: enable/disable ALPM from PSR code

Fixes: 172757acd6f6 ("drm/i915/lobf: Add lobf enablement in post plane update")
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250513054814.3702977-3-jouni.hogander@intel.com
(cherry picked from commit a8eb102ce0944a9de2a62aa9d195861b7f26668a)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2 months agodrm/i915/alpm: Make intel_alpm_enable_sink available for PSR
Jouni Högander [Tue, 13 May 2025 05:48:13 +0000 (08:48 +0300)] 
drm/i915/alpm: Make intel_alpm_enable_sink available for PSR

We want to enable sink ALPM from PSR code. Make intel_alpm_enable_sink
available for PSR.

v2: do not add kerneldoc comments

Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/20250513054814.3702977-2-jouni.hogander@intel.com
(cherry picked from commit 2d278488761f0b5be651a3db41e615a964123d6c)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2 months agodrm/i915/display: drop unnecessary includes on i915 core headers
Jani Nikula [Tue, 13 May 2025 09:28:45 +0000 (12:28 +0300)] 
drm/i915/display: drop unnecessary includes on i915 core headers

These includes have become unnecessary. Drop them.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/6ca3be3e3fbbd99c169345c3add4b76315390e77.1747128495.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/gem: drop intel_display.h include
Jani Nikula [Tue, 13 May 2025 09:28:44 +0000 (12:28 +0300)] 
drm/i915/gem: drop intel_display.h include

The include is not needed since commit 44a34dec43e8 ("drm/i915:
Calculate the VT-d guard size in the display code").

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/80ea203e004b7378c14f2367258b5785e40bf126.1747128495.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/display: drop unused declarations from intel_display.h
Jani Nikula [Tue, 13 May 2025 09:28:43 +0000 (12:28 +0300)] 
drm/i915/display: drop unused declarations from intel_display.h

We've accumulated lots of forward declarations in intel_display.h that
are no longer necessary. Clean them up.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/5ad046b74040e84fab51786c346ff9a445e351bc.1747128495.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/rps: pass struct intel_display to DISPLAY_VER()
Jani Nikula [Tue, 13 May 2025 09:28:42 +0000 (12:28 +0300)] 
drm/i915/rps: pass struct intel_display to DISPLAY_VER()

Avoid passing drm_i915_private to DISPLAY_VER().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/5e97ee7675b32397163eb4fba17184fc1c5a04cd.1747128495.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/pps: drop dependency on intel_display_conversion.h
Jani Nikula [Tue, 13 May 2025 09:28:41 +0000 (12:28 +0300)] 
drm/i915/pps: drop dependency on intel_display_conversion.h

All the PPS register users have been converted to struct
intel_display. The backward compat conversion to struct drm_i915_private
is no longer needed. Drop it, along with the include, and convert the
dev_priv macro parameter names to display while at it.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/4c23fd8dfcadefeeb52189045421084bcfd50d57.1747128495.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 months agodrm/i915/alpm: Stop writing ALPM registers when PSR is enabled
Jouni Högander [Tue, 13 May 2025 05:48:14 +0000 (08:48 +0300)] 
drm/i915/alpm: Stop writing ALPM registers when PSR is enabled

Currently we are seeing these on PTL:

xe 0000:00:02.0: [drm] *ERROR* Timeout waiting for DDI BUF A to get active

These seem to be caused by writing ALPM registers while Panel Replay is
enabled.

Fix this by writing ALPM registers only when Panel Replay is about to be
enabled.

v4: improve comment on intel_psr_panel_replay_enable_sink call
v3: enable/disable ALPM from PSR code

Fixes: 172757acd6f6 ("drm/i915/lobf: Add lobf enablement in post plane update")
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250513054814.3702977-3-jouni.hogander@intel.com
2 months agodrm/i915/alpm: Make intel_alpm_enable_sink available for PSR
Jouni Högander [Tue, 13 May 2025 05:48:13 +0000 (08:48 +0300)] 
drm/i915/alpm: Make intel_alpm_enable_sink available for PSR

We want to enable sink ALPM from PSR code. Make intel_alpm_enable_sink
available for PSR.

v2: do not add kerneldoc comments

Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/20250513054814.3702977-2-jouni.hogander@intel.com