Skip to content

Commit 12b6c62

Browse files
committed
Merge tag 'drm-fixes-2025-05-17' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Weekly drm fixes, I'll be honest and say I think this is larger than I'd prefer at this point, the main blow out point is that xe has two larger fixes. One is a fix for active context utilisation reporting, it's for a reported regression and will end up in stable anyways, so I don't see any point in holding it up. The second is a fix for mixed cpu/gpu atomics, which are currently broken, but are also not something your average desktop/laptop user is going to hit in normal operation, and having them fixed now is better than threading them through stable later. Other than those, it's mostly the usual, a bunch of amdgpu randoms and a few other minor fixes. dma-buf: - Avoid memory reordering in fence handling meson: - Avoid integer overflow in mode-clock calculations panel-mipi-dbi: - Fix output with drm_client_setup_with_fourcc() amdgpu: - Fix CSA unmap - Fix MALL size reporting on GFX11.5 - AUX fix - DCN 3.5 fix - VRR fix - DP MST fix - DML 2.1 fixes - Silence DP AUX spam - DCN 4.0.1 cursor fix - VCN 4.0.5 fix ivpu: - Fix buffer size in debugfs code gpuvm: - Add timeslicing and allocation restriction for SVM xe: - Fix shrinker debugfs name - Add HW workaround to Xe2 - Fix SVM when mixing GPU and CPU atomics - Fix per client engine utilization due to active contexts not saving timestamp with lite restore enabled" * tag 'drm-fixes-2025-05-17' of https://gitlab.freedesktop.org/drm/kernel: (24 commits) drm/xe: Add WA BB to capture active context utilization drm/xe: Save the gt pointer in lrc and drop the tile drm/xe: Save CTX_TIMESTAMP mmio value instead of LRC value drm/xe: Timeslice GPU on atomic SVM fault drm/gpusvm: Add timeslicing support to GPU SVM drm/xe: Strict migration policy for atomic SVM faults drm/gpusvm: Introduce devmem_only flag for allocation drm/xe/xe2hpg: Add Wa_22021007897 drm/amdgpu: read back register after written for VCN v4.0.5 Revert "drm/amd/display: Hardware cursor changes color when switched to software cursor" dma-buf: insert memory barrier before updating num_fences drm/xe: Fix the gem shrinker name drm/amd/display: Avoid flooding unnecessary info messages drm/amd/display: Fix null check of pipe_ctx->plane_state for update_dchubp_dpp drm/amd/display: check stream id dml21 wrapper to get plane_id drm/amd/display: fix link_set_dpms_off multi-display MST corner case drm/amd/display: Defer BW-optimization-blocked DRR adjustments Revert: "drm/amd/display: Enable urgent latency adjustment on DCN35" drm/amd/display: Correct the reply value when AUX write incomplete drm/amdgpu: fix incorrect MALL size for GFX1151 ...
2 parents 450d2f6 + c81dbc4 commit 12b6c62

38 files changed

+474
-121
lines changed

drivers/accel/ivpu/ivpu_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ priority_bands_fops_write(struct file *file, const char __user *user_buf, size_t
455455
if (ret < 0)
456456
return ret;
457457

458-
buf[size] = '\0';
458+
buf[ret] = '\0';
459459
ret = sscanf(buf, "%u %u %u %u", &band, &grace_period, &process_grace_period,
460460
&process_quantum);
461461
if (ret != 4)

drivers/dma-buf/dma-resv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ void dma_resv_add_fence(struct dma_resv *obj, struct dma_fence *fence,
320320
count++;
321321

322322
dma_resv_list_set(fobj, i, fence, usage);
323-
/* pointer update must be visible before we extend the num_fences */
324-
smp_store_mb(fobj->num_fences, count);
323+
/* fence update must be visible before we extend the num_fences */
324+
smp_wmb();
325+
fobj->num_fences = count;
325326
}
326327
EXPORT_SYMBOL(dma_resv_add_fence);
327328

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int amdgpu_unmap_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,
109109
struct drm_exec exec;
110110
int r;
111111

112-
drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
112+
drm_exec_init(&exec, 0, 0);
113113
drm_exec_until_all_locked(&exec) {
114114
r = amdgpu_vm_lock_pd(vm, &exec, 0);
115115
if (likely(!r))

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,18 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
752752
adev->gmc.vram_type = vram_type;
753753
adev->gmc.vram_vendor = vram_vendor;
754754

755+
/* The mall_size is already calculated as mall_size_per_umc * num_umc.
756+
* However, for gfx1151, which features a 2-to-1 UMC mapping,
757+
* the result must be multiplied by 2 to determine the actual mall size.
758+
*/
759+
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
760+
case IP_VERSION(11, 5, 1):
761+
adev->gmc.mall_size *= 2;
762+
break;
763+
default:
764+
break;
765+
}
766+
755767
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
756768
case IP_VERSION(11, 0, 0):
757769
case IP_VERSION(11, 0, 1):

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,10 @@ static int vcn_v4_0_5_start_dpg_mode(struct amdgpu_vcn_inst *vinst,
10231023
ring->doorbell_index << VCN_RB1_DB_CTRL__OFFSET__SHIFT |
10241024
VCN_RB1_DB_CTRL__EN_MASK);
10251025

1026+
/* Keeping one read-back to ensure all register writes are done, otherwise
1027+
* it may introduce race conditions */
1028+
RREG32_SOC15(VCN, inst_idx, regVCN_RB1_DB_CTRL);
1029+
10261030
return 0;
10271031
}
10281032

@@ -1205,6 +1209,10 @@ static int vcn_v4_0_5_start(struct amdgpu_vcn_inst *vinst)
12051209
WREG32_SOC15(VCN, i, regVCN_RB_ENABLE, tmp);
12061210
fw_shared->sq.queue_mode &= ~(FW_QUEUE_RING_RESET | FW_QUEUE_DPG_HOLD_OFF);
12071211

1212+
/* Keeping one read-back to ensure all register writes are done, otherwise
1213+
* it may introduce race conditions */
1214+
RREG32_SOC15(VCN, i, regVCN_RB_ENABLE);
1215+
12081216
return 0;
12091217
}
12101218

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ get_crtc_by_otg_inst(struct amdgpu_device *adev,
372372
static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
373373
struct dm_crtc_state *new_state)
374374
{
375+
if (new_state->stream->adjust.timing_adjust_pending)
376+
return true;
375377
if (new_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED)
376378
return true;
377379
else if (amdgpu_dm_crtc_vrr_active(old_state) != amdgpu_dm_crtc_vrr_active(new_state))
@@ -12763,7 +12765,8 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(
1276312765
/* The reply is stored in the top nibble of the command. */
1276412766
payload->reply[0] = (adev->dm.dmub_notify->aux_reply.command >> 4) & 0xF;
1276512767

12766-
if (!payload->write && p_notify->aux_reply.length)
12768+
/*write req may receive a byte indicating partially written number as well*/
12769+
if (p_notify->aux_reply.length)
1276712770
memcpy(payload->data, p_notify->aux_reply.data,
1276812771
p_notify->aux_reply.length);
1276912772

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
6262
enum aux_return_code_type operation_result;
6363
struct amdgpu_device *adev;
6464
struct ddc_service *ddc;
65+
uint8_t copy[16];
6566

6667
if (WARN_ON(msg->size > 16))
6768
return -E2BIG;
@@ -77,6 +78,11 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
7778
(msg->request & DP_AUX_I2C_WRITE_STATUS_UPDATE) != 0;
7879
payload.defer_delay = 0;
7980

81+
if (payload.write) {
82+
memcpy(copy, msg->buffer, msg->size);
83+
payload.data = copy;
84+
}
85+
8086
result = dc_link_aux_transfer_raw(TO_DM_AUX(aux)->ddc_service, &payload,
8187
&operation_result);
8288

@@ -100,9 +106,9 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
100106
*/
101107
if (payload.write && result >= 0) {
102108
if (result) {
103-
/*one byte indicating partially written bytes. Force 0 to retry*/
104-
drm_info(adev_to_drm(adev), "amdgpu: AUX partially written\n");
105-
result = 0;
109+
/*one byte indicating partially written bytes*/
110+
drm_dbg_dp(adev_to_drm(adev), "amdgpu: AUX partially written\n");
111+
result = payload.data[0];
106112
} else if (!payload.reply[0])
107113
/*I2C_ACK|AUX_ACK*/
108114
result = msg->size;
@@ -127,11 +133,11 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
127133
break;
128134
}
129135

130-
drm_info(adev_to_drm(adev), "amdgpu: DP AUX transfer fail:%d\n", operation_result);
136+
drm_dbg_dp(adev_to_drm(adev), "amdgpu: DP AUX transfer fail:%d\n", operation_result);
131137
}
132138

133139
if (payload.reply[0])
134-
drm_info(adev_to_drm(adev), "amdgpu: AUX reply command not ACK: 0x%02x.",
140+
drm_dbg_dp(adev_to_drm(adev), "amdgpu: AUX reply command not ACK: 0x%02x.",
135141
payload.reply[0]);
136142

137143
return result;

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,12 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
439439
* Don't adjust DRR while there's bandwidth optimizations pending to
440440
* avoid conflicting with firmware updates.
441441
*/
442-
if (dc->ctx->dce_version > DCE_VERSION_MAX)
443-
if (dc->optimized_required || dc->wm_optimized_required)
442+
if (dc->ctx->dce_version > DCE_VERSION_MAX) {
443+
if (dc->optimized_required || dc->wm_optimized_required) {
444+
stream->adjust.timing_adjust_pending = true;
444445
return false;
446+
}
447+
}
445448

446449
dc_exit_ips_for_hw_access(dc);
447450

@@ -3168,7 +3171,8 @@ static void copy_stream_update_to_stream(struct dc *dc,
31683171

31693172
if (update->crtc_timing_adjust) {
31703173
if (stream->adjust.v_total_min != update->crtc_timing_adjust->v_total_min ||
3171-
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max)
3174+
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max ||
3175+
stream->adjust.timing_adjust_pending)
31723176
update->crtc_timing_adjust->timing_adjust_pending = true;
31733177
stream->adjust = *update->crtc_timing_adjust;
31743178
update->crtc_timing_adjust->timing_adjust_pending = false;

drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = {
195195
.dcn_downspread_percent = 0.5,
196196
.gpuvm_min_page_size_bytes = 4096,
197197
.hostvm_min_page_size_bytes = 4096,
198-
.do_urgent_latency_adjustment = 1,
198+
.do_urgent_latency_adjustment = 0,
199199
.urgent_latency_adjustment_fabric_clock_component_us = 0,
200-
.urgent_latency_adjustment_fabric_clock_reference_mhz = 3000,
200+
.urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
201201
};
202202

203203
void dcn35_build_wm_range_table_fpu(struct clk_mgr *clk_mgr)

drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -910,18 +910,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
910910
}
911911

912912
//TODO : Could be possibly moved to a common helper layer.
913-
static bool dml21_wrapper_get_plane_id(const struct dc_state *context, const struct dc_plane_state *plane, unsigned int *plane_id)
913+
static bool dml21_wrapper_get_plane_id(const struct dc_state *context, unsigned int stream_id, const struct dc_plane_state *plane, unsigned int *plane_id)
914914
{
915915
int i, j;
916916

917917
if (!plane_id)
918918
return false;
919919

920920
for (i = 0; i < context->stream_count; i++) {
921-
for (j = 0; j < context->stream_status[i].plane_count; j++) {
922-
if (context->stream_status[i].plane_states[j] == plane) {
923-
*plane_id = (i << 16) | j;
924-
return true;
921+
if (context->streams[i]->stream_id == stream_id) {
922+
for (j = 0; j < context->stream_status[i].plane_count; j++) {
923+
if (context->stream_status[i].plane_states[j] == plane) {
924+
*plane_id = (i << 16) | j;
925+
return true;
926+
}
925927
}
926928
}
927929
}
@@ -944,14 +946,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
944946
return location;
945947
}
946948

947-
static unsigned int map_plane_to_dml21_display_cfg(const struct dml2_context *dml_ctx,
949+
static unsigned int map_plane_to_dml21_display_cfg(const struct dml2_context *dml_ctx, unsigned int stream_id,
948950
const struct dc_plane_state *plane, const struct dc_state *context)
949951
{
950952
unsigned int plane_id;
951953
int i = 0;
952954
int location = -1;
953955

954-
if (!dml21_wrapper_get_plane_id(context, plane, &plane_id)) {
956+
if (!dml21_wrapper_get_plane_id(context, stream_id, plane, &plane_id)) {
955957
ASSERT(false);
956958
return -1;
957959
}
@@ -1037,7 +1039,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10371039
dml_dispcfg->plane_descriptors[disp_cfg_plane_location].stream_index = disp_cfg_stream_location;
10381040
} else {
10391041
for (plane_index = 0; plane_index < context->stream_status[stream_index].plane_count; plane_index++) {
1040-
disp_cfg_plane_location = map_plane_to_dml21_display_cfg(dml_ctx, context->stream_status[stream_index].plane_states[plane_index], context);
1042+
disp_cfg_plane_location = map_plane_to_dml21_display_cfg(dml_ctx, context->streams[stream_index]->stream_id, context->stream_status[stream_index].plane_states[plane_index], context);
10411043

10421044
if (disp_cfg_plane_location < 0)
10431045
disp_cfg_plane_location = dml_dispcfg->num_planes++;
@@ -1048,7 +1050,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10481050
populate_dml21_plane_config_from_plane_state(dml_ctx, &dml_dispcfg->plane_descriptors[disp_cfg_plane_location], context->stream_status[stream_index].plane_states[plane_index], context, stream_index);
10491051
dml_dispcfg->plane_descriptors[disp_cfg_plane_location].stream_index = disp_cfg_stream_location;
10501052

1051-
if (dml21_wrapper_get_plane_id(context, context->stream_status[stream_index].plane_states[plane_index], &dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id[disp_cfg_plane_location]))
1053+
if (dml21_wrapper_get_plane_id(context, context->streams[stream_index]->stream_id, context->stream_status[stream_index].plane_states[plane_index], &dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id[disp_cfg_plane_location]))
10521054
dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id_valid[disp_cfg_plane_location] = true;
10531055

10541056
/* apply forced pstate policy */

0 commit comments

Comments
 (0)