Skip to content

Commit 9bffa1a

Browse files
committed
Merge tag 'drm-fixes-2025-01-17' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Final(?) set of fixes for 6.13, I think the holidays finally caught up with everyone, the misc changes are 2 weeks worth, otherwise amdgpu and xe are most of it. The largest pieces is a new test so I'm not too worried about that. kunit: - Fix W=1 build for kunit tests bridge: - Handle YCbCr420 better in bridge code, with tests - itee-it6263 error handling fix amdgpu: - SMU 13 fix - DP MST fixes - DCN 3.5 fix - PSR fixes - eDP fix - VRR fix - Enforce isolation fixes - GFX 12 fix - PSP 14.x fix xe: - Add steering info support for GuC register lists - Add means to wait for reset and synchronous reset - Make changing ccs_mode a synchronous action - Add missing mux registers - Mark ComputeCS read mode as UC on iGPU, unblocking ULLS on iGPU i915: - Relax clear color alignment to 64 bytes [fb] v3d: - Fix warn when unloading v3d nouveau: - Fix cross-device fence handling in nouveau - Fix backlight regression for macbooks 5,1 vmwgfx: - Fix BO reservation handling in vmwgfx" * tag 'drm-fixes-2025-01-17' of https://gitlab.freedesktop.org/drm/kernel: (33 commits) drm/xe: Mark ComputeCS read mode as UC on iGPU drm/xe/oa: Add missing VISACTL mux registers drm/xe: make change ccs_mode a synchronous action drm/xe: introduce xe_gt_reset and xe_gt_wait_for_reset drm/xe/guc: Adding steering info support for GuC register lists drm/bridge: ite-it6263: Prevent error pointer dereference in probe() drm/v3d: Ensure job pointer is set to NULL after job completion drm/vmwgfx: Add new keep_resv BO param drm/vmwgfx: Remove busy_places drm/vmwgfx: Unreserve BO on error drm/amdgpu: fix fw attestation for MP0_14_0_{2/3} drm/amdgpu: always sync the GFX pipe on ctx switch drm/amdgpu: disable gfxoff with the compute workload on gfx12 drm/amdgpu: Fix Circular Locking Dependency in AMDGPU GFX Isolation drm/i915/fb: Relax clear color alignment to 64 bytes drm/amd/display: Disable replay and psr while VRR is enabled drm/amd/display: Fix PSR-SU not support but still call the amdgpu_dm_psr_enable nouveau/fence: handle cross device fences properly drm/tests: connector: Add ycbcr_420_allowed tests drm/connector: hdmi: Validate supported_formats matches ycbcr_420_allowed ...
2 parents a634dda + 9b1c673 commit 9bffa1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+324
-109
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,9 @@ int amdgpu_amdkfd_submit_ib(struct amdgpu_device *adev,
715715
void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
716716
{
717717
enum amd_powergating_state state = idle ? AMD_PG_STATE_GATE : AMD_PG_STATE_UNGATE;
718-
if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 11 &&
719-
((adev->mes.kiq_version & AMDGPU_MES_VERSION_MASK) <= 64)) {
718+
if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 11 &&
719+
((adev->mes.kiq_version & AMDGPU_MES_VERSION_MASK) <= 64)) ||
720+
(IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 12)) {
720721
pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
721722
amdgpu_gfx_off_ctrl(adev, idle);
722723
} else if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 9) &&

drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ static int amdgpu_is_fw_attestation_supported(struct amdgpu_device *adev)
122122
if (adev->flags & AMD_IS_APU)
123123
return 0;
124124

125+
if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(14, 0, 2) ||
126+
amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(14, 0, 3))
127+
return 0;
128+
125129
if (adev->asic_type >= CHIP_SIENNA_CICHLID)
126130
return 1;
127131

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,7 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
19891989
{
19901990
struct amdgpu_device *adev = ring->adev;
19911991
u32 idx;
1992+
bool sched_work = false;
19921993

19931994
if (!adev->gfx.enable_cleaner_shader)
19941995
return;
@@ -2007,15 +2008,19 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
20072008
mutex_lock(&adev->enforce_isolation_mutex);
20082009
if (adev->enforce_isolation[idx]) {
20092010
if (adev->kfd.init_complete)
2010-
amdgpu_gfx_kfd_sch_ctrl(adev, idx, false);
2011+
sched_work = true;
20112012
}
20122013
mutex_unlock(&adev->enforce_isolation_mutex);
2014+
2015+
if (sched_work)
2016+
amdgpu_gfx_kfd_sch_ctrl(adev, idx, false);
20132017
}
20142018

20152019
void amdgpu_gfx_enforce_isolation_ring_end_use(struct amdgpu_ring *ring)
20162020
{
20172021
struct amdgpu_device *adev = ring->adev;
20182022
u32 idx;
2023+
bool sched_work = false;
20192024

20202025
if (!adev->gfx.enable_cleaner_shader)
20212026
return;
@@ -2031,9 +2036,12 @@ void amdgpu_gfx_enforce_isolation_ring_end_use(struct amdgpu_ring *ring)
20312036
mutex_lock(&adev->enforce_isolation_mutex);
20322037
if (adev->enforce_isolation[idx]) {
20332038
if (adev->kfd.init_complete)
2034-
amdgpu_gfx_kfd_sch_ctrl(adev, idx, true);
2039+
sched_work = true;
20352040
}
20362041
mutex_unlock(&adev->enforce_isolation_mutex);
2042+
2043+
if (sched_work)
2044+
amdgpu_gfx_kfd_sch_ctrl(adev, idx, true);
20372045
}
20382046

20392047
/*

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
193193
need_ctx_switch = ring->current_ctx != fence_ctx;
194194
if (ring->funcs->emit_pipeline_sync && job &&
195195
((tmp = amdgpu_sync_get_fence(&job->explicit_sync)) ||
196-
(amdgpu_sriov_vf(adev) && need_ctx_switch) ||
197-
amdgpu_vm_need_pipeline_sync(ring, job))) {
196+
need_ctx_switch || amdgpu_vm_need_pipeline_sync(ring, job))) {
197+
198198
need_pipe_sync = true;
199199

200200
if (tmp)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8896,6 +8896,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
88968896
struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;
88978897
struct amdgpu_dm_connector *aconn =
88988898
(struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context;
8899+
bool vrr_active = amdgpu_dm_crtc_vrr_active(acrtc_state);
88998900

89008901
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
89018902
if (pr->config.replay_supported && !pr->replay_feature_enabled)
@@ -8922,14 +8923,15 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
89228923
* adequate number of fast atomic commits to notify KMD
89238924
* of update events. See `vblank_control_worker()`.
89248925
*/
8925-
if (acrtc_attach->dm_irq_params.allow_sr_entry &&
8926+
if (!vrr_active &&
8927+
acrtc_attach->dm_irq_params.allow_sr_entry &&
89268928
#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
89278929
!amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&
89288930
#endif
89298931
(current_ts - psr->psr_dirty_rects_change_timestamp_ns) > 500000000) {
89308932
if (pr->replay_feature_enabled && !pr->replay_allow_active)
89318933
amdgpu_dm_replay_enable(acrtc_state->stream, true);
8932-
if (psr->psr_version >= DC_PSR_VERSION_SU_1 &&
8934+
if (psr->psr_version == DC_PSR_VERSION_SU_1 &&
89338935
!psr->psr_allow_active && !aconn->disallow_edp_enter_psr)
89348936
amdgpu_dm_psr_enable(acrtc_state->stream);
89358937
}
@@ -9100,7 +9102,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
91009102
acrtc_state->stream->link->psr_settings.psr_dirty_rects_change_timestamp_ns =
91019103
timestamp_ns;
91029104
if (acrtc_state->stream->link->psr_settings.psr_allow_active)
9103-
amdgpu_dm_psr_disable(acrtc_state->stream);
9105+
amdgpu_dm_psr_disable(acrtc_state->stream, true);
91049106
mutex_unlock(&dm->dc_lock);
91059107
}
91069108
}
@@ -9266,11 +9268,11 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
92669268
bundle->stream_update.abm_level = &acrtc_state->abm_level;
92679269

92689270
mutex_lock(&dm->dc_lock);
9269-
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
9271+
if ((acrtc_state->update_type > UPDATE_TYPE_FAST) || vrr_active) {
92709272
if (acrtc_state->stream->link->replay_settings.replay_allow_active)
92719273
amdgpu_dm_replay_disable(acrtc_state->stream);
92729274
if (acrtc_state->stream->link->psr_settings.psr_allow_active)
9273-
amdgpu_dm_psr_disable(acrtc_state->stream);
9275+
amdgpu_dm_psr_disable(acrtc_state->stream, true);
92749276
}
92759277
mutex_unlock(&dm->dc_lock);
92769278

@@ -11379,6 +11381,25 @@ static int dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
1137911381
return 0;
1138011382
}
1138111383

11384+
static bool amdgpu_dm_crtc_mem_type_changed(struct drm_device *dev,
11385+
struct drm_atomic_state *state,
11386+
struct drm_crtc_state *crtc_state)
11387+
{
11388+
struct drm_plane *plane;
11389+
struct drm_plane_state *new_plane_state, *old_plane_state;
11390+
11391+
drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) {
11392+
new_plane_state = drm_atomic_get_plane_state(state, plane);
11393+
old_plane_state = drm_atomic_get_plane_state(state, plane);
11394+
11395+
if (old_plane_state->fb && new_plane_state->fb &&
11396+
get_mem_type(old_plane_state->fb) != get_mem_type(new_plane_state->fb))
11397+
return true;
11398+
}
11399+
11400+
return false;
11401+
}
11402+
1138211403
/**
1138311404
* amdgpu_dm_atomic_check() - Atomic check implementation for AMDgpu DM.
1138411405
*
@@ -11576,10 +11597,6 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
1157611597

1157711598
/* Remove exiting planes if they are modified */
1157811599
for_each_oldnew_plane_in_descending_zpos(state, plane, old_plane_state, new_plane_state) {
11579-
if (old_plane_state->fb && new_plane_state->fb &&
11580-
get_mem_type(old_plane_state->fb) !=
11581-
get_mem_type(new_plane_state->fb))
11582-
lock_and_validation_needed = true;
1158311600

1158411601
ret = dm_update_plane_state(dc, state, plane,
1158511602
old_plane_state,
@@ -11874,9 +11891,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
1187411891

1187511892
/*
1187611893
* Only allow async flips for fast updates that don't change
11877-
* the FB pitch, the DCC state, rotation, etc.
11894+
* the FB pitch, the DCC state, rotation, mem_type, etc.
1187811895
*/
11879-
if (new_crtc_state->async_flip && lock_and_validation_needed) {
11896+
if (new_crtc_state->async_flip &&
11897+
(lock_and_validation_needed ||
11898+
amdgpu_dm_crtc_mem_type_changed(dev, state, new_crtc_state))) {
1188011899
drm_dbg_atomic(crtc->dev,
1188111900
"[CRTC:%d:%s] async flips are only supported for fast updates\n",
1188211901
crtc->base.id, crtc->name);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ struct amdgpu_dm_connector {
697697
struct drm_dp_mst_port *mst_output_port;
698698
struct amdgpu_dm_connector *mst_root;
699699
struct drm_dp_aux *dsc_aux;
700+
uint32_t mst_local_bw;
701+
uint16_t vc_full_pbn;
700702
struct mutex handle_mst_msg_ready;
701703

702704
/* TODO see if we can merge with ddc_bus or make a dm_connector */

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "amdgpu_dm.h"
3131
#include "dc.h"
3232
#include "amdgpu_securedisplay.h"
33+
#include "amdgpu_dm_psr.h"
3334

3435
static const char *const pipe_crc_sources[] = {
3536
"none",
@@ -224,6 +225,10 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
224225

225226
mutex_lock(&adev->dm.dc_lock);
226227

228+
/* For PSR1, check that the panel has exited PSR */
229+
if (stream_state->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1)
230+
amdgpu_dm_psr_wait_disable(stream_state);
231+
227232
/* Enable or disable CRTC CRC generation */
228233
if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
229234
if (!dc_stream_configure_crc(stream_state->ctx->dc,
@@ -357,6 +362,17 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
357362

358363
}
359364

365+
/*
366+
* Reading the CRC requires the vblank interrupt handler to be
367+
* enabled. Keep a reference until CRC capture stops.
368+
*/
369+
enabled = amdgpu_dm_is_valid_crc_source(cur_crc_src);
370+
if (!enabled && enable) {
371+
ret = drm_crtc_vblank_get(crtc);
372+
if (ret)
373+
goto cleanup;
374+
}
375+
360376
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
361377
/* Reset secure_display when we change crc source from debugfs */
362378
amdgpu_dm_set_crc_window_default(crtc, crtc_state->stream);
@@ -367,16 +383,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
367383
goto cleanup;
368384
}
369385

370-
/*
371-
* Reading the CRC requires the vblank interrupt handler to be
372-
* enabled. Keep a reference until CRC capture stops.
373-
*/
374-
enabled = amdgpu_dm_is_valid_crc_source(cur_crc_src);
375386
if (!enabled && enable) {
376-
ret = drm_crtc_vblank_get(crtc);
377-
if (ret)
378-
goto cleanup;
379-
380387
if (dm_is_crc_source_dprx(source)) {
381388
if (drm_dp_start_crc(aux, crtc)) {
382389
DRM_DEBUG_DRIVER("dp start crc failed\n");

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable)
9393
return rc;
9494
}
9595

96-
bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state)
96+
bool amdgpu_dm_crtc_vrr_active(const struct dm_crtc_state *dm_state)
9797
{
9898
return dm_state->freesync_config.state == VRR_STATE_ACTIVE_VARIABLE ||
9999
dm_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;
@@ -142,7 +142,7 @@ static void amdgpu_dm_crtc_set_panel_sr_feature(
142142
amdgpu_dm_replay_enable(vblank_work->stream, true);
143143
} else if (vblank_enabled) {
144144
if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 && is_sr_active)
145-
amdgpu_dm_psr_disable(vblank_work->stream);
145+
amdgpu_dm_psr_disable(vblank_work->stream, false);
146146
} else if (link->psr_settings.psr_feature_enabled &&
147147
allow_sr_entry && !is_sr_active && !is_crc_window_active) {
148148

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable);
3737

3838
bool amdgpu_dm_crtc_vrr_active_irq(struct amdgpu_crtc *acrtc);
3939

40-
bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state);
40+
bool amdgpu_dm_crtc_vrr_active(const struct dm_crtc_state *dm_state);
4141

4242
int amdgpu_dm_crtc_enable_vblank(struct drm_crtc *crtc);
4343

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3606,7 +3606,7 @@ static int crc_win_update_set(void *data, u64 val)
36063606
/* PSR may write to OTG CRC window control register,
36073607
* so close it before starting secure_display.
36083608
*/
3609-
amdgpu_dm_psr_disable(acrtc->dm_irq_params.stream);
3609+
amdgpu_dm_psr_disable(acrtc->dm_irq_params.stream, true);
36103610

36113611
spin_lock_irq(&adev_to_drm(adev)->event_lock);
36123612

0 commit comments

Comments
 (0)