AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: christian.koenig@amd.com
Cc: Stylon.Wang@amd.com, Zhan Liu <zhan.liu@amd.com>,
	Chao-kai.Wang@amd.com, dri-devel@lists.freedesktop.org,
	Nikola.Cornij@amd.com, amd-gfx@lists.freedesktop.org,
	bas@basnieuwenhuizen.nl, Nicholas.Kazlauskas@amd.com
Subject: Re: [PATCH v2] drm/amdgpu: Do not change amdgpu framebuffer format during page flip
Date: Thu, 7 Jan 2021 18:32:47 +0100	[thread overview]
Message-ID: <X/dFvzGu0lIK0mtT@phenom.ffwll.local> (raw)
In-Reply-To: <81e9467f-3498-2d6a-3822-902f2afb74c9@gmail.com>

On Sun, Jan 03, 2021 at 04:43:37PM +0100, Christian König wrote:
> Am 29.12.20 um 22:10 schrieb Zhan Liu:
> > [Why]
> > Driver cannot change amdgpu framebuffer (afb) format while doing
> > page flip. Force system doing so will cause ioctl error, and result in
> > breaking several functionalities including FreeSync.
> > 
> > If afb format is forced to change during page flip, following message
> > will appear in dmesg.log:
> > 
> > "[drm:drm_mode_page_flip_ioctl [drm]]
> > Page flip is not allowed to change frame buffer format."
> > 
> > [How]
> > Do not change afb format while doing page flip. It is okay to check
> > whether afb format is valid here, however, forcing afb format change
> > shouldn't happen here.
> 
> I don't think this we can do this.
> 
> It is perfectly valid for a page flip to switch between linear and tiled
> formats on an I+A or A+A laptop.

It is, but that's not the bug here. struct drm_framebuffer.format is
supposed to be invariant over the lifetime of a drm_fb object, you need to
set it when the fb is created and never change it afterwards. So the patch
here isn't yet the real deal.

Also this means the implicit tiling information cannot be changed after a
fb is created for a given bo, but we've discussed this at length and that
limitation should be all ok.
-Daniel

> 
> Christian.
> 
> > 
> > Signed-off-by: Zhan Liu <zhan.liu@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > Thanks Nick and Bas. Here is my second patch for review.
> > 
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > index a638709e9c92..8a12e27ff4ec 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > @@ -832,7 +832,8 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
> >   			if (!format_info)
> >   				return -EINVAL;
> > -			afb->base.format = format_info;
> > +			if (!afb->base.format)
> > +				afb->base.format = format_info;
> >   		}
> >   	}
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-01-07 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 21:10 [PATCH v2] drm/amdgpu: Do not change amdgpu framebuffer format during page flip Zhan Liu
2021-01-03 15:43 ` Christian König
2021-01-07 17:32   ` Daniel Vetter [this message]
2021-01-07 17:38     ` Liu, Zhan
2021-01-05 12:51 ` Dan Carpenter

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=X/dFvzGu0lIK0mtT@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Chao-kai.Wang@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Nikola.Cornij@amd.com \
    --cc=Stylon.Wang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bas@basnieuwenhuizen.nl \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=zhan.liu@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