linux-2.6-microblaze.git
8 months agodrm/i915/hdcp: Retry first read and writes to downstream
Suraj Kandpal [Fri, 27 Sep 2024 06:04:37 +0000 (11:34 +0530)]
drm/i915/hdcp: Retry first read and writes to downstream

Retry the first read and write to downstream at least 10 times
with a 50ms delay if not hdcp2 capable(dock decides to stop advertising
hdcp2 capability for some reason). The reason being that
during suspend resume Dock usually keep the HDCP2 registers inaccesible
causing AUX error. This wouldn't be a big problem if the userspace
just kept retrying with some delay while it continues to play low
values content but most userpace applications end up throwing an error
when it receives one from KMD. This makes sure we give the dock
and the sink devices to complete its power cycle and then try HDCP
authentication.

--v2
-Add more details in comment [Jani]
-fix looping condition [Jani]
-optimize loop exit condition [Jani]

--v3
-Add comment explaining why the loop was added [Ankit]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240927060437.1422942-2-suraj.kandpal@intel.com
8 months agodrm/i915/vdsc: Add bpc check in intel_dsc_compute_params
Suraj Kandpal [Thu, 26 Sep 2024 08:13:28 +0000 (13:43 +0530)]
drm/i915/vdsc: Add bpc check in intel_dsc_compute_params

DSC does not support bpc under 8 according to DSC 1.2a Section 2
Requirements. Return an error if that happens to be the case.

--v2
-should be bit_per_component [Mitul/Chaitanya]
-Add reference to this restriction [Chaitanya]

--v3
-Add the bpc in which we see this warning [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240926081327.1409518-2-suraj.kandpal@intel.com
8 months agodrm/i915/hotplug: Add comment for XE_LPD+ SHPD_FILTER_CNT value
Suraj Kandpal [Mon, 23 Sep 2024 03:10:08 +0000 (08:40 +0530)]
drm/i915/hotplug: Add comment for XE_LPD+ SHPD_FILTER_CNT value

Add the reason for having SHPD_FILTER_CNT value for XE_LPD+ and
above as 250us instead of 500us.

--v2
-Update commit message [Matt]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923031007.1058072-4-suraj.kandpal@intel.com
8 months agodrm/i915/hotplug: Reduce SHPD_FLITER_CNT for ICL and above
Suraj Kandpal [Tue, 24 Sep 2024 07:34:51 +0000 (13:04 +0530)]
drm/i915/hotplug: Reduce SHPD_FLITER_CNT for ICL and above

Reduce SHPD_CNT to 250us for ICL and above as it lines up
with DP1.4a(Table3-4) spec.

--v2
-Update commit message and comment [Matt]

--v3
-drop condition and use value of 250us for ICL and above [Matt]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240924073450.1261535-2-suraj.kandpal@intel.com
8 months agodrm/i915: Set clear color block size to 0x0
Ville Syrjälä [Wed, 18 Sep 2024 14:44:39 +0000 (17:44 +0300)]
drm/i915: Set clear color block size to 0x0

We don't use the block size information for the clear color
plane. Technically the entire fb is the single block for the
single 64B clear color surface, so there is just no way to
delcare that as a constant since the fb size can be anything.

Define the clear color block size as 0x0 to make things less
confusing. We already declared that cpp/chars_per_block=0 for
the clear color as well. That also causes the drm core code
to mostly ignore the clear color plane, which is exactly
what we want since that code doesn't know how to deal with
the clear color plane.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918144445.5716-2-ville.syrjala@linux.intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
8 months agodrm/i915: Rename variables in ilk_intermedidate_wm()
Ville Syrjälä [Mon, 16 Sep 2024 16:24:13 +0000 (19:24 +0300)]
drm/i915: Rename variables in ilk_intermedidate_wm()

ilk_compute_intermediate_wm() uses rather poor variable names
for its watermark structs. Borrow a better naming convention
from the g4x/vlv counterpart code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-8-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915: s/disable_lp_wm/disable_cxsr/
Ville Syrjälä [Mon, 16 Sep 2024 16:24:12 +0000 (19:24 +0300)]
drm/i915: s/disable_lp_wm/disable_cxsr/

The ilk+ disable_lp_wm boolean has the exact same role as
disable_cxsr for gmch platforms. The documentation also
still talks about CxSR on ilk+ even theough the way you
control it has now change to involve toggling the LP watermarks.
Get rid of disable_lp_wm and just use disable_cxsr for ilk+
as well.

TODO: Unify even more to not have any gmch vs. ilk+
      details in high level modeset code...

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-7-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915: Move the dodgy pre-g4x wm stuff into i9xx_wm
Ville Syrjälä [Mon, 16 Sep 2024 16:24:11 +0000 (19:24 +0300)]
drm/i915: Move the dodgy pre-g4x wm stuff into i9xx_wm

As with other watermark calculations, the dodgy pre-g4x
update_wm_{pre,post} flag calcultion would like to know
if a modeset is about to happen or not, and technically
later stages in the atomic_check() may still flag one.
In practice that shouldn't happen as we don't have dynamic
CDCLK implemented for these old platforms.

Regardless it'll be nice to move this old cruft out from
the supposedly platform agnostic plane code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-6-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915: Clean up intel_wm_need_update()
Ville Syrjälä [Mon, 16 Sep 2024 16:24:10 +0000 (19:24 +0300)]
drm/i915: Clean up intel_wm_need_update()

intel_wm_need_update() is a mess when it comes to variable
names and constness. The checks also keep alternating randomly
between 'old != cur' vs. 'cur != old'. Clean it all up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-5-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915: Extract ilk_must_disable_lp_wm()
Ville Syrjälä [Mon, 16 Sep 2024 16:24:09 +0000 (19:24 +0300)]
drm/i915: Extract ilk_must_disable_lp_wm()

Pull the ilk/snb/ivb LP watermark disable checks into a separate
function similar to the gmch counterpart (i9xx_must_disable_cxsr()).
Reduces the clutter in intel_plane_atomic_calc_changes() significantly.

Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-4-ville.syrjala@linux.intel.com
8 months agodrm/i915: Combine .compute_{pipe,intermediate}_wm() into one
Ville Syrjälä [Mon, 16 Sep 2024 16:24:08 +0000 (19:24 +0300)]
drm/i915: Combine .compute_{pipe,intermediate}_wm() into one

We always call .compute_pipe_wm() and .compute_intermediate_wm()
back to back. Just combine them to a single hook for simplicity.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-3-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915: Remove leftover intel_sprite_set_colorkey_ioctl() prototype
Ville Syrjälä [Mon, 16 Sep 2024 16:24:07 +0000 (19:24 +0300)]
drm/i915: Remove leftover intel_sprite_set_colorkey_ioctl() prototype

intel_sprite_set_colorkey_ioctl() lives in intel_sprice_uapi.{c,h}
these days. For some reason the old protoype was left behind
in intel_sprite.h and even used by i915_driver.c. Remove the
leftovers and switch to including the correct header for the
prototype.

v2: Drop more unnecessary forward declarations

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-2-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
8 months agodrm/i915/psr: Implement WA to help reach PC10
Suraj Kandpal [Fri, 20 Sep 2024 09:12:04 +0000 (14:42 +0530)]
drm/i915/psr: Implement WA to help reach PC10

To reach PC10 when PKG_C_LATENCY is configure we must do the following
things
1) Enter PSR1 only when delayed_vblank < 6 lines and DC5 can be entered
2) Allow PSR2 deep sleep when DC5 can be entered
3) DC5 can be entered when all transocoder have either PSR1, PSR2 or
eDP 1.5 PR ALPM enabled and VBI is disabled and flips and pushes are
not happening.

--v2
-Switch condition and do an early return [Jani]
-Do some checks in compute_config [Jani]
-Do not use register reads as a method of checking states for
DPKGC or delayed vblank [Jani]
-Use another way to see is vblank interrupts are disabled or not [Jani]

--v3
-Use has_psr to check if psr can be enabled or not for dc5_entry cond
[Uma]
-Move the dc5 entry computation to psr_compute_config [Jouni]
-No need to change sequence of enabled and activate,
so dont make hsw_psr1_activate return anything [Jouni]
-Use has_psr to stop psr1 activation [Jouni]
-Use lineage no. in WA
-Add the display ver restrictions for WA

--v4
-use more appropriate name for check_vblank_limit() [Jouni]
-Cover the case for idle frames when dpkgc is not configured [Jouni]
-Check psr only for edp [Jouni]

--v5
-move psr1 handling to plane update [Jouni]
-add todo for cases when vblank is enabled when psr enabled [Jouni]
-use intel_display instead of drm_i915_private

--v6
-check target_dc_state [Jouni]
-fix condition in pre/post plane update [Jouni]

--v7
-fix has_psr condition [Uma]
-fix typo in commit subject [Uma]
-put psr1_wa check in its own helper [Uma]
-fix the dc_entry check [Jouni]
-use HAS_PSR() to cover two edp one with psr and one nonpsr [Jouni]

WA: 22019444797
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920091203.1043308-2-suraj.kandpal@intel.com
8 months agodrm/i915/pps: split intel_pps_reset_all() to vlv and bxt variants
Jani Nikula [Thu, 19 Sep 2024 09:04:27 +0000 (12:04 +0300)]
drm/i915/pps: split intel_pps_reset_all() to vlv and bxt variants

The intel_pps_reset_all() function does similar but not quite the same
things for VLV/CHV and BXT/GLK. Observe that it's called from platform
specific code only, and a split to two functions vlv_pps_reset_all() and
bxt_pps_reset_all() is natural.

Remove the platform checks and warnings from the functions. We don't
usually have them, unless we're unsure. To make this easier to reason
about for BXT/GLK, change the condition on caller side from "!PCH" to
"BXT || GLK".

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240919090427.1859032-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/quirks: make intel_dpcd_quirks const
Jani Nikula [Thu, 19 Sep 2024 15:33:54 +0000 (18:33 +0300)]
drm/i915/quirks: make intel_dpcd_quirks const

The array can be in rodate, make it const.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240919153354.1269295-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: add intel_dp_test_reset() and intel_dp_test_short_pulse()
Jani Nikula [Fri, 20 Sep 2024 11:56:51 +0000 (14:56 +0300)]
drm/i915/dp: add intel_dp_test_reset() and intel_dp_test_short_pulse()

Abstract more DP test stuff. Now the only place touching
intel_dp->compliance is intel_dp_test.c.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ea2ad218bdba21be30bd15a3707663508518dfa5.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: convert DP test debugfs to struct intel_display
Jani Nikula [Fri, 20 Sep 2024 11:56:50 +0000 (14:56 +0300)]
drm/i915/dp: convert DP test debugfs to struct intel_display

Prefer struct intel_display over struct drm_i915_private. Do some
drive-by logging conversions to kms category.

Observe that i915_displayport_test_active_write() was using the wrong
type for m->private, but it has worked because struct drm_i915_private
has struct drm_device at offset 0.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/4d29cf43c7067e910fdf1127afcc35dd558b4b0b.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/display: remove the loop in fifo underrun debugfs file creation
Jani Nikula [Fri, 20 Sep 2024 11:56:49 +0000 (14:56 +0300)]
drm/i915/display: remove the loop in fifo underrun debugfs file creation

No need for the loop for a single file, and no more files should be
added here, but rather in functionality specific source files.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/bd74ff250075c599163c988ae6fb5316f92bf192.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: fix style issues in DP test debugfs
Jani Nikula [Fri, 20 Sep 2024 11:56:48 +0000 (14:56 +0300)]
drm/i915/dp: fix style issues in DP test debugfs

Apply some style fixes on top of the previous code movement.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/733dc8f648498a534811adf1cf079b3f4cbbf8f5.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: move DP test debugfs files next to the functionality
Jani Nikula [Fri, 20 Sep 2024 11:56:47 +0000 (14:56 +0300)]
drm/i915/dp: move DP test debugfs files next to the functionality

Move the DP test debugfs files to intel_dp_test.[ch].

Side note: The debugfs looks like it begs to be converted to connector
debugfs, but that's for another day.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/46779bc4e420868e21bd5e72fdf245a541252fde.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: clean up intel_dp_test.[ch] interface
Jani Nikula [Fri, 20 Sep 2024 11:56:46 +0000 (14:56 +0300)]
drm/i915/dp: clean up intel_dp_test.[ch] interface

Conform to uniform function naming. Use intel_dp. Hide checks on
intel_dp->compliance within intel_dp_test.[ch].

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c2905006d2d47040032153ca69052898529a95d5.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: convert intel_dp_test.c struct intel_display
Jani Nikula [Fri, 20 Sep 2024 11:56:45 +0000 (14:56 +0300)]
drm/i915/dp: convert intel_dp_test.c struct intel_display

Prefer struct intel_display over struct drm_i915_private.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5b4ae05c6b3f1608bddb09078b616eff6b93efdd.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: fix style issues in intel_dp_test.c
Jani Nikula [Fri, 20 Sep 2024 11:56:44 +0000 (14:56 +0300)]
drm/i915/dp: fix style issues in intel_dp_test.c

Apply some style fixes on top of the previous code movement.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/330f918a3b4fe6dd156dd89ee26c56cf8ae8ec31.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/dp: split out intel_dp_test.[ch] to a dedicated file
Jani Nikula [Fri, 20 Sep 2024 11:56:43 +0000 (14:56 +0300)]
drm/i915/dp: split out intel_dp_test.[ch] to a dedicated file

intel_dp.c has become huge, over 7k lines. Split out the fairly well
isolated chunk of DP test code to a dedicated file intel_dp_test.[ch].

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/262d565fe59715ba297702b67d4bcca81c736dc0.1726833193.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay
Jouni Högander [Fri, 20 Sep 2024 06:23:40 +0000 (09:23 +0300)]
drm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay

We need to block DC6 entry in case of Panel Replay as enabling VBI doesn't
prevent DC6 in case of Panel Replay. This causes problems if user-space is
polling for vblank events.

Fix this by setting target DC state as DC_STATE_EN_UPTO_DC5 when both
source and sink are supporting eDP Panel Replay and VBI is enabled.

v4:
  - s/vblank_work/vblank_dc_work/
  - changed type of block_dc_for_vblank to bool
v3:
  - do flush_work for vblank_work on intel_crtc_vblank_off
  - no need to use READ_ONCE in bdw_enable_vblank
  - check crtc->block_dc_for_vblank in bdw_disable_vblank as well
  - move adding block_dc_for_vblank into this patch
v2:
  - use READ_ONCE in intel_display_vblank_work
  - use DC_STATE_DISABLE instead of DC_STATE_EN_UPTO_DC6
  - use intel_crtc->block_dc6_needed

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2296
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920062340.1333777-3-jouni.hogander@intel.com
8 months agodrm/i915/psr: Add intel_psr_needs_block_dc_vblank for blocking dc entry
Jouni Högander [Fri, 20 Sep 2024 06:23:39 +0000 (09:23 +0300)]
drm/i915/psr: Add intel_psr_needs_block_dc_vblank for blocking dc entry

We need to block DC6 entry in case of Panel Replay as enabling VBI doesn't
prevent it in case of Panel Replay. Panel Replay switches main link off on
DC entry. This means vblank interrupts are not fired and is a problem if
user-space is polling for vblank events. For this purpose add new function
to query need for dc entry blocking on.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920062340.1333777-2-jouni.hogander@intel.com
8 months agodrm/i915/pciid: Add new PCI id for ARL
Dnyaneshwar Bhadane [Tue, 10 Sep 2024 06:23:01 +0000 (11:53 +0530)]
drm/i915/pciid: Add new PCI id for ARL

Add new PCI id for ARL platform.

Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910062301.2006782-1-dnyaneshwar.bhadane@intel.com
8 months agodrm/xe: eradicate -Ddrm_i915_gem_object=xe_bo
Jani Nikula [Tue, 17 Sep 2024 16:14:01 +0000 (19:14 +0300)]
drm/xe: eradicate -Ddrm_i915_gem_object=xe_bo

We've now completely stopped using drm_i915_gem_object in display code
that gets built for xe. Kill off the -Ddrm_i915_gem_object=xe_bo
hack. Good riddance.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0eae2b62b635acafe5dc97dc4b205aaa34ce1e53.1726589119.git.jani.nikula@intel.com
8 months agodrm/xe: remove a number of superfluous compat macros
Jani Nikula [Tue, 17 Sep 2024 16:14:00 +0000 (19:14 +0300)]
drm/xe: remove a number of superfluous compat macros

Some compat macros have inadvertently been sprinkled in xe core
headers. Remove the final users and the macros.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/418185993c5825a54ac3f87a85463c799c91e47d.1726589119.git.jani.nikula@intel.com
8 months agodrm/xe/compat: remove a bunch of compat gem headers
Jani Nikula [Tue, 17 Sep 2024 16:13:59 +0000 (19:13 +0300)]
drm/xe/compat: remove a bunch of compat gem headers

Now that we've switched to struct drm_gem_object and the intel_bo_*
interfaces, we no longer need most of the compat gem headers. Remove.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2ac115c5dd5f68da9172e9b5bd3a7eb4e10fce60.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: clean up some gem/ includes
Jani Nikula [Tue, 17 Sep 2024 16:13:58 +0000 (19:13 +0300)]
drm/i915/display: clean up some gem/ includes

Drop some unnecessary gem/ includes.

We seem to include xe_device.h through some compat gem headers, so we
need to include it directly in compat i915_drv.h to get
xe_device_has_flat_ccs().

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/afd2917cc0a943660886937bb5f45c277132e147.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: remove intel_fb_obj()
Jani Nikula [Tue, 17 Sep 2024 16:13:57 +0000 (19:13 +0300)]
drm/i915/fb: remove intel_fb_obj()

Convert remaining users of the struct drm_i915_gem_object based
intel_fb_obj() to the struct drm_gem_object based intel_fb_bo(), and
remove intel_fb_obj().

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e1fbf33d71813f39621ba0ac7e404821a3f63588.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: add intel_bo_describe() and use it
Jani Nikula [Tue, 17 Sep 2024 16:13:56 +0000 (19:13 +0300)]
drm/i915/display: add intel_bo_describe() and use it

Add an interface based on struct drm_gem_object, and use it.

This lets us delete the compat i915_debugfs.h header.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/66bcaaba9899a2bceb7ce4bd3be56ff60c5c9b09.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/frontbuffer: convert frontbuffer->obj to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:55 +0000 (19:13 +0300)]
drm/i915/frontbuffer: convert frontbuffer->obj to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Do some opportunistic struct intel_display conversions while at it,
because it's more convenient to deal with.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/51bdb3c9b798e28bd70c259fc3874d80bc9b7443.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/frontbuffer: convert intel_frontbuffer_get() to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:54 +0000 (19:13 +0300)]
drm/i915/frontbuffer: convert intel_frontbuffer_get() to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/358cfcb5eb666732cd7ae21e4f63d07837960ec2.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: add intel_bo_get/set_frontbuffer() and use them
Jani Nikula [Tue, 17 Sep 2024 16:13:53 +0000 (19:13 +0300)]
drm/i915/display: add intel_bo_get/set_frontbuffer() and use them

Add the struct drm_gem_object based interfaces.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3120ec430656f04701077dda39cce5f1ed415eee.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: add intel_bo_read_from_page() and use it
Jani Nikula [Tue, 17 Sep 2024 16:13:52 +0000 (19:13 +0300)]
drm/i915/display: add intel_bo_read_from_page() and use it

Add an interface based on struct drm_gem_object, and use it. Move the xe
implementation to the intel_bo abstraction layer.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/45fcd209221a7b2ada5a243d95b8953237471e52.1726589119.git.jani.nikula@intel.com
8 months agodrm/xe/display: stop using intel_fb_obj() in xe_fb_pin.c
Jani Nikula [Tue, 17 Sep 2024 16:13:51 +0000 (19:13 +0300)]
drm/xe/display: stop using intel_fb_obj() in xe_fb_pin.c

intel_fb_obj() returns struct drm_i915_gem_object, which is not right
for xe, and only works because xe defines
-Ddrm_i915_gem_object=xe_bo. Switch to intel_fb_bo() and convert to
struct xe_bo from there.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/39f3d52cf156aecc4b2ed5cf1c9342b1c15143b4.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert intel_framebuffer_create() to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:50 +0000 (19:13 +0300)]
drm/i915/fb: convert intel_framebuffer_create() to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Move the declaration to the right place while at it.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5120aa0f5e49e95526b3ac20c1325bac1d95aa21.1726589119.git.jani.nikula@intel.com
8 months agodrm/xe/display: use correct bo type in intel_fbdev_fb_alloc()
Jani Nikula [Tue, 17 Sep 2024 16:13:49 +0000 (19:13 +0300)]
drm/xe/display: use correct bo type in intel_fbdev_fb_alloc()

It's really struct xe_bo, and struct drm_i915_gem_object only works
because of -Ddrm_i915_gem_object=xe_bo in xe Makefile.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/344a5a4c88a3ce17dd276b0155bcdbf93e5fb475.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert intel_fb_bo_framebuffer_fini() to struct drm_i915_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:48 +0000 (19:13 +0300)]
drm/i915/fb: convert intel_fb_bo_framebuffer_fini() to struct drm_i915_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

The xe specific intel_fb_bo.h becomes redundant. Remove it, and rely on
the common header in i915 display.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0efbc9ae2dbe157f92fa71d423ed37fd17346da5.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert intel_fb_bo_framebuffer_init() to struct drm_i915_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:47 +0000 (19:13 +0300)]
drm/i915/fb: convert intel_fb_bo_framebuffer_init() to struct drm_i915_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object. Add new intel_bo_* functions as needed.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/37f6dbb8946198cfac132e5e8eb5820f4f8dbc13.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert intel_fb_bo_lookup_valid_bo() to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:46 +0000 (19:13 +0300)]
drm/i915/fb: convert intel_fb_bo_lookup_valid_bo() to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/645307ea7bf858d131ecdeff6ee9c9b99ae00526.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert intel_framebuffer_init() to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:45 +0000 (19:13 +0300)]
drm/i915/fb: convert intel_framebuffer_init() to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1b14bb0719c172304f38dfe59ea7240b3f42ed73.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: convert skl_universal_plane.c to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:44 +0000 (19:13 +0300)]
drm/i915/display: convert skl_universal_plane.c to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object. Add new intel_bo_* functions as
needed. Convert intel_pxp_key_check() to struct drm_gem_object.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0a6d2bec50764efaae4322c9cfa33eefbfe1c054.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fbdev: convert intel_fbdev.c to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:43 +0000 (19:13 +0300)]
drm/i915/fbdev: convert intel_fbdev.c to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object. Add new intel_bo_* functions as needed.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/246b802bdbcd01a970ff8255d11db337f7b47b39.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/fb: convert parts of intel_fb.c to struct drm_gem_object
Jani Nikula [Wed, 18 Sep 2024 06:25:14 +0000 (09:25 +0300)]
drm/i915/fb: convert parts of intel_fb.c to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object. Add new intel_bo_* functions as needed.

v2: update comment for intel_bo_is_userptr() (Maarten)

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918062514.1163290-1-jani.nikula@intel.com
8 months agodrm/i915/display: convert intel_atomic_plane.c to struct drm_gem_object
Jani Nikula [Tue, 17 Sep 2024 16:13:41 +0000 (19:13 +0300)]
drm/i915/display: convert intel_atomic_plane.c to struct drm_gem_object

Prefer the driver agnostic struct drm_gem_object over i915 specific
struct drm_i915_gem_object.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a60e14663f53e921bf228420af0e3d8762d92b82.1726589119.git.jani.nikula@intel.com
8 months agodrm/i915/display: start a buffer object abstraction layer
Jani Nikula [Tue, 17 Sep 2024 16:13:40 +0000 (19:13 +0300)]
drm/i915/display: start a buffer object abstraction layer

The display code needs to deal with gem objects, and mostly uses struct
drm_i915_gem_object. That's not great, because for xe we need to
redefine it struct xe_bo during build.

Start a common interface using struct drm_gem_object, with separate
implementations for i915 and xe. For starters, convert i9xx_wm.c to use
it.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/df6867523a0b5fdd4eb63f657f545603ae6f6e0b.1726589119.git.jani.nikula@intel.com
8 months agodrm/xe/display: remove compat raw reg read/write support
Jani Nikula [Mon, 8 Apr 2024 12:54:45 +0000 (15:54 +0300)]
drm/xe/display: remove compat raw reg read/write support

The i915 display code no longer uses these interfaces. Remove them.

Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240408125445.3227678-2-jani.nikula@intel.com
8 months agodrm/i915/display: remove small micro-optimizations in irq handling
Jani Nikula [Mon, 8 Apr 2024 12:54:44 +0000 (15:54 +0300)]
drm/i915/display: remove small micro-optimizations in irq handling

The raw register reads/writes are there as micro-optimizations to avoid
multiple pointer indirections on uncore->regs. Presumably this is useful
when there are plenty of register reads/writes in the same
function. However, the display irq handling only has a few raw
reads/writes. Remove them for simplification.

Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240408125445.3227678-1-jani.nikula@intel.com
8 months agodrm/i915/dp: Fix colorimetry detection
Ville Syrjälä [Wed, 18 Sep 2024 19:04:39 +0000 (22:04 +0300)]
drm/i915/dp: Fix colorimetry detection

intel_dp_init_connector() is no place for detecting stuff via
DPCD (except perhaps for eDP). Move the colorimetry stuff into
a more appropriate place.

Cc: Jouni Högander <jouni.hogander@intel.com>
Fixes: 00076671a648 ("drm/i915/display: Move colorimetry_support from intel_psr to intel_dp")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918190441.29071-1-ville.syrjala@linux.intel.com
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
8 months agodrm/i915: Extract intel_post_plane_update_after_readout()
Ville Syrjälä [Mon, 16 Sep 2024 15:29:58 +0000 (18:29 +0300)]
drm/i915: Extract intel_post_plane_update_after_readout()

Clean up the main commit_tail() codepath a bit by pulling
the post plane update steps that need to performed after
readout into their own little function
(intel_post_plane_update_after_readout()).

Declutters intel_atomic_commit_tail() a bit, and should
hopefully aid in keeping intel_pre_plane_update() vs.
intel_post_plane_update*() in sync.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916152958.17332-3-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
8 months agodrm/i915/color: Extract intel_color_modeset()
Ville Syrjälä [Mon, 16 Sep 2024 15:29:57 +0000 (18:29 +0300)]
drm/i915/color: Extract intel_color_modeset()

We always perform the same steps to program color management
stuff during a full modeset. Extract that code to a helper
to avoid duplication.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916152958.17332-2-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
8 months agodrm/i915/display: Enhance iterators for modeset en/disable
Ankit Nautiyal [Wed, 18 Sep 2024 06:30:16 +0000 (12:00 +0530)]
drm/i915/display: Enhance iterators for modeset en/disable

Joiners have specific enabling and disabling order dependent on primary
and secondary pipes. This becomes more complex with ultrajoiner where we
have ultrajoiner primary/secondary pipes in addition to bigjoiner
primary/secondary pipes. To unify the approach that works for present
and future joiner cases, use primary and secondary pipe masks to
iterate over pipes.

If joiner is used, derive bigoiner primary and secondary pipe masks
and use following sequences:
Disabling : disable primary pipes followed by secondary pipes,
Enabling: enable secondary pipes followed by primary pipes.

This works well with ultrajoiner too, as ultrajoiner has 2 bigjoiner
primary/secondary pairs (AC, BD).

For non joiner case, enable/disable based on usual pipe order A-D, D-A
respectively.

v2:
-Simplify the iterator macro. (Ville)
-Use struct intel_display. (Ville)
-Add prefix _intel to the helper name. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918063016.2667721-3-ankit.k.nautiyal@intel.com
8 months agodrm/i915: Add some essential functionality for joiners
Stanislav Lisovskiy [Wed, 18 Sep 2024 06:30:15 +0000 (12:00 +0530)]
drm/i915: Add some essential functionality for joiners

In most of the cases we now try to avoid mentioning things like
"bigjoiner" or "ultrajoiner" trying to unify the API and refer
mostly to all this functionality as "joiner".
In majority cases that should be way to go.
However in some cases we still need to distinguish between
bigjoiner primaries and secondaries(such as DSC register programming).

Create correspondent helper functions and start using them,
in order be prepared for adding ultrajoiner functionality.

v2: Fixed checkpatch warnings (Ankit)
v3: Introduce ultrajoiner helpers in next patch.
v4: Streamline the helpers and add few more. (Ville)
v5: Add comment to clarify that helpers apply to both bigjoiner and
uncompressed joiner configurations. (Ville)

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918063016.2667721-2-ankit.k.nautiyal@intel.com
8 months agodrm/i915/debugfs: add dedicated intel_display_caps debugfs for display
Jani Nikula [Fri, 13 Sep 2024 12:51:55 +0000 (15:51 +0300)]
drm/i915/debugfs: add dedicated intel_display_caps debugfs for display

Add dedicated intel_display_caps for display, with device info and
params. Intentionally prefix the file intel_ instead of i915_. Going
forward, we should do the same for all debugfs files, making them
independent of i915 and xe.

Remove display param dumping from i915 specific i915_capabilities
debugfs.

Note that we don't add node_to_intel_display() functionality in
to_intel_display(). It's too specific for that.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1b825b893dd2d423da167a7b6b21d05e8cd0182c.1726231866.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/debugfs: remove superfluous kernel_param_lock/unlock
Jani Nikula [Fri, 13 Sep 2024 12:51:54 +0000 (15:51 +0300)]
drm/i915/debugfs: remove superfluous kernel_param_lock/unlock

We're not actually accessing the module params here anymore. The locking
is completely unnecessary.

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/330360c3b27aaff1cdb132f1500ba68de9300508.1726231866.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: move vlv_active_pipe() to intel_pps.c
Jani Nikula [Wed, 18 Sep 2024 17:47:49 +0000 (20:47 +0300)]
drm/i915/pps: move vlv_active_pipe() to intel_pps.c

All the users for vlv_active_pipe() are within intel_pps.c now, and
there are already uses of g4x_dp_port_enabled() and intel_dp->output_reg
in there, so seems fine to reduce interfaces and move vlv_active_pipe()
to intel_pps.c too.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e12ae0a931f113f3bbbf1b4c66108b572a933efb.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add vlv_pps_backlight_initial_pipe()
Jani Nikula [Wed, 18 Sep 2024 17:47:48 +0000 (20:47 +0300)]
drm/i915/pps: add vlv_pps_backlight_initial_pipe()

Add vlv_pps_backlight_initial_pipe() and move the VLV/CHV initial
backlight pipe logic there, hiding the PPS pipe details inside PPS code.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b0587f183d8bb06679a75b04f956762435d10181.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: rename vlv_pps_init() to vlv_pps_port_enable_unlocked()
Jani Nikula [Wed, 18 Sep 2024 17:47:47 +0000 (20:47 +0300)]
drm/i915/pps: rename vlv_pps_init() to vlv_pps_port_enable_unlocked()

Follow the naming for vlv_pps_port_disable(), as these are counterparts,
and add _unlocked suffix as it assumes the pps lock is held.

v2: Add _unlocked suffix (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3b21141025a5e1e67f28bbe67a82a7008fd3f415.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add vlv_pps_port_disable()
Jani Nikula [Wed, 18 Sep 2024 17:47:46 +0000 (20:47 +0300)]
drm/i915/pps: add vlv_pps_port_disable()

Add vlv_pps_port_disable() and move the VLV/CHV active pipe clear there
from intel_dp_link_down(), hiding the PPS pipe details inside PPS code.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2546716a448205ca5af085cec9faeb5e5deac287.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add vlv_pps_pipe_reset()
Jani Nikula [Wed, 18 Sep 2024 17:47:45 +0000 (20:47 +0300)]
drm/i915/pps: add vlv_pps_pipe_reset()

We need to track PPS also for non-eDP usage on VLV/CHV. Add new
vlv_pps_pipe_reset() for resetting the related parts, hiding the PPS
pipe details inside PPS code.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e1bae913533baea8e502d8c63c06f6852a1cdb93.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add vlv_pps_pipe_init()
Jani Nikula [Wed, 18 Sep 2024 17:47:44 +0000 (20:47 +0300)]
drm/i915/pps: add vlv_pps_pipe_init()

We need to track PPS also for non-eDP usage on VLV/CHV. Add new
vlv_pps_pipe_init() for initializing the related parts, hiding the PPS
pipe details inside PPS code.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2829a5bab5e9a4dcddc3a2bb87e12559000543ea.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: only touch the vlv_ members on VLV/CHV
Jani Nikula [Wed, 18 Sep 2024 17:47:43 +0000 (20:47 +0300)]
drm/i915/pps: only touch the vlv_ members on VLV/CHV

While the struct intel_pps vlv_pps_pipe and vlv_active_pipe members are
only relevant for VLV/CHV, we still initialize them on all platforms and
check them on BXT/GLK. Wrap all access inside VLV/CHV checks for
consistency.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/158c7b30e56d22aa3f9c9e51e87b9d89687d74d5.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add bxt_ prefix to pps_reset
Jani Nikula [Wed, 18 Sep 2024 17:47:42 +0000 (20:47 +0300)]
drm/i915/pps: add bxt_ prefix to pps_reset

The pps_reset member of struct intel_pps is only relevant on
BXT/GLK. Prefix it with bxt_.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/7d4552f555936be44fae27ca101007746fcff8c2.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/pps: add vlv_ prefix to pps_pipe and active_pipe members
Jani Nikula [Wed, 18 Sep 2024 17:47:41 +0000 (20:47 +0300)]
drm/i915/pps: add vlv_ prefix to pps_pipe and active_pipe members

The pps_pipe and active_pipe members of struct intel_pps are only
relevant on VLV/CHV. Prefix them with vlv_.

Note that there are still a few cases where they're accessed on
non-VLV/CHV paths. We'll fix them separately.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0e9a8998fc37796eb6f32692977859807222ce0a.1726681620.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/psr: Fix PSR sink enable sequence
Ville Syrjälä [Wed, 11 Sep 2024 15:18:36 +0000 (18:18 +0300)]
drm/i915/psr: Fix PSR sink enable sequence

According to the eDP spec, the source must first configure all
PSR related DPCD registers apart from the actual enable bit,
and only then set the enable bit. Split the current single DPCD
write to two to match the spec.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911151836.16800-1-ville.syrjala@linux.intel.com
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
8 months agodrm/i915/psr: eDP Panel Replay is not supported on pipes other than A and B
Jouni Högander [Mon, 16 Sep 2024 08:57:06 +0000 (11:57 +0300)]
drm/i915/psr: eDP Panel Replay is not supported on pipes other than A and B

Do not allow Panel Replay if pipe is other than A or B.

Bspec: 68920

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2736
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916085706.2160511-1-jouni.hogander@intel.com
8 months agodrm/i915/display: Use joined pipes in dsc helpers for slices, bpp
Ankit Nautiyal [Mon, 16 Sep 2024 10:28:36 +0000 (15:58 +0530)]
drm/i915/display: Use joined pipes in dsc helpers for slices, bpp

In preparation of ultrajoiner, use number of joined pipes in the dsc
helpers to compute dsc slices and max compressed bpp, instead of using
the joiner flag.

v2: Adjust the formulae to use num of pipes as 1 (no joiner) or 2
(bigjoiner). (Ankit)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-5-ankit.k.nautiyal@intel.com
8 months agodrm/i915/display: Use joined pipes in intel_mode_valid_max_plane_size
Ankit Nautiyal [Mon, 16 Sep 2024 10:28:35 +0000 (15:58 +0530)]
drm/i915/display: Use joined pipes in intel_mode_valid_max_plane_size

In preparation of ultrajoiner, use number of pipes in the
intel_mode_valid_max_plane_size helper, instead of joiner flag.

v2: Use num_joined_pipes 1 where there are no joined pipes (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-4-ankit.k.nautiyal@intel.com
8 months agodrm/i915/display: Use joined pipes in intel_dp_joiner_needs_dsc
Ankit Nautiyal [Mon, 16 Sep 2024 10:28:34 +0000 (15:58 +0530)]
drm/i915/display: Use joined pipes in intel_dp_joiner_needs_dsc

In preparation of ultrajoiner, use number of joined pipes in the
intel_dp_joiner_needs_dsc helper, instead of joiner flag.

v2: Use intel_crtc_num_joined_pipes. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-3-ankit.k.nautiyal@intel.com
8 months agodrm/i915/display: Simplify intel_joiner_num_pipes and its usage
Ankit Nautiyal [Mon, 16 Sep 2024 10:28:33 +0000 (15:58 +0530)]
drm/i915/display: Simplify intel_joiner_num_pipes and its usage

Currently intel_joiner_num_pipes is used to get num of pipes wrt num of
pipes joined. Simplify this by returning 1 when no joiner is used and
update the checks for no joiner case.

v2: Rename the function to intel_crtc_num_joined_pipes and use helper
intel_crtc_joined_pipe_mask. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-2-ankit.k.nautiyal@intel.com
8 months agodrm/i915/irq: Uninstall should be called just once
Rodrigo Vivi [Mon, 16 Sep 2024 16:19:37 +0000 (12:19 -0400)]
drm/i915/irq: Uninstall should be called just once

There shouldn't be any path where the irq uninstall is called
twice nowadays. So, remove the FIXME commend and change
the check to a WARN.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916161937.537334-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 months agodrm/i915: add i9xx_display_irq_reset()
Jani Nikula [Mon, 16 Sep 2024 13:47:20 +0000 (16:47 +0300)]
drm/i915: add i9xx_display_irq_reset()

Add common i9xx_display_irq_reset() for display 2-4. The check for
I915_HAS_HOTPLUG() covers all the alternatives.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916134720.501725-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/display: move enum i9xx_plane_id to intel_display_limits.h
Jani Nikula [Fri, 13 Sep 2024 13:54:39 +0000 (16:54 +0300)]
drm/i915/display: move enum i9xx_plane_id to intel_display_limits.h

Move enum i9xx_plane_id from intel_display.h to intel_display_limits.h
to be able to reduce dependencies on intel_display.h.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1e8f9768f2d638dfa1fc72f80f0d7391c4a48bbb.1726235647.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915: move intel_get_pipe_from_crtc_id_ioctl to intel_crtc.c
Jani Nikula [Fri, 13 Sep 2024 13:54:38 +0000 (16:54 +0300)]
drm/i915: move intel_get_pipe_from_crtc_id_ioctl to intel_crtc.c

Reduce the size of and dependencies on intel_display.[ch], and move
intel_get_pipe_from_crtc_id_ioctl() to intel_crtc.[ch]. Rename to
intel_crtc_get_pipe_from_crtc_id_ioctl() while at it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/edcf4477e6f38cc1f36a8afc0d09fd98544803ab.1726235647.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
8 months agodrm/i915/irq: Rename suspend/resume functions
Rodrigo Vivi [Thu, 12 Sep 2024 17:25:39 +0000 (13:25 -0400)]
drm/i915/irq: Rename suspend/resume functions

Although these functions are used in runtime_pm, they are not
exclusively used there, so remove the misleading prefix.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912172539.418957-3-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 months agodrm/i915/irq: Move irqs_enabled out of runtime_pm
Rodrigo Vivi [Thu, 12 Sep 2024 17:25:38 +0000 (13:25 -0400)]
drm/i915/irq: Move irqs_enabled out of runtime_pm

This information is used in many places and it doesn't have
anything to do with runtime_pm directly. Let's move it to
the driver, where it belongs.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912172539.418957-2-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 months agodrm/i915/irq: Remove duplicated irq_enabled variable
Rodrigo Vivi [Thu, 12 Sep 2024 17:25:37 +0000 (13:25 -0400)]
drm/i915/irq: Remove duplicated irq_enabled variable

Let's kill this legacy iand almost unused rq_enabled version
in favor of the real one that is checked at
intel_irqs_enabled().

The commit 'ac1723c16b66 ("drm/i915: Track IRQ state
in local device state")' shows that this was a legacy
DRM level irq_enabled information that got removed.

But the driver one already existed under a different
name.

Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912172539.418957-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
8 months agodrm/i915/display: fix typo in the comment
Yan Zhen [Fri, 13 Sep 2024 06:17:27 +0000 (14:17 +0800)]
drm/i915/display: fix typo in the comment

Correctly spelled comments make it easier for the reader to understand
the code.

Replace 'platformas' with 'platforms' in the comment &
replace 'prefere' with 'prefer' in the comment &
replace 'corresponsding' with 'corresponding' in the comment &
replace 'harizontal' with 'horizontal' in the comment.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240913061727.170198-1-yanzhen@vivo.com
8 months agodrm/i915/gvt: Correct multiple typos in comments
Shen Lichuan [Fri, 13 Sep 2024 02:16:12 +0000 (10:16 +0800)]
drm/i915/gvt: Correct multiple typos in comments

Fixed some spelling errors, the details are as follows:

-in the code comments:
addess->address
trasitions->transitions
furture->future
unsubmited->unsubmitted

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240913021612.41948-1-shenlichuan@vivo.com
8 months agodrm/i915/dp: Remove double assignment in intel_dp_compute_as_sdp()
Yuesong Li [Fri, 23 Aug 2024 02:36:12 +0000 (10:36 +0800)]
drm/i915/dp: Remove double assignment in intel_dp_compute_as_sdp()

cocci report a double assignment warning. 'as_sdp->duration_incr_ms'
was assigned twice in intel_dp_compute_as_sdp().

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240823023612.3027849-1-liyuesong@vivo.com
8 months agodrm/i915/display: Check whether platform supports joiner
Ankit Nautiyal [Thu, 12 Sep 2024 13:29:31 +0000 (18:59 +0530)]
drm/i915/display: Check whether platform supports joiner

Add macros to check if platform supports bigjoiner/uncompressed joiner.
Replace the existing DISPLAY_VER checks with these.
Additionally use it before readout for joiner stuff, where its missing.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912132931.1320686-1-ankit.k.nautiyal@intel.com
9 months agodrm/i915/dp: Fix AUX IO power enabling for eDP PSR
Imre Deak [Tue, 10 Sep 2024 11:18:47 +0000 (14:18 +0300)]
drm/i915/dp: Fix AUX IO power enabling for eDP PSR

Panel Self Refresh on eDP requires the AUX IO power to be enabled
whenever the output (main link) is enabled. This is required by the
AUX_PHY_WAKE/ML_PHY_LOCK signaling initiated by the HW automatically to
re-enable the main link after it got disabled in power saving states
(see eDP v1.4b, sections 5.1, 6.1.3.3.1.1).

The Panel Replay mode on non-eDP outputs on the other hand is only
supported by keeping the main link active, thus not requiring the above
AUX_PHY_WAKE/ML_PHY_LOCK signaling (eDP v1.4b, section 6.1.3.3.1.2).
Thus enabling the AUX IO power for this case is not required either.

Based on the above enable the AUX IO power only for eDP/PSR outputs.

Bspec: 49274, 53370

v2:
- Add a TODO comment to adjust the requirement for AUX IO based on
  whether the ALPM/main-link off mode gets enabled. (Rodrigo)

Cc: Animesh Manna <animesh.manna@intel.com>
Fixes: b8cf5b5d266e ("drm/i915/panelreplay: Initializaton and compute config for panel replay")
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910111847.2995725-1-imre.deak@intel.com
9 months agodrm/i915/hwmon: expose package temperature
Raag Jadav [Tue, 10 Sep 2024 10:52:42 +0000 (16:22 +0530)]
drm/i915/hwmon: expose package temperature

Add hwmon support for temp1_input attribute, which will expose package
temperature in millidegree Celsius. With this in place we can monitor
package temperature using lm-sensors tool.

$ sensors
i915-pci-0300
Adapter: PCI adapter
in0:         990.00 mV
fan1:        1260 RPM
temp1:        +45.0°C
power1:           N/A  (max =  35.00 W)
energy1:      12.62 kJ

v2: Use switch case (Anshuman)
v3: Comment adjustment (Riana)

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11276
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910105242.3357276-1-raag.jadav@intel.com
9 months agodrm/i915/display: move dmc snapshotting to new display snapshot
Jani Nikula [Thu, 12 Sep 2024 14:34:14 +0000 (17:34 +0300)]
drm/i915/display: move dmc snapshotting to new display snapshot

Convert dmc error state printing to new snapshot capture/print division.

v2: Rebase

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9116319e7faceeed7695ee35e56fe001ddf94e11.1726151571.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915/display: move device info and params handling to snapshot
Jani Nikula [Thu, 12 Sep 2024 14:34:13 +0000 (17:34 +0300)]
drm/i915/display: move device info and params handling to snapshot

Snapshot display device and runtime info as well as display parameters
in display snapshot.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5aa52749d6adce6d9c85cb8d8395bbf4db0e76a2.1726151571.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915/display: add intel_display_snapshot abstraction
Jani Nikula [Thu, 12 Sep 2024 14:34:12 +0000 (17:34 +0300)]
drm/i915/display: add intel_display_snapshot abstraction

The error state capture still handles display info at a too detailed
level. Start abstracting the whole display snapshot capture and printing
at a higher level. Move overlay to display snapshot first.

Use the same nomenclature and style as in xe devcoredump, in preparation
for perhaps some day bolting the snapshots there as well.

v3: Fix build harder for CONFIG_DRM_I915_CAPTURE_ERROR=n

v2: Fix build for CONFIG_DRM_I915_CAPTURE_ERROR=n (kernel test robot)

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ba6a36759600c2d35405c41a0fc9d69f676df77d.1726151571.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915: dump display parameters captured in error state, not current
Jani Nikula [Thu, 12 Sep 2024 14:34:11 +0000 (17:34 +0300)]
drm/i915: dump display parameters captured in error state, not current

intel_display_params_dump() prints the current display parameters, not
the ones captured during error capture. It's not likely the params get
changed in between, but make it pedantically correct anyway. Pass in the
parameters and driver name to intel_display_params_dump().

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b437a5db768f0cb34377a9e4669c2b37fc7c7c29.1726151571.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/xe/display: Do not do intel_fbdev_set_suspend during runtime
Suraj Kandpal [Thu, 12 Sep 2024 01:25:45 +0000 (06:55 +0530)]
drm/xe/display: Do not do intel_fbdev_set_suspend during runtime

Do not do intel_fbdev_set_suspend during runtime_suspend/resume
functions. This cause a big circular lock_dep splat.

kworker/0:4/198 is trying to acquire lock:
<4> [77.185594] ffffffff83398500 (console_lock){+.+.}-{0:0}, at:
intel_fbdev_set_suspend+0x169/0x1f0 [xe]
<4> [77.185947]
but task is already holding lock:
<4> [77.185949] ffffffffa09e9460
(xe_pm_runtime_lockdep_map){+.+.}-{0:0}, at:
xe_pm_runtime_suspend+0x51/0x3f0 [xe]
<4> [77.186262]
which lock already depends on the new lock.
<4> [77.186264]
the existing dependency chain (in reverse order) is:
<4> [77.186266]
-> #2 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}:
<4> [77.186276]        pm_runtime_lockdep_prime+0x2f/0x50 [xe]
<4> [77.186572]        xe_pm_runtime_resume_and_get+0x29/0x90 [xe]
<4> [77.186867]        intelfb_create+0x150/0x390 [xe]
<4> [77.187197]
__drm_fb_helper_initial_config_and_unlock+0x31c/0x5e0 [drm_kms_helper]
<4> [77.187243]        drm_fb_helper_initial_config+0x3d/0x50
[drm_kms_helper]
<4> [77.187274]        intel_fbdev_client_hotplug+0xb1/0x140 [xe]
<4> [77.187603]        drm_client_register+0x87/0xd0 [drm]
<4> [77.187704]        intel_fbdev_setup+0x51c/0x640 [xe]
<4> [77.188033]        intel_display_driver_register+0xb7/0xf0 [xe]
<4> [77.188438]        xe_display_register+0x21/0x40 [xe]
<4> [77.188809]        xe_device_probe+0xa8d/0xbf0 [xe]
<4> [77.189035]        xe_pci_probe+0x333/0x5b0 [xe]
<4> [77.189330]        local_pci_probe+0x48/0xb0
<4> [77.189341]        pci_device_probe+0xc8/0x280
<4> [77.189351]        really_probe+0xf8/0x390
<4> [77.189362]        __driver_probe_device+0x8a/0x170
<4> [77.189373]        driver_probe_device+0x23/0xb0

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912012545.702032-3-suraj.kandpal@intel.com
9 months agodrm/xe/display: Do not suspend resume dp mst during runtime
Suraj Kandpal [Thu, 12 Sep 2024 01:25:44 +0000 (06:55 +0530)]
drm/xe/display: Do not suspend resume dp mst during runtime

Remove intel_dp_mst_suspend/resume from runtime suspend resume
sequences. It is incorrect as it depends on AUX transfers which
itself depend on the device being runtime resumed. This is
also why we see a lock_dep splat here.

<4> [76.011119] kworker/4:2/192 is trying to acquire lock:
<4> [76.011122] ffff8881120b3210 (&mgr->lock#2){+.+.}-{3:3}, at:
drm_dp_mst_topology_mgr_suspend+0x33/0xd0 [drm_display_helper]
<4> [76.011142]
but task is already holding lock:
<4> [76.011144] ffffffffa0bc3420
(xe_pm_runtime_lockdep_map){+.+.}-{0:0}, at:
xe_pm_runtime_suspend+0x51/0x3f0 [xe]
<4> [76.011223]
which lock already depends on the new lock.
<4> [76.011226]
the existing dependency chain (in reverse order) is:
<4> [76.011229]
-> #2 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}:
<4> [76.011233]        pm_runtime_lockdep_prime+0x2f/0x50 [xe]
<4> [76.011306]        xe_pm_runtime_resume_and_get+0x29/0x90 [xe]
<4> [76.011377]        intel_display_power_get+0x24/0x70 [xe]
<4> [76.011466]        intel_digital_port_connected_locked+0x4c/0xf0
[xe]
<4> [76.011551]        intel_dp_aux_xfer+0xb8/0x7c0 [xe]
<4> [76.011633]        intel_dp_aux_transfer+0x166/0x2e0 [xe]
<4> [76.011715]        drm_dp_dpcd_access+0x87/0x150
[drm_display_helper]
<4> [76.011726]        drm_dp_dpcd_probe+0x3d/0xf0 [drm_display_helper]
<4> [76.011737]        drm_dp_dpcd_read+0xdd/0x130 [drm_display_helper]
<4> [76.011747]        intel_dp_get_colorimetry_status+0x3a/0x70 [xe]
<4> [76.011886]        intel_dp_init_connector+0x4ff/0x1030 [xe]
<4> [76.011969]        intel_ddi_init+0xc5b/0x1030 [xe]
<4> [76.012058]        intel_bios_for_each_encoder+0x36/0x60 [xe]
<4> [76.012145]        intel_setup_outputs+0x201/0x460 [xe]
<4> [76.012233]        intel_display_driver_probe_nogem+0x155/0x1e0 [xe]
<4> [76.012320]        xe_display_init_noaccel+0x27/0x70 [xe]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240912012545.702032-2-suraj.kandpal@intel.com
9 months agodrm/i915/hdcp: Use intel_display in hdcp_gsc
Suraj Kandpal [Wed, 11 Sep 2024 09:05:40 +0000 (14:35 +0530)]
drm/i915/hdcp: Use intel_display in hdcp_gsc

Use intel_display structure instead of drm_i915_private wherever
possible in hdcp_gsc related files.

--v2
-make intel_hdcp_gsc_hdcp2_init accept intel_display [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911090540.643155-3-suraj.kandpal@intel.com
9 months agodrm/i915/hdcp: Move to using intel_display in intel_hdcp
Suraj Kandpal [Wed, 11 Sep 2024 09:05:39 +0000 (14:35 +0530)]
drm/i915/hdcp: Move to using intel_display in intel_hdcp

Move to using intel_display wherever possible in intel_hdcp.c
as a part of code refactor.

--v2
-Move intel_display to the first line wherever possible [Jani]
-use the closest reference when using to_intel_display [Jani]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911090540.643155-2-suraj.kandpal@intel.com
9 months agodrm/i915: Do not explicilty enable FEC in DP_TP_CTL for UHBR rates
Chaitanya Kumar Borah [Thu, 22 Aug 2024 06:14:48 +0000 (11:44 +0530)]
drm/i915: Do not explicilty enable FEC in DP_TP_CTL for UHBR rates

In case of UHBR rates, we do not need to explicitly enable FEC by writing
to DP_TP_CTL register.
For MST use-cases, intel_dp_mst_find_vcpi_slots_for_bpp() takes care of
setting fec_enable to false. However, it gets overwritten in
intel_dp_dsc_compute_config(). This change keeps fec_enable false across
MST and SST use-cases for UHBR rates.

While at it, add a comment explaining why we don't enable FEC in eDP v1.5.

v2: Correct logic to cater to SST use-cases (Jani)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240822061448.4085693-1-chaitanya.kumar.borah@intel.com
9 months agodrm/i915/display: BMG supports UHBR13.5
Arun R Murthy [Tue, 27 Aug 2024 08:12:05 +0000 (13:42 +0530)]
drm/i915/display: BMG supports UHBR13.5

UHBR20 is not supported by battlemage and the maximum link rate
supported is UHBR13.5

v2: Replace IS_DGFX with IS_BATTLEMAGE (Jani)

HSD: 16023263677
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Fixes: 98b1c87a5e51 ("drm/i915/xe2hpd: Set maximum DP rate to UHBR13.5")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240827081205.136569-1-arun.r.murthy@intel.com
9 months agodrm/i915/reg: remove superfluous whitespace
Jani Nikula [Tue, 10 Sep 2024 13:28:55 +0000 (16:28 +0300)]
drm/i915/reg: remove superfluous whitespace

Clean up some whitespace.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1223c6c7ff59f541453a38f8f5e2df9eb3526573.1725974820.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915/reg: remove unused DSI register macros
Jani Nikula [Tue, 10 Sep 2024 13:28:54 +0000 (16:28 +0300)]
drm/i915/reg: remove unused DSI register macros

Not needed. Remove.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2a8633038c0bd6ca06236558a609e021b30514f4.1725974820.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915/reg: fix small register style issues here and there
Jani Nikula [Tue, 10 Sep 2024 13:28:53 +0000 (16:28 +0300)]
drm/i915/reg: fix small register style issues here and there

Adhere to the style described at the top of i915_reg.h.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0bbb79008bb83bc56669a1e969978769539d6c62.1725974820.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 months agodrm/i915/reg: fix DIP CTL register style
Jani Nikula [Tue, 10 Sep 2024 13:28:52 +0000 (16:28 +0300)]
drm/i915/reg: fix DIP CTL register style

Adhere to the style described at the top of i915_reg.h.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/fdc607b716cf86b8bc88c15a43bc7088c5aab05f.1725974820.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>