Skip to content

Commit d89f604

Browse files
Harry Wentlandalexdeucher
authored andcommitted
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. v2: - Add code comment describing the reason we're rejecting non-zero src_x and src_y - Drop gerrit Change-Id - Add stable CC - Based on amd-staging-drm-next v3: removed trailing whitespace Signed-off-by: Harry Wentland <harry.wentland@amd.com> Cc: stable@vger.kernel.org Cc: nicholas.kazlauskas@amd.com Cc: amd-gfx@lists.freedesktop.org Cc: alexander.deucher@amd.com Cc: Roman.Li@amd.com Cc: hersenxs.wu@amd.com Cc: danny.wang@amd.com Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent a1a1ca7 commit d89f604

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,6 +4008,23 @@ static int fill_dc_scaling_info(const struct drm_plane_state *state,
40084008
scaling_info->src_rect.x = state->src_x >> 16;
40094009
scaling_info->src_rect.y = state->src_y >> 16;
40104010

4011+
/*
4012+
* For reasons we don't (yet) fully understand a non-zero
4013+
* src_y coordinate into an NV12 buffer can cause a
4014+
* system hang. To avoid hangs (and maybe be overly cautious)
4015+
* let's reject both non-zero src_x and src_y.
4016+
*
4017+
* We currently know of only one use-case to reproduce a
4018+
* scenario with non-zero src_x and src_y for NV12, which
4019+
* is to gesture the YouTube Android app into full screen
4020+
* on ChromeOS.
4021+
*/
4022+
if (state->fb &&
4023+
state->fb->format->format == DRM_FORMAT_NV12 &&
4024+
(scaling_info->src_rect.x != 0 ||
4025+
scaling_info->src_rect.y != 0))
4026+
return -EINVAL;
4027+
40114028
scaling_info->src_rect.width = state->src_w >> 16;
40124029
if (scaling_info->src_rect.width == 0)
40134030
return -EINVAL;

0 commit comments

Comments
 (0)