From: Mario Limonciello <mario.limonciello@amd.com>
To: Melissa Wen <mwen@igalia.com>,
Zaeem Mohamed <zaeem.mohamed@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] SWDEV-476969 - dm/amdgpu: Fail dm_atomic_check if cursor overlay is required at MAX_SURFACES
Date: Mon, 18 Nov 2024 08:27:48 -0600 [thread overview]
Message-ID: <cfe6e877-dbae-45ff-bbc0-3968f235370a@amd.com> (raw)
In-Reply-To: <db124999-db4e-4f42-b0ed-86249dd20bbd@igalia.com>
On 11/18/2024 06:52, Melissa Wen wrote:
>
>
>
> On 14/11/2024 16:04, Mario Limonciello wrote:
>> Although it's really useful information for AMD people, the Jira
>> shouldn't be in the "title" of the commit message.
>>
>> "If" we want to get into the habit of including this information for
>> display code we should come up with a prescriptive field that goes
>> into the commit message during promotion and it should be part of all
>> patches in the promotion that have it.
>>
>> Something like this:
>>
>> AMD-Jira: SWDEV-476969
>>
>> Probably need to align that with other stakeholders though before
>> starting that way.
>>
>> On 11/14/2024 08:37, Zaeem Mohamed wrote:
>>> [why]
>>> Prevent index-out-of-bounds due to requiring cursor overlay when
>>> plane_count is MAX_SURFACES.
>>>
>>> [how]
>>> Bounds check on plane_count when requiring overlay cursor.
>>>
>>
>> Any link to failing bugs or anything like that you can include?
> Hi Mario,
>
> About this question, these are the related issues:
> - Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3693
> - Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3594
>
> You can find more details in previous iterations related to this bug:
> - https://lore.kernel.org/amd-gfx/575d66c7-e77d-42ea-
> acbf-412d6e508a0b@igalia.com/
> - https://lore.kernel.org/amd-gfx/20240925154324.348774-1-mwen@igalia.com/
>>
>>> Co-developed-by: Melissa Wen <mwen@igalia.com>
>>> Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
>>
>> You're missing Melisaa's SoB for a co-developed patch.
>> IIRC this should fail checkpatch.
> I already mentioned before, I don't think I actually co-dev this code,
> so Zaeem can remove it in the next iteration.
>
> ---
>
> BTW, about the implementation:
>
> As I don't have the proper environment, I asked reporters to check this
> patch up and it doesn't help prevent interface freeze.
> It seems to prevent the out of bounds bug but is causing a page fault now:
>
> kernel: BUG: unable to handle page fault for address: 000000000174e354
>
> From their feedback, I found curious that MAX_SURFACES -> 4 prevents
> the freeze but not completely solve the problem.
> MAX_SURFACES -> 6 solves it, what let me consider that the MAX_SURFACES
> vs MAX_SURFACE_NUM vs MAX_PLANE mismatch might be related.
> I'm going to analyzing the logs but you can find more details here:
> https://gitlab.freedesktop.org/drm/amd/-/issues/3693#note_2658994
>
> BR,
Got it, thanks for the context!
Zaeem, please add links to these in your next iteration of the patch.
>
> Melissa Wen
>>
>>> ---
>>> amdgpu_dm/amdgpu_dm.c | 10 +++++++++-
>>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/amdgpu_dm/amdgpu_dm.c b/amdgpu_dm/amdgpu_dm.c
>>> index 97e0a1bbba..964497c613 100644
>>> --- a/amdgpu_dm/amdgpu_dm.c
>>> +++ b/amdgpu_dm/amdgpu_dm.c
>>> @@ -11821,8 +11821,16 @@ static int amdgpu_dm_atomic_check(struct
>>> drm_device *dev,
>>> /* Overlay cusor not subject to native cursor
>>> restrictions */
>>> dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
>>> - if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
>>> + if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE) {
>>> + if (dc->current_state->stream_status->plane_count >
>>> MAX_SURFACES) {
>>> + drm_dbg_driver(crtc->dev,
>>> + "Can't enable cursor plane with %d planes\n",
>>> MAX_SURFACES);
>>> + ret = -EINVAL;
>>> + goto fail;
>>> + }
>>> +
>>> continue;
>>> + }
>>> /* Check if rotation or scaling is enabled on DCN401 */
>>> if ((drm_plane_mask(crtc->cursor) & new_crtc_state-
>>> >plane_mask) &&
>>
>
next prev parent reply other threads:[~2024-11-18 14:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 14:37 [PATCH] SWDEV-476969 - dm/amdgpu: Fail dm_atomic_check if cursor overlay is required at MAX_SURFACES Zaeem Mohamed
2024-11-14 19:04 ` Mario Limonciello
2024-11-18 12:52 ` Melissa Wen
2024-11-18 14:27 ` Mario Limonciello [this message]
2024-11-19 17:04 ` Mohamed, Zaeem
2024-11-19 17:38 ` Melissa Wen
2024-11-27 15:45 ` Melissa Wen
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=cfe6e877-dbae-45ff-bbc0-3968f235370a@amd.com \
--to=mario.limonciello@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=mwen@igalia.com \
--cc=zaeem.mohamed@amd.com \
/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