[PATCH 4/4] drm/amd/display: Update HW_DONE_DEADLINE property value on modeset

Michel Dänzer michel at daenzer.net
Mon Aug 4 08:20:54 UTC 2025


On 31.07.25 22:51, Harry Wentland wrote:
> Thanks for the series. It makes sense to me.

I'm glad to hear it, thanks for taking a look.

May I take this as R-b?


>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index 0b8ac9edc070..e78249b55345 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -10021,6 +10021,21 @@ static void dm_set_writeback(struct amdgpu_display_manager *dm,
>>  	drm_writeback_queue_job(wb_conn, new_con_state);
>>  }
>>  
>> +static void
>> +update_hw_done_deadline(struct dm_crtc_state *dm_new_crtc_state)
>> +{
>> +	struct dc_stream_state *stream = dm_new_crtc_state->stream;
>> +	struct dc_crtc_timing *timing = &stream->timing;
>> +	struct drm_crtc *crtc = dm_new_crtc_state->base.crtc;
>> +	uint32_t deadline_lines, deadline_us;
>> +
>> +	/* XXX: My guess, AMD display team to the rescue! */
>> +	deadline_lines = timing->v_total - timing->v_addressable - timing->v_front_porch;
> 
> This works on DCE. On DCN we'll need to take the offset into account.
> This diff on top of your changesshould do it, but it's not tested.
> The dc_stream changes probably fit in their own patch.

Thanks, I'll incorporate it.


> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 629fd21a611f..314074527216 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -10082,11 +10082,19 @@ update_hw_done_deadline(struct dm_crtc_state *dm_new_crtc_state)
>         struct dc_crtc_timing *timing = &stream->timing;
>         struct drm_crtc *crtc = dm_new_crtc_state->base.crtc;
>         uint32_t deadline_lines, deadline_us;
> +       int vupdate_offset = dc_stream_get_vupdate_offset_from_vsync(stream);
> +
> +       /* note:
> +        * vupdate_offset is non-existant on DCE and function will return 0
> +        * vupdate_offset could be positive or negative on DCN
> +        * vupdate_offset depends on timing and HW bandwidth requirements
> +        */
> +       deadline_lines = timing->v_total - timing->v_addressable -
> +                        timing->v_front_porch - vupdate_offset;
Hmm, if it depends on bandwidth, we'll need to recalculate it for all CRTCs after a modeset for any of them, right?


-- 
Earthling Michel Dänzer       \        GNOME / Xwayland / Mesa developer
https://redhat.com             \               Libre software enthusiast


More information about the amd-gfx mailing list