aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-08-08 03:23:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-08-10 14:28:09 -0400
commitf837297ad82480024d3ad08cd84f6670bcafa862 (patch)
tree42aca44491b3f0ea57170b0290eb382a51fc8c7c /include/uapi
parent5dd20bbae8a39100e1cf4a7fcc8ecd598c09d992 (diff)
drm: Add DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags v2
These flags allow userspace to explicitly specify the target vertical blank period when a flip should take effect. v2: * Add new struct drm_mode_crtc_page_flip_target instead of modifying struct drm_mode_crtc_page_flip, to make sure all existing userspace code keeps compiling (Daniel Vetter) Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/drm/drm.h1
-rw-r--r--include/uapi/drm/drm_mode.h39
2 files changed, 37 insertions, 3 deletions
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 452675fb55d9..b2c52843bc70 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -646,6 +646,7 @@ struct drm_gem_open {
646#define DRM_CAP_CURSOR_WIDTH 0x8 646#define DRM_CAP_CURSOR_WIDTH 0x8
647#define DRM_CAP_CURSOR_HEIGHT 0x9 647#define DRM_CAP_CURSOR_HEIGHT 0x9
648#define DRM_CAP_ADDFB2_MODIFIERS 0x10 648#define DRM_CAP_ADDFB2_MODIFIERS 0x10
649#define DRM_CAP_PAGE_FLIP_TARGET 0x11
649 650
650/** DRM_IOCTL_GET_CAP ioctl argument type */ 651/** DRM_IOCTL_GET_CAP ioctl argument type */
651struct drm_get_cap { 652struct drm_get_cap {
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 49a72659b801..df0e3504c349 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -520,7 +520,13 @@ struct drm_color_lut {
520 520
521#define DRM_MODE_PAGE_FLIP_EVENT 0x01 521#define DRM_MODE_PAGE_FLIP_EVENT 0x01
522#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 522#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
523#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC) 523#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
524#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
525#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
526 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
527#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
528 DRM_MODE_PAGE_FLIP_ASYNC | \
529 DRM_MODE_PAGE_FLIP_TARGET)
524 530
525/* 531/*
526 * Request a page flip on the specified crtc. 532 * Request a page flip on the specified crtc.
@@ -543,8 +549,7 @@ struct drm_color_lut {
543 * 'as soon as possible', meaning that it not delay waiting for vblank. 549 * 'as soon as possible', meaning that it not delay waiting for vblank.
544 * This may cause tearing on the screen. 550 * This may cause tearing on the screen.
545 * 551 *
546 * The reserved field must be zero until we figure out something 552 * The reserved field must be zero.
547 * clever to use it for.
548 */ 553 */
549 554
550struct drm_mode_crtc_page_flip { 555struct drm_mode_crtc_page_flip {
@@ -555,6 +560,34 @@ struct drm_mode_crtc_page_flip {
555 __u64 user_data; 560 __u64 user_data;
556}; 561};
557 562
563/*
564 * Request a page flip on the specified crtc.
565 *
566 * Same as struct drm_mode_crtc_page_flip, but supports new flags and
567 * re-purposes the reserved field:
568 *
569 * The sequence field must be zero unless either of the
570 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When
571 * the ABSOLUTE flag is specified, the sequence field denotes the absolute
572 * vblank sequence when the flip should take effect. When the RELATIVE
573 * flag is specified, the sequence field denotes the relative (to the
574 * current one when the ioctl is called) vblank sequence when the flip
575 * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to
576 * make sure the vblank sequence before the target one has passed before
577 * calling this ioctl. The purpose of the
578 * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify
579 * the target for when code dealing with a page flip runs during a
580 * vertical blank period.
581 */
582
583struct drm_mode_crtc_page_flip_target {
584 __u32 crtc_id;
585 __u32 fb_id;
586 __u32 flags;
587 __u32 sequence;
588 __u64 user_data;
589};
590
558/* create a dumb scanout buffer */ 591/* create a dumb scanout buffer */
559struct drm_mode_create_dumb { 592struct drm_mode_create_dumb {
560 __u32 height; 593 __u32 height;