* [PATCH v2] drm: Check actual format for legacy pageflip.
@ 2021-01-10 2:11 Bas Nieuwenhuizen
2021-01-11 15:02 ` Alex Deucher
0 siblings, 1 reply; 5+ messages in thread
From: Bas Nieuwenhuizen @ 2021-01-10 2:11 UTC (permalink / raw)
To: dri-devel
Cc: daniel.vetter, intel-gfx, zhan.liu, amd-gfx,
Christian König, alexander.deucher, nicholas.kazlauskas
With modifiers one can actually have different format_info structs
for the same format, which now matters for AMDGPU since we convert
implicit modifiers to explicit modifiers with multiple planes.
I checked other drivers and it doesn't look like they end up triggering
this case so I think this is safe to relax.
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Zhan Liu <zhan.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
---
drivers/gpu/drm/drm_plane.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index e6231947f987..a0cb746bcb0a 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -1163,7 +1163,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
if (ret)
goto out;
- if (old_fb->format != fb->format) {
+ /*
+ * Only check the FOURCC format code, excluding modifiers. This is
+ * enough for all legacy drivers. Atomic drivers have their own
+ * checks in their ->atomic_check implementation, which will
+ * return -EINVAL if any hw or driver constraint is violated due
+ * to modifier changes.
+ */
+ if (old_fb->format->format != fb->format->format) {
DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
ret = -EINVAL;
goto out;
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm: Check actual format for legacy pageflip.
2021-01-10 2:11 [PATCH v2] drm: Check actual format for legacy pageflip Bas Nieuwenhuizen
@ 2021-01-11 15:02 ` Alex Deucher
2021-01-11 16:40 ` Bas Nieuwenhuizen
0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2021-01-11 15:02 UTC (permalink / raw)
To: Bas Nieuwenhuizen
Cc: Daniel Vetter, Intel Graphics Development, Zhan Liu,
amd-gfx list, Kazlauskas, Nicholas, Maling list - DRI developers,
Deucher, Alexander, Christian König
On Sat, Jan 9, 2021 at 9:11 PM Bas Nieuwenhuizen
<bas@basnieuwenhuizen.nl> wrote:
>
> With modifiers one can actually have different format_info structs
> for the same format, which now matters for AMDGPU since we convert
> implicit modifiers to explicit modifiers with multiple planes.
>
> I checked other drivers and it doesn't look like they end up triggering
> this case so I think this is safe to relax.
>
> Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> Acked-by: Christian König <christian.koenig@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
Do you have commit rights to drm-misc or do you need someone to commit
this for you?
Thanks!
Alex
> ---
> drivers/gpu/drm/drm_plane.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index e6231947f987..a0cb746bcb0a 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -1163,7 +1163,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
> if (ret)
> goto out;
>
> - if (old_fb->format != fb->format) {
> + /*
> + * Only check the FOURCC format code, excluding modifiers. This is
> + * enough for all legacy drivers. Atomic drivers have their own
> + * checks in their ->atomic_check implementation, which will
> + * return -EINVAL if any hw or driver constraint is violated due
> + * to modifier changes.
> + */
> + if (old_fb->format->format != fb->format->format) {
> DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
> ret = -EINVAL;
> goto out;
> --
> 2.29.2
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm: Check actual format for legacy pageflip.
2021-01-11 15:02 ` Alex Deucher
@ 2021-01-11 16:40 ` Bas Nieuwenhuizen
2021-01-11 21:28 ` Alex Deucher
0 siblings, 1 reply; 5+ messages in thread
From: Bas Nieuwenhuizen @ 2021-01-11 16:40 UTC (permalink / raw)
To: Alex Deucher
Cc: Daniel Vetter, Intel Graphics Development, Zhan Liu,
amd-gfx list, Kazlauskas, Nicholas, Maling list - DRI developers,
Deucher, Alexander, Christian König
On Mon, Jan 11, 2021 at 4:02 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Sat, Jan 9, 2021 at 9:11 PM Bas Nieuwenhuizen
> <bas@basnieuwenhuizen.nl> wrote:
> >
> > With modifiers one can actually have different format_info structs
> > for the same format, which now matters for AMDGPU since we convert
> > implicit modifiers to explicit modifiers with multiple planes.
> >
> > I checked other drivers and it doesn't look like they end up triggering
> > this case so I think this is safe to relax.
> >
> > Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> > Acked-by: Christian König <christian.koenig@amd.com>
> > Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
>
> Do you have commit rights to drm-misc or do you need someone to commit
> this for you?
I don't have commit rights so if the patch could be committed for me
that would be appreciated!
>
> Thanks!
>
> Alex
>
> > ---
> > drivers/gpu/drm/drm_plane.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> > index e6231947f987..a0cb746bcb0a 100644
> > --- a/drivers/gpu/drm/drm_plane.c
> > +++ b/drivers/gpu/drm/drm_plane.c
> > @@ -1163,7 +1163,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
> > if (ret)
> > goto out;
> >
> > - if (old_fb->format != fb->format) {
> > + /*
> > + * Only check the FOURCC format code, excluding modifiers. This is
> > + * enough for all legacy drivers. Atomic drivers have their own
> > + * checks in their ->atomic_check implementation, which will
> > + * return -EINVAL if any hw or driver constraint is violated due
> > + * to modifier changes.
> > + */
> > + if (old_fb->format->format != fb->format->format) {
> > DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
> > ret = -EINVAL;
> > goto out;
> > --
> > 2.29.2
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm: Check actual format for legacy pageflip.
2021-01-11 16:40 ` Bas Nieuwenhuizen
@ 2021-01-11 21:28 ` Alex Deucher
2021-01-12 9:18 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2021-01-11 21:28 UTC (permalink / raw)
To: Bas Nieuwenhuizen
Cc: Daniel Vetter, Intel Graphics Development, Zhan Liu,
amd-gfx list, Kazlauskas, Nicholas, Maling list - DRI developers,
Deucher, Alexander, Christian König
On Mon, Jan 11, 2021 at 11:39 AM Bas Nieuwenhuizen
<bas@basnieuwenhuizen.nl> wrote:
>
> On Mon, Jan 11, 2021 at 4:02 PM Alex Deucher <alexdeucher@gmail.com> wrote:
> >
> > On Sat, Jan 9, 2021 at 9:11 PM Bas Nieuwenhuizen
> > <bas@basnieuwenhuizen.nl> wrote:
> > >
> > > With modifiers one can actually have different format_info structs
> > > for the same format, which now matters for AMDGPU since we convert
> > > implicit modifiers to explicit modifiers with multiple planes.
> > >
> > > I checked other drivers and it doesn't look like they end up triggering
> > > this case so I think this is safe to relax.
> > >
> > > Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> > > Acked-by: Christian König <christian.koenig@amd.com>
> > > Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > > Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
> >
> > Do you have commit rights to drm-misc or do you need someone to commit
> > this for you?
>
> I don't have commit rights so if the patch could be committed for me
> that would be appreciated!
Pushed to drm-misc-fixes. Thanks!
If you want access to drm-misc, I don't see any reason you shouldn't have it.
Alex
> >
> > Thanks!
> >
> > Alex
> >
> > > ---
> > > drivers/gpu/drm/drm_plane.c | 9 ++++++++-
> > > 1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> > > index e6231947f987..a0cb746bcb0a 100644
> > > --- a/drivers/gpu/drm/drm_plane.c
> > > +++ b/drivers/gpu/drm/drm_plane.c
> > > @@ -1163,7 +1163,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
> > > if (ret)
> > > goto out;
> > >
> > > - if (old_fb->format != fb->format) {
> > > + /*
> > > + * Only check the FOURCC format code, excluding modifiers. This is
> > > + * enough for all legacy drivers. Atomic drivers have their own
> > > + * checks in their ->atomic_check implementation, which will
> > > + * return -EINVAL if any hw or driver constraint is violated due
> > > + * to modifier changes.
> > > + */
> > > + if (old_fb->format->format != fb->format->format) {
> > > DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
> > > ret = -EINVAL;
> > > goto out;
> > > --
> > > 2.29.2
> > >
> > > _______________________________________________
> > > amd-gfx mailing list
> > > amd-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm: Check actual format for legacy pageflip.
2021-01-11 21:28 ` Alex Deucher
@ 2021-01-12 9:18 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2021-01-12 9:18 UTC (permalink / raw)
To: Alex Deucher
Cc: Daniel Vetter, Intel Graphics Development, Zhan Liu,
Maling list - DRI developers, Kazlauskas, Nicholas, amd-gfx list,
Deucher, Alexander, Christian König
On Mon, Jan 11, 2021 at 04:28:31PM -0500, Alex Deucher wrote:
> On Mon, Jan 11, 2021 at 11:39 AM Bas Nieuwenhuizen
> <bas@basnieuwenhuizen.nl> wrote:
> >
> > On Mon, Jan 11, 2021 at 4:02 PM Alex Deucher <alexdeucher@gmail.com> wrote:
> > >
> > > On Sat, Jan 9, 2021 at 9:11 PM Bas Nieuwenhuizen
> > > <bas@basnieuwenhuizen.nl> wrote:
> > > >
> > > > With modifiers one can actually have different format_info structs
> > > > for the same format, which now matters for AMDGPU since we convert
> > > > implicit modifiers to explicit modifiers with multiple planes.
> > > >
> > > > I checked other drivers and it doesn't look like they end up triggering
> > > > this case so I think this is safe to relax.
> > > >
> > > > Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > > Reviewed-by: Zhan Liu <zhan.liu@amd.com>
> > > > Acked-by: Christian König <christian.koenig@amd.com>
> > > > Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > > > Fixes: 816853f9dc40 ("drm/amd/display: Set new format info for converted metadata.")
> > >
> > > Do you have commit rights to drm-misc or do you need someone to commit
> > > this for you?
> >
> > I don't have commit rights so if the patch could be committed for me
> > that would be appreciated!
>
> Pushed to drm-misc-fixes. Thanks!
>
> If you want access to drm-misc, I don't see any reason you shouldn't have it.
There's some old-school bash tooling involved since we're (not yet, I can
hope) doing gitlab MR:
https://drm.pages.freedesktop.org/maintainer-tools/getting-started.html
Otherwise makes sense imo.
-Daniel
>
> Alex
>
>
> > >
> > > Thanks!
> > >
> > > Alex
> > >
> > > > ---
> > > > drivers/gpu/drm/drm_plane.c | 9 ++++++++-
> > > > 1 file changed, 8 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> > > > index e6231947f987..a0cb746bcb0a 100644
> > > > --- a/drivers/gpu/drm/drm_plane.c
> > > > +++ b/drivers/gpu/drm/drm_plane.c
> > > > @@ -1163,7 +1163,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
> > > > if (ret)
> > > > goto out;
> > > >
> > > > - if (old_fb->format != fb->format) {
> > > > + /*
> > > > + * Only check the FOURCC format code, excluding modifiers. This is
> > > > + * enough for all legacy drivers. Atomic drivers have their own
> > > > + * checks in their ->atomic_check implementation, which will
> > > > + * return -EINVAL if any hw or driver constraint is violated due
> > > > + * to modifier changes.
> > > > + */
> > > > + if (old_fb->format->format != fb->format->format) {
> > > > DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
> > > > ret = -EINVAL;
> > > > goto out;
> > > > --
> > > > 2.29.2
> > > >
> > > > _______________________________________________
> > > > amd-gfx mailing list
> > > > amd-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-01-12 9:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 2:11 [PATCH v2] drm: Check actual format for legacy pageflip Bas Nieuwenhuizen
2021-01-11 15:02 ` Alex Deucher
2021-01-11 16:40 ` Bas Nieuwenhuizen
2021-01-11 21:28 ` Alex Deucher
2021-01-12 9:18 ` Daniel Vetter
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).