From: Mario Limonciello <superm1@kernel.org>
To: Harry Wentland <harry.wentland@amd.com>,
roman.li@amd.com, amd-gfx@lists.freedesktop.org
Cc: Mario Limonciello <mario.limonciello@amd.com>,
Luke Jones <luke@ljones.dev>
Subject: Re: [PATCH 1/4] drm/amd/display: Adjust plane init for off by one error
Date: Tue, 21 Jan 2025 10:52:04 -0600 [thread overview]
Message-ID: <f5c084d6-0b27-4cc0-abd1-e0c1b9829615@kernel.org> (raw)
In-Reply-To: <3143e415-a792-43cd-a76c-328c2089044b@amd.com>
On 1/21/25 10:32, Harry Wentland wrote:
>
>
> On 2025-01-21 08:57, Mario Limonciello wrote:
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> The number of active surfaces is initialized to the number
>> of active planes. If the number of planes aren't initialized
>> properly then the last plane can end up not getting initialized
>> which can be a divide by zero error.
>>
>> Reported-and-tested-by: Luke Jones <luke@ljones.dev>
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3794
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3533
>> Fixes: 7966f319c66d9 ("drm/amd/display: Introduce DML2")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
>> index 8dabb1ac0b684..45147b812d7d9 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
>> @@ -6787,7 +6787,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib)
>> }
>> }
>>
>> - for (k = 0; k <= mode_lib->ms.num_active_planes - 1; k++) {
>> + for (k = 0; k <= mode_lib->ms.num_active_planes; k++) {
>
> Shouldn't this be either
> k <= num_active_planes -1
> or
> k < num_active_planes
> ?
>
> Is num_active_planes wrong somehow?
Oh I see your point, that /should/ be the right value then for this
particular loop and the rest of the corrections don't make sense either.
I'm not sure where the issue actually is then.
>
> Harry
>
>> CalculateBytePerPixelAndBlockSizes(
>> mode_lib->ms.cache_display_cfg.surface.SourcePixelFormat[k],
>> mode_lib->ms.cache_display_cfg.surface.SurfaceTiling[k],
>
next prev parent reply other threads:[~2025-01-21 16:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 13:57 [PATCH 0/4] Correct a series of off by 1 errors in DML and DML2 Mario Limonciello
2025-01-21 13:57 ` [PATCH 1/4] drm/amd/display: Adjust plane init for off by one error Mario Limonciello
2025-01-21 16:32 ` Harry Wentland
2025-01-21 16:52 ` Mario Limonciello [this message]
2025-01-21 13:57 ` [PATCH 2/4] drm/amd/display: Correct off by one errors in DML Mario Limonciello
2025-01-21 13:57 ` [PATCH 3/4] drm/amd/display: Correct some suspect code indentation Mario Limonciello
2025-01-21 13:57 ` [PATCH 4/4] drm/amd/display: Correct off by one errors in DML2 Mario Limonciello
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=f5c084d6-0b27-4cc0-abd1-e0c1b9829615@kernel.org \
--to=superm1@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=luke@ljones.dev \
--cc=mario.limonciello@amd.com \
--cc=roman.li@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