drm/amdgpu/display: fix logic inversion in program_timing_sync()
Subsystems (3)
PATCH 1/1 drm/amdgpu/display: fix logic inversion in program_timing_sync()
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false; } -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--;
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Ping?
Quoted 28 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +2
-3@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false; } -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --
Quoted 2 lines
2.24.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Comments inline.
Quoted 21 lines · Alex Deucher
Ping?
Quoted 18 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false;
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1006
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-1} -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */
This took a while to wrap my head around but I think I understand what this was originally trying to do.
The original logic seems to have been checking for blanked streams and trying to remove anything that was blanked from the group to try and avoid having to enable timing synchronization.
However, 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.
The problem is really this iteration below:
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1007
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0for (j = j +1 ; j < group_size; j++) {
There could still be pipes in here (depending on the ordering) that have planes and could be synchronized with the master OTG. I think starting at j + 1 is a mistake for this logic as well.
I wonder if we can just drop this loop altogether. If we add planes or unblank the OTG later then we'll still want the synchronization.
Dymtro, Wenjing - feel free to correct my understanding if I'm mistaken about this.
Regards,
Nicholas Kazlauskas
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2-if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --2.24.1
Quoted 5 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 49 lines · Nicholas
Comments inline.
Quoted 21 lines · Alex Deucher
Ping?
Quoted 18 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false;Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1006
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-1} -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ This took a while to wrap my head around but I think I understand what this was originally trying to do.
The original logic seems to have been checking for blanked streams and trying to remove anything that was blanked from the group to try and avoid having to enable timing synchronization.
However, 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.The problem is really this iteration below:
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1007
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0for (j = j +1 ; j < group_size; j++) {There could still be pipes in here (depending on the ordering) that have planes and could be synchronized with the master OTG. I think starting at j + 1 is a mistake for this logic as well.
Quoted 5 lines
I wonder if we can just drop this loop altogether. If we add planes or unblank the OTG later then we'll still want the synchronization.
Dymtro, Wenjing - feel free to correct my understanding if I'm mistaken about this.
Ping? Any thoughts on this? It would be nice to get this fixed.
Alex
Quoted 18 lines
Regards,
Nicholas KazlauskasQuoted 13 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2-if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --2.24.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Ping again?
Alex
Quoted 55 lines · Alex Deucher
Quoted 52 lines · Nicholas
Comments inline.
Quoted 21 lines · Alex Deucher
Ping?
Quoted 18 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false;Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1006
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-1} -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ This took a while to wrap my head around but I think I understand what this was originally trying to do.
The original logic seems to have been checking for blanked streams and trying to remove anything that was blanked from the group to try and avoid having to enable timing synchronization.
However, 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.The problem is really this iteration below:
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1007
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0for (j = j +1 ; j < group_size; j++) {There could still be pipes in here (depending on the ordering) that have planes and could be synchronized with the master OTG. I think starting at j + 1 is a mistake for this logic as well.
I wonder if we can just drop this loop altogether. If we add planes or unblank the OTG later then we'll still want the synchronization.
Quoted 26 lines
Quoted 2 lines
Dymtro, Wenjing - feel free to correct my understanding if I'm mistaken about this.
Ping? Any thoughts on this? It would be nice to get this fixed.
Alex
Quoted 18 lines
Regards,
Nicholas KazlauskasQuoted 13 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2-if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --2.24.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Can we apply this for now until we can get further analysis on the actual root cause?
Alex
Quoted 87 lines · Alex Deucher
Ping again?
Alex
Quoted 81 lines · Alex Deucher
Quoted 49 lines · Nicholas
Comments inline.
Quoted 21 lines · Alex Deucher
Ping?
Quoted 18 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false;Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1006
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-1} -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ This took a while to wrap my head around but I think I understand what this was originally trying to do.
The original logic seems to have been checking for blanked streams and trying to remove anything that was blanked from the group to try and avoid having to enable timing synchronization.
However, 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.The problem is really this iteration below:
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1007
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0for (j = j +1 ; j < group_size; j++) {There could still be pipes in here (depending on the ordering) that have planes and could be synchronized with the master OTG. I think starting at j + 1 is a mistake for this logic as well.
Quoted 5 lines
I wonder if we can just drop this loop altogether. If we add planes or unblank the OTG later then we'll still want the synchronization.
Dymtro, Wenjing - feel free to correct my understanding if I'm mistaken about this.
Ping? Any thoughts on this? It would be nice to get this fixed.
Alex
Quoted 18 lines
Regards,
Nicholas KazlauskasQuoted 13 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2-if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --2.24.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I still think we should just drop the reduction loop.
The problem with checking plane_state at all is that this logic will always be broken - plane_state isn't a good indicator of whether the stream is blanked or not since we can leave an OTG running with no planes at all while unblanked.
Regards,
Nicholas Kazlauskas
Quoted 93 lines · Alex Deucher
Can we apply this for now until we can get further analysis on the actual root cause?
Alex
Quoted 87 lines · Alex Deucher
Ping again?
Alex
Quoted 81 lines · Alex Deucher
Quoted 49 lines · Nicholas
Comments inline.
Quoted 21 lines · Alex Deucher
Ping?
Quoted 18 lines · Alex Deucher
It looks like we should be reducing the group size when we don't have a plane rather than when we do.
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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1003,9 +1003,9 @@ static void program_timing_sync( status->timing_sync_info.master = false;Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1006
Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-1} -/* remove any other pipes with plane as they have already been synced */ +/* remove any other pipes without plane as they have already been synced */ This took a while to wrap my head around but I think I understand what this was originally trying to do.
The original logic seems to have been checking for blanked streams and trying to remove anything that was blanked from the group to try and avoid having to enable timing synchronization.
However, 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.The problem is really this iteration below:
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c static void program_timing_sync( · line 1007
Quoted 1 line
drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0for (j = j +1 ; j < group_size; j++) {There could still be pipes in here (depending on the ordering) that have planes and could be synchronized with the master OTG. I think starting at j + 1 is a mistake for this logic as well.
Quoted 5 lines
I wonder if we can just drop this loop altogether. If we add planes or unblank the OTG later then we'll still want the synchronization.
Dymtro, Wenjing - feel free to correct my understanding if I'm mistaken about this.
Ping? Any thoughts on this? It would be nice to get this fixed.
Alex
Quoted 18 lines
Regards,
Nicholas KazlauskasQuoted 13 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-2-if (pipe_set[j]->plane_state) { +if (!pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--; --2.24.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx