diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-05-01 14:33:22 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-05-01 14:33:22 -0700 |
commit | e98581da95db3173a07ac0afdf155e65a2c5fc5d (patch) | |
tree | ecb98b92a6f24e9883f48c09620f0f17f2128c92 | |
parent | 11b60973bca1bc9bbda44be4c695e22d28d8ca4a (diff) |
libdrm: add KMS page flip interface
Sits on top of KMS page flipping ioctl.
-rw-r--r-- | libdrm/xf86drmMode.c | 13 | ||||
-rw-r--r-- | libdrm/xf86drmMode.h | 4 | ||||
-rw-r--r-- | shared-core/drm.h | 2 | ||||
-rw-r--r-- | shared-core/drm_mode.h | 19 |
4 files changed, 35 insertions, 3 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c index ea11207e..ada56904 100644 --- a/libdrm/xf86drmMode.c +++ b/libdrm/xf86drmMode.c @@ -664,3 +664,16 @@ int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size, return 0; } + +int drmModePageFlip(int fd, uint32_t *crtc_ids, uint32_t crtc_count, + uint32_t fb_id) +{ + struct drm_gem_page_flip flip; + + flip.fb_id = fb_id; + flip.crtc_ids_ptr = (uint64_t)crtc_ids; + flip.crtc_count = (uint32_t)crtc_count; + flip.flags = 0; + + return drmIoctl(fd, DRM_IOCTL_GEM_PAGE_FLIP, &flip); +} diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h index 62304bb9..2406e2fc 100644 --- a/libdrm/xf86drmMode.h +++ b/libdrm/xf86drmMode.h @@ -259,8 +259,6 @@ typedef struct _drmModeConnector { uint32_t *encoders; /**< List of encoder ids */ } drmModeConnector, *drmModeConnectorPtr; - - extern void drmModeFreeModeInfo( drmModeModeInfoPtr ptr ); extern void drmModeFreeResources( drmModeResPtr ptr ); extern void drmModeFreeFB( drmModeFBPtr ptr ); @@ -362,3 +360,5 @@ extern int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size, uint16_t *red, uint16_t *green, uint16_t *blue); extern int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size, uint16_t *red, uint16_t *green, uint16_t *blue); +extern int drmModePageFlip(int fd, uint32_t *crtc_ids, uint32_t crtc_count, + uint32_t fb_id); diff --git a/shared-core/drm.h b/shared-core/drm.h index b97ba098..2353ac42 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -1107,7 +1107,7 @@ struct drm_gem_open { #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, uint32_t) -#define DRM_IOCTL_MODE_REPLACEFB DRM_IOWR(0xB0, struct drm_mode_fb_cmd) +#define DRM_IOCTL_GEM_PAGE_FLIP DRM_IOW( 0xB0, struct drm_gem_page_flip) /*@}*/ diff --git a/shared-core/drm_mode.h b/shared-core/drm_mode.h index 9b92733d..2354f775 100644 --- a/shared-core/drm_mode.h +++ b/shared-core/drm_mode.h @@ -270,4 +270,23 @@ struct drm_mode_crtc_lut { uint64_t blue; }; +#define DRM_PAGE_FLIP_WAIT (1<<0) /* block on previous page flip */ +#define DRM_PAGE_FLIP_FLAGS_MASK (DRM_PAGE_FLIP_WAIT) + +struct drm_gem_page_flip { + /** Handle of new front buffer */ + uint32_t fb_id; + + /** + * crtcs to flip + */ + uint32_t crtc_count; + uint64_t crtc_ids_ptr; + + /** + * page flip flags (wait on flip only for now) + */ + uint32_t flags; +}; + #endif |