* [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()
@ 2018-07-23 13:43 Boris Brezillon
2018-07-23 14:08 ` Sean Paul
2018-07-23 17:07 ` Eric Anholt
0 siblings, 2 replies; 3+ messages in thread
From: Boris Brezillon @ 2018-07-23 13:43 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, dri-devel; +Cc: Boris Brezillon
Async plane update is supposed to work only when updating the FB or FB
position of an already enabled plane. That does not apply to requests
where the plane was previously disabled or assigned to a different
CTRC.
Check old_plane_state->crtc value to make sure async plane update is
allowed.
Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
Hello,
As discussed on IRC, I'm not sure this "plane should already be enabled
and assigned to the same CRTC to allow async updates" limitation
applies to all drivers, but it's required for VC4 to work properly.
Just let me know if you think I should move this check to
vc4_plane_atomic_async_check().
Thanks,
Boris
---
drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 866a2cc72ef6..f7ccfebd3ca8 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1555,7 +1555,8 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
if (n_planes != 1)
return -EINVAL;
- if (!new_plane_state->crtc)
+ if (!new_plane_state->crtc ||
+ old_plane_state->crtc != new_plane_state->crtc)
return -EINVAL;
funcs = plane->helper_private;
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()
2018-07-23 13:43 [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check() Boris Brezillon
@ 2018-07-23 14:08 ` Sean Paul
2018-07-23 17:07 ` Eric Anholt
1 sibling, 0 replies; 3+ messages in thread
From: Sean Paul @ 2018-07-23 14:08 UTC (permalink / raw)
To: Boris Brezillon; +Cc: David Airlie, dri-devel
On Mon, Jul 23, 2018 at 03:43:54PM +0200, Boris Brezillon wrote:
> Async plane update is supposed to work only when updating the FB or FB
> position of an already enabled plane. That does not apply to requests
> where the plane was previously disabled or assigned to a different
> CTRC.
>
> Check old_plane_state->crtc value to make sure async plane update is
> allowed.
>
> Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> Hello,
>
> As discussed on IRC, I'm not sure this "plane should already be enabled
> and assigned to the same CRTC to allow async updates" limitation
> applies to all drivers, but it's required for VC4 to work properly.
>
> Just let me know if you think I should move this check to
> vc4_plane_atomic_async_check().
I don't _think_ there's any hardware that can switch planes without first
disabling the plane for a frame and then re-enabling it, so this passes the
smell test for me. I'd be very curious to be proven wrong, though :)
Sean
>
> Thanks,
>
> Boris
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 866a2cc72ef6..f7ccfebd3ca8 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1555,7 +1555,8 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
> if (n_planes != 1)
> return -EINVAL;
>
> - if (!new_plane_state->crtc)
> + if (!new_plane_state->crtc ||
> + old_plane_state->crtc != new_plane_state->crtc)
> return -EINVAL;
>
> funcs = plane->helper_private;
> --
> 2.14.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check()
2018-07-23 13:43 [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check() Boris Brezillon
2018-07-23 14:08 ` Sean Paul
@ 2018-07-23 17:07 ` Eric Anholt
1 sibling, 0 replies; 3+ messages in thread
From: Eric Anholt @ 2018-07-23 17:07 UTC (permalink / raw)
To: David Airlie, Daniel Vetter, dri-devel; +Cc: Boris Brezillon
[-- Attachment #1.1: Type: text/plain, Size: 646 bytes --]
Boris Brezillon <boris.brezillon@bootlin.com> writes:
> Async plane update is supposed to work only when updating the FB or FB
> position of an already enabled plane. That does not apply to requests
> where the plane was previously disabled or assigned to a different
> CTRC.
>
> Check old_plane_state->crtc value to make sure async plane update is
> allowed.
>
> Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
I don't think any driver I've worked on would want an async flip of a
plane between CRTCs.
Reviewed-by: Eric Anholt <eric@anholt.net>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-23 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-23 13:43 [PATCH] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check() Boris Brezillon
2018-07-23 14:08 ` Sean Paul
2018-07-23 17:07 ` Eric Anholt
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.