Commit e4d983ac authored by Simon Ser's avatar Simon Ser

drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP

This new kernel capability indicates whether async page-flips are
supported via the atomic uAPI. DRM clients can use it to check
for support before feeding DRM_MODE_PAGE_FLIP_ASYNC to the kernel.

Make it clear that DRM_CAP_ASYNC_PAGE_FLIP is for legacy uAPI only.
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Reviewed-by: default avatarAndré Almeida <andrealmeid@igalia.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAndré Almeida <andrealmeid@igalia.com>
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20231122161941.320564-4-andrealmeid@igalia.com
parent 4b4af74a
...@@ -301,6 +301,10 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ ...@@ -301,6 +301,10 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
case DRM_CAP_CRTC_IN_VBLANK_EVENT: case DRM_CAP_CRTC_IN_VBLANK_EVENT:
req->value = 1; req->value = 1;
break; break;
case DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP:
req->value = drm_core_check_feature(dev, DRIVER_ATOMIC) &&
dev->mode_config.async_page_flip;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
......
...@@ -713,7 +713,8 @@ struct drm_gem_open { ...@@ -713,7 +713,8 @@ struct drm_gem_open {
/** /**
* DRM_CAP_ASYNC_PAGE_FLIP * DRM_CAP_ASYNC_PAGE_FLIP
* *
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for legacy
* page-flips.
*/ */
#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 #define DRM_CAP_ASYNC_PAGE_FLIP 0x7
/** /**
...@@ -773,6 +774,13 @@ struct drm_gem_open { ...@@ -773,6 +774,13 @@ struct drm_gem_open {
* :ref:`drm_sync_objects`. * :ref:`drm_sync_objects`.
*/ */
#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 #define DRM_CAP_SYNCOBJ_TIMELINE 0x14
/**
* DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP
*
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for atomic
* commits.
*/
#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
/* DRM_IOCTL_GET_CAP ioctl argument type */ /* DRM_IOCTL_GET_CAP ioctl argument type */
struct drm_get_cap { struct drm_get_cap {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment