drm/amd/display: Reject non-zero src_y and src_x for video planes
Subsystems (3)
Harry Wentland
maintainerPATCH 1/1 drm/amd/display: Reject non-zero src_y and src_x for video planes
[Why]
This hasn't been well tested and leads to complete system hangs on DCN1 based systems, possibly others.
The system hang can be reproduced by gesturing the video on the YouTube Android app on ChromeOS into full screen.
[How]
Reject atomic commits with non-zero drm_plane_state.src_x or src_y values.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -0
@@ -2825,6 +2825,13 @@ static int fill_dc_scaling_info(const struct drm_plane_state *state, scaling_info->src_rect.x = state->src_x >>16 ; scaling_info->src_rect.y = state->src_y >>16 ; + +if (state->fb && + state->fb->format->format ==DRM_FORMAT_NV12 && + (scaling_info->src_rect.x !=0 || + scaling_info->src_rect.y !=0 )) +return -EINVAL ; + scaling_info->src_rect.width = state->src_w >>16 ;if (scaling_info->src_rect.width ==0 )return -EINVAL ;
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Harry Wentland
[Why]
This hasn't been well tested and leads to complete system hangs on DCN1 based systems, possibly others.
Quoted 8 lines
The system hang can be reproduced by gesturing the video on the YouTube Android app on ChromeOS into full screen.
[How]
Reject atomic commits with non-zero drm_plane_state.src_x orsrc_yvalues.Signed-off-by Harry Wentland <[email protected]>Change-Id I5e951f95fc87c86517b9ea6e094d73603184f00b
Drop the Change-ID on submit.
Quoted 9 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int fill_dc_scaling_info(const struct drm_plane_state *state, · line 2834
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7
-0@@ -2825,6 +2825,13 @@ static int fill_dc_scaling_info(const struct drm_plane_state *state, scaling_info->src_rect.x = state->src_x >>16 ; scaling_info->src_rect.y = state->src_y >>16 ; + +if (state->fb && + state->fb->format->format ==DRM_FORMAT_NV12 && + (scaling_info->src_rect.x !=0 || + scaling_info->src_rect.y !=0 )) +return -EINVAL ; +
Would like to see a comment in the source code similar to what's explained in the commit message so if people skim through the code they understand some of the background on this.
I'd also like to know if this is generic across all DCN or specific to DCN1. For now at least we can disable it generically I think.
With the commit message updated and source commented this patch is:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int fill_dc_scaling_info(const struct drm_plane_state *state, · line 2837
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0scaling_info->src_rect.width = state->src_w >>16 ;if (scaling_info->src_rect.width ==0 )return -EINVAL ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx