drm/amdgpu/display: drop the reduction loop when setting the sync groups
Subsystems (3)
PATCH 1/1 drm/amdgpu/display: drop the reduction loop when setting the sync groups
The logic for blanked is not the same as having a plane_state. Technically you can drive an OTG without anything connected in the front end and it'll just draw out the back color which is distinct from having the OTG be blanked. If we add planes or unblank the OTG later then we'll still want the synchronization.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -8
@@ -1040,14 +1040,6 @@ static void program_timing_sync( status->timing_sync_info.master = false; } -/* remove any other pipes with plane as they have already been synced */ -for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { - group_size--; - pipe_set[j] = pipe_set[group_size]; - j--; - } - }if (group_size >1 ) { dc->hwss.enable_timing_synchronization(
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 19 lines · Alex Deucher
The logic for blanked is not the same as having a
plane_state. Technically you can drive an OTG without anything connected in the front end and it'll just draw out the back color which is distinct from having the OTG be blanked. If we add planes or unblank the OTG later then we'll still want the synchronization.Fixes 5fc0cbfad45648 ("drm/amd/display: determine if a pipe is synced by plane state")Signed-off-by Alex Deucher <[email protected]> > ---drivers/gpu/drm/amd/display/dc/core/dc.c | 8 -------- 1 file changed, 8 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1040,14 +1040,6 @@ static void program_timing_sync( status->timing_sync_info.master = false;
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1050
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-8} -/* remove any other pipes with plane as they have already been synced */ -for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { - group_size--; - pipe_set[j] = pipe_set[group_size]; - j--; - } - }
Looking at this again, I think I may understand the issue this was trying to work around.
If we try to force timing synchronization on displays that are currently active then this is going to force reset the vertical position, resulting in screen corruption.
So what this logic was attempting to do was ensure that timing synchronization only happens when committing two streams at a time without any image on the screen.
Maybe it'd be best to just blank these streams out first, but for now, let's actually go back to fixing this by applying the actual dpg/tg check that Wenjing suggests, something like:
if (pool->opps[i]->funcs->dpg_is_blanked)
s.blank_enabled =
pool->opps[i]->funcs->dpg_is_blanked(pool->opps[i]);
else
s.blank_enabled = tg->funcs->is_blanked(tg);The reason why we have this issue in the first place is because amdgpu_dm usually commits a dc_state with the planes already in it instead of committing them later, so plane_state not being NULL is typically true.
Regards,
Nicholas Kazlauskas
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync(
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0if (group_size >1 ) { dc->hwss.enable_timing_synchronization(
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 48 lines · Nicholas
Quoted 19 lines · Alex Deucher
The logic for blanked is not the same as having a
plane_state. Technically you can drive an OTG without anything connected in the front end and it'll just draw out the back color which is distinct from having the OTG be blanked. If we add planes or unblank the OTG later then we'll still want the synchronization.Fixes 5fc0cbfad45648 ("drm/amd/display: determine if a pipe is synced by plane state")Signed-off-by Alex Deucher <[email protected]> > ---drivers/gpu/drm/amd/display/dc/core/dc.c | 8 -------- 1 file changed, 8 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1040,14 +1040,6 @@ static void program_timing_sync( status->timing_sync_info.master = false;drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1050
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-8} -/* remove any other pipes with plane as they have already been synced */ -for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { - group_size--; - pipe_set[j] = pipe_set[group_size]; - j--; - } - }Looking at this again, I think I may understand the issue this was trying to work around.
If we try to force timing synchronization on displays that are currently active then this is going to force reset the vertical position, resulting in screen corruption.
So what this logic was attempting to do was ensure that timing synchronization only happens when committing two streams at a time without any image on the screen.
Maybe it'd be best to just blank these streams out first, but for now, let's actually go back to fixing this by applying the actual dpg/tg check that Wenjing suggests, something like:
Quoted 6 lines
if (pool->opps[i]->funcs->dpg_is_blanked)
s.blank_enabled =
pool->opps[i]->funcs->dpg_is_blanked(pool->opps[i]);
else
s.blank_enabled = tg->funcs->is_blanked(tg);Hmm, it's not clear to me where this code needs to go. Can you point me in the right direction or provide a quick patch?
Thanks,
Alex
Quoted 15 lines
The reason why we have this issue in the first place is because
amdgpu_dmusually commits adc_statewith the planes already in it instead of committing them later, soplane_statenot being NULL is typically true.Regards,
Nicholas KazlauskasQuoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0if (group_size >1 ) { dc->hwss.enable_timing_synchronization(
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 57 lines · Alex Deucher
Quoted 48 lines · Nicholas
Quoted 19 lines · Alex Deucher
The logic for blanked is not the same as having a
plane_state. Technically you can drive an OTG without anything connected in the front end and it'll just draw out the back color which is distinct from having the OTG be blanked. If we add planes or unblank the OTG later then we'll still want the synchronization.Fixes 5fc0cbfad45648 ("drm/amd/display: determine if a pipe is synced by plane state")Signed-off-by Alex Deucher <[email protected]> > ---drivers/gpu/drm/amd/display/dc/core/dc.c | 8 -------- 1 file changed, 8 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1040,14 +1040,6 @@ static void program_timing_sync( status->timing_sync_info.master = false;drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1050
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-8} -/* remove any other pipes with plane as they have already been synced */ -for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { - group_size--; - pipe_set[j] = pipe_set[group_size]; - j--; - } - }Looking at this again, I think I may understand the issue this was trying to work around.
If we try to force timing synchronization on displays that are currently active then this is going to force reset the vertical position, resulting in screen corruption.
So what this logic was attempting to do was ensure that timing synchronization only happens when committing two streams at a time without any image on the screen.
Maybe it'd be best to just blank these streams out first, but for now, let's actually go back to fixing this by applying the actual dpg/tg check that Wenjing suggests, something like:
Quoted 6 lines
if (pool->opps[i]->funcs->dpg_is_blanked) s.blank_enabled = pool->opps[i]->funcs->dpg_is_blanked(pool->opps[i]); else s.blank_enabled = tg->funcs->is_blanked(tg);
Quoted 6 lines
Hmm, it's not clear to me where this code needs to go. Can you point me in the right direction or provide a quick patch?
Thanks,
Alex
The old code used to check !tg->funcs->is_blanked(tg) ie. to drop the pipe from the group if it's currently active.
The issue was that on newer ASIC it's now the DPG that's the indicator from the hardware side, so we should replace the !plane_state check with a check first for !dpg_is_blanked and then !is_blanked if the DPG doesn't exist.
Regards,
Nicholas Kazlauskas
Quoted 8 lines
Quoted 8 lines
The reason why we have this issue in the first place is because
amdgpu_dmusually commits adc_statewith the planes already in it instead of committing them later, soplane_statenot being NULL is typically true.
Quoted 8 lines
Quoted 8 lines
Regards,
Nicholas KazlauskasQuoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0if (group_size >1 ) { dc->hwss.enable_timing_synchronization(
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx