All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Simon Ser <contact@emersion.fr>, Sefa Eyeoglu <contact@scrumplex.net>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: check fb of primary plane
Date: Wed, 17 Mar 2021 09:40:47 +0100	[thread overview]
Message-ID: <ba88fbc4-d293-3594-5822-1bc5026e8f69@daenzer.net> (raw)
In-Reply-To: <BXflth5n3xasxoEuCG2MmbmwEVxpajiLTSqLdyoFxMsugaQUqpvAvZENKxcrhoHY1z0D0NkWBxQa83qUOm8Eg5EOLUhbWoQ7P7y5iblbLwg=@emersion.fr>

On 2021-03-17 9:29 a.m., Simon Ser wrote:
> On Tuesday, March 16th, 2021 at 10:50 PM, Sefa Eyeoglu <contact@scrumplex.net> wrote:
> 
>> Sometimes the primary plane might not be initialized (yet), which
>> causes dm_check_crtc_cursor to divide by zero.
>> Apparently a weird state before a S3-suspend causes the aforementioned
>> divide-by-zero error when resuming from S3.  This was explained in
>> bug 212293 on Bugzilla.
>>
>> To avoid this divide-by-zero error we check if the primary plane's fb
>> isn't NULL.  If it's NULL the src_w and src_h attributes will be 0,
>> which would cause a divide-by-zero.
>>
>> This fixes Bugzilla report 212293
>> https://bugzilla.kernel.org/show_bug.cgi?id=212293
>>
>> Fixes: 12f4849a1cfd69f3 ("drm/amd/display: check cursor scaling")
>> Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
> 
> Thanks for the fix! In theory we should return -EINVAL here, because we can't
> enable the cursor plane without the primary plane. But that would break the
> legacy API translation layer in DRM core, which expects that planes can always
> be disabled individually.

The core DRM code can deal with being unable to enable the CRTC while the primary plane is disabled. If you have evidence to the contrary, I'd like to see it.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-03-17  8:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 21:50 [PATCH] drm/amd/display: check fb of primary plane Sefa Eyeoglu
2021-03-17  8:29 ` Simon Ser
2021-03-17  8:40   ` Michel Dänzer [this message]
2021-03-17 14:04 ` Harry Wentland
2021-03-17 15:14   ` Alex Deucher

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=ba88fbc4-d293-3594-5822-1bc5026e8f69@daenzer.net \
    --to=michel@daenzer.net \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=contact@emersion.fr \
    --cc=contact@scrumplex.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.