From: Harry Wentland <harry.wentland@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
amd-gfx@lists.freedesktop.org
Cc: danny.wang@amd.com, Roman.Li@amd.com, stable@vger.kernel.org,
hersenxs.wu@amd.com, alexander.deucher@amd.com,
nicholas.kazlauskas@amd.com
Subject: Re: [PATCH v2] drm/amd/display: Reject non-zero src_y and src_x for video planes
Date: Fri, 23 Apr 2021 10:25:58 -0400 [thread overview]
Message-ID: <b3ea9558-52ff-0c0b-0766-ad6e55f6e49e@amd.com> (raw)
In-Reply-To: <49d21b75-eaf7-5e24-7a16-480698e1498c@gmail.com>
On 2021-04-23 10:18 a.m., Christian König wrote:
> Good that this has been found. Just a curious guess, but have you guys
> checked if the src_x and src_y are a multiple of 2?
>
That was one of my first guesses but I still observed the hang after
forcing src_x and src_y to be multiples of 2.
> Might cause problems to try to access a subsampled surface if the
> coordinates doesn't make much sense.
>
> Anyway patch is Acked-by: Christian König <christian.koenig@amd.com>
>
Thanks,
Harry
> Regards,
> Christian.
>
> Am 23.04.21 um 16:09 schrieb Harry Wentland:
>> [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
>>
>> 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>
>> ---
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index be1769d29742..b12469043e6b 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -4089,6 +4089,23 @@ 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;
>> + /*
>> + * For reasons we don't (yet) fully understand a non-zero
>> + * src_y coordinate into an NV12 buffer can cause a
>> + * system hang. To avoid hangs (and maybe be overly cautious)
>> + * let's reject both non-zero src_x and src_y.
>> + *
>> + * We currently know of only one use-case to reproduce a
>> + * scenario with non-zero src_x and src_y for NV12, which
>> + * is to gesture the YouTube Android app into full screen
>> + * on ChromeOS.
>> + */
>> + 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;
>
prev parent reply other threads:[~2021-04-23 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 14:09 [PATCH v2] drm/amd/display: Reject non-zero src_y and src_x for video planes Harry Wentland
2021-04-23 14:18 ` Christian König
2021-04-23 14:25 ` Harry Wentland [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3ea9558-52ff-0c0b-0766-ad6e55f6e49e@amd.com \
--to=harry.wentland@amd.com \
--cc=Roman.Li@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=danny.wang@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).