mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/amd/display: Add debugfs for forcing stream timing sync
[why] There's currently no method to enable multi-stream synchronization from userspace and we don't check the VSDB bits to know whether or not specific displays should have the feature enable. [how] Add a debugfs entry that controls a new DM debug option, "force_timing_sync". This debug option will set on any newly created stream following the change to the debug option. Expose a new interface from DC that performs the timing sync and a helper to the "force_timing_sync" debugfs that iterates over the current streams and modifies the current synchornization state and grouping. Example usage to force a resync (from an X based desktop): echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_force_timing_sync xset dpms force off && xset dpms force on Signed-off-by: Victor Lu <victorchengchi.lu@amd.com> Reviewed-by: Aurabindo Jayamohanan Pillai <Aurabindo.Pillai@amd.com> Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Acked-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -8034,6 +8034,13 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Check VSDB bits to decide whether this should
|
||||
* be enabled or not.
|
||||
*/
|
||||
new_stream->triggered_crtc_reset.enabled =
|
||||
dm->force_timing_sync;
|
||||
|
||||
dm_new_crtc_state->abm_level = dm_new_conn_state->abm_level;
|
||||
|
||||
ret = fill_hdr_info_packet(drm_new_conn_state,
|
||||
@@ -9190,3 +9197,22 @@ static bool amdgpu_dm_psr_disable(struct dc_stream_state *stream)
|
||||
|
||||
return dc_link_set_psr_allow_active(stream->link, false, true);
|
||||
}
|
||||
|
||||
void amdgpu_dm_trigger_timing_sync(struct drm_device *dev)
|
||||
{
|
||||
struct amdgpu_device *adev = dev->dev_private;
|
||||
struct dc *dc = adev->dm.dc;
|
||||
int i;
|
||||
|
||||
mutex_lock(&adev->dm.dc_lock);
|
||||
if (dc->current_state) {
|
||||
for (i = 0; i < dc->current_state->stream_count; ++i)
|
||||
dc->current_state->streams[i]
|
||||
->triggered_crtc_reset.enabled =
|
||||
adev->dm.force_timing_sync;
|
||||
|
||||
dm_enable_per_frame_crtc_master_sync(dc->current_state);
|
||||
dc_trigger_sync(dc, dc->current_state);
|
||||
}
|
||||
mutex_unlock(&adev->dm.dc_lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user