diff mbox

drm/atomic: Always allow async support for the atomic ioctl.

Message ID 1461576105-3204-1-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst April 25, 2016, 9:21 a.m. UTC
async_page_flip is a unrelated flag and should not be used for
testing support. It's up to the drivers to fail if they don't
support async commit.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Daniel Vetter April 25, 2016, 9:35 a.m. UTC | #1
On Mon, Apr 25, 2016 at 11:21 AM, Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
> async_page_flip is a unrelated flag and should not be used for
> testing support. It's up to the drivers to fail if they don't
> support async commit.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Once more (summary of our irc discussion):

- DRM_MODE_PAGE_FLIP_ASYNC = flipping with tearing, i.e. not vblank
synced. Gives you lower latency and unrestricted rendering, aka
benchmark mode. Needs special hw support and on intel only supported
on the primary plane. I think a better way to almost get all the
benefits of async by simply implementing a queue of flips that all get
collapsed to the next vblank.

- async atomic commit = non-blocking ioctl.

Two entirely orthogonal things (you could do blocking atomic commit
with async flip, but doesn't make much sense).

Maybe instead we need a better documentation for the FLIP_ASYNC flag?
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 984567057688..af8957b60388 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1587,10 +1587,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
>         if (arg->reserved)
>                 return -EINVAL;
>
> -       if ((arg->flags & DRM_MODE_PAGE_FLIP_ASYNC) &&
> -                       !dev->mode_config.async_page_flip)
> -               return -EINVAL;
> -
>         /* can't test and expect an event at the same time. */
>         if ((arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) &&
>                         (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst April 25, 2016, 9:37 a.m. UTC | #2
Op 25-04-16 om 11:35 schreef Daniel Vetter:
> On Mon, Apr 25, 2016 at 11:21 AM, Maarten Lankhorst
> <maarten.lankhorst@linux.intel.com> wrote:
>> async_page_flip is a unrelated flag and should not be used for
>> testing support. It's up to the drivers to fail if they don't
>> support async commit.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Once more (summary of our irc discussion):
>
> - DRM_MODE_PAGE_FLIP_ASYNC = flipping with tearing, i.e. not vblank
> synced. Gives you lower latency and unrestricted rendering, aka
> benchmark mode. Needs special hw support and on intel only supported
> on the primary plane. I think a better way to almost get all the
> benefits of async by simply implementing a queue of flips that all get
> collapsed to the next vblank.
>
> - async atomic commit = non-blocking ioctl.
>
> Two entirely orthogonal things (you could do blocking atomic commit
> with async flip, but doesn't make much sense).
>
> Maybe instead we need a better documentation for the FLIP_ASYNC flag?
>
yeah it's confusing, especially with atomic async commit. Maybe rename to nonblocking commit?

~Maarten
Daniel Vetter April 25, 2016, 9:40 a.m. UTC | #3
On Mon, Apr 25, 2016 at 11:37 AM, Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
> Op 25-04-16 om 11:35 schreef Daniel Vetter:
>> On Mon, Apr 25, 2016 at 11:21 AM, Maarten Lankhorst
>> <maarten.lankhorst@linux.intel.com> wrote:
>>> async_page_flip is a unrelated flag and should not be used for
>>> testing support. It's up to the drivers to fail if they don't
>>> support async commit.
>>>
>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Once more (summary of our irc discussion):
>>
>> - DRM_MODE_PAGE_FLIP_ASYNC = flipping with tearing, i.e. not vblank
>> synced. Gives you lower latency and unrestricted rendering, aka
>> benchmark mode. Needs special hw support and on intel only supported
>> on the primary plane. I think a better way to almost get all the
>> benefits of async by simply implementing a queue of flips that all get
>> collapsed to the next vblank.
>>
>> - async atomic commit = non-blocking ioctl.
>>
>> Two entirely orthogonal things (you could do blocking atomic commit
>> with async flip, but doesn't make much sense).
>>
>> Maybe instead we need a better documentation for the FLIP_ASYNC flag?
>>
> yeah it's confusing, especially with atomic async commit. Maybe rename to nonblocking commit?

Well uabi renaming train left the station, but internally we can
definitely do that.
s/drm_atomic_async_commit/drm_atomic_nonblocking_commit/ plus
s/async/nonblocking/ in the driver's ->atomic_commit hooks sounds like
a very fine idea. Volunteered?
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 984567057688..af8957b60388 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1587,10 +1587,6 @@  int drm_mode_atomic_ioctl(struct drm_device *dev,
 	if (arg->reserved)
 		return -EINVAL;
 
-	if ((arg->flags & DRM_MODE_PAGE_FLIP_ASYNC) &&
-			!dev->mode_config.async_page_flip)
-		return -EINVAL;
-
 	/* can't test and expect an event at the same time. */
 	if ((arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) &&
 			(arg->flags & DRM_MODE_PAGE_FLIP_EVENT))