History

drm: Advertise async page flip ability through GETCAP ioctl

Let applications know whether the kernel supports asynchronous page flipping.

Keith Packard committed 13 years ago

Commit 62f21041 parent 9bba0c44 files · +10 −0Browse files

Unified · Split

4 files
  1. drivers/gpu/drm/drm_crtc.c +3 −0
  2. drivers/gpu/drm/drm_ioctl.c +3 −0
  3. include/drm/drm_crtc.h +3 −0
  4. include/uapi/drm/drm.h +1 −0
drivers/gpu/drm/drm_crtc.c+3−0
@@ -3508,6 +3508,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, · 3507 unmodified lines
35083508 page_flip->reserved != 0)
35093509 return -EINVAL;
35103510
3511+ if ((page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC) && !dev->mode_config.async_page_flip)
3512+ return -EINVAL;
3513+
35113514 obj = drm_mode_object_find(dev, page_flip->crtc_id, DRM_MODE_OBJECT_CRTC);
35123515 if (!obj)
35133516 return -EINVAL;
drivers/gpu/drm/drm_ioctl.c+3−0
@@ -293,6 +293,9 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv) · 292 unmodified lines
293293 case DRM_CAP_TIMESTAMP_MONOTONIC:
294294 req->value = drm_timestamp_monotonic;
295295 break;
296+ case DRM_CAP_ASYNC_PAGE_FLIP:
297+ req->value = dev->mode_config.async_page_flip;
298+ break;
296299 default:
297300 return -EINVAL;
298301 }
include/drm/drm_crtc.h+3−0
@@ -842,6 +842,9 @@ struct drm_mode_config { · 841 unmodified lines
842842
843843 /* dumb ioctl parameters */
844844 uint32_t preferred_depth, prefer_shadow;
845+
846+ /* whether async page flip is supported or not */
847+ bool async_page_flip;
845848 };
846849
847850 #define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
include/uapi/drm/drm.h+1−0
@@ -780,6 +780,7 @@ struct drm_event_vblank { · 779 unmodified lines
780780 #define DRM_CAP_DUMB_PREFER_SHADOW 0x4
781781 #define DRM_CAP_PRIME 0x5
782782 #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
783+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
783784
784785 #define DRM_PRIME_CAP_IMPORT 0x1
785786 #define DRM_PRIME_CAP_EXPORT 0x2