diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2009-08-21 14:30:53 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2009-08-25 12:08:43 +0200 |
commit | bc3b1e78477dda8bfc1d4ad9fcf26bca892e6cd3 (patch) | |
tree | 789179ce9df0bcb8d4f25fbba088f4e91c626018 | |
parent | ce6c68dc8a893ed8673f49d381a8500c2ee3c29f (diff) |
Add framebuffer dirty command
-rw-r--r-- | libdrm/xf86drmMode.c | 12 | ||||
-rw-r--r-- | libdrm/xf86drmMode.h | 12 | ||||
-rw-r--r-- | shared-core/drm.h | 1 | ||||
-rw-r--r-- | shared-core/drm_mode.h | 16 |
4 files changed, 41 insertions, 0 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c index ea11207e..d1f2d60e 100644 --- a/libdrm/xf86drmMode.c +++ b/libdrm/xf86drmMode.c @@ -237,6 +237,18 @@ drmModeFBPtr drmModeGetFB(int fd, uint32_t buf) return r; } +int drmModeDirtyFB(int fd, uint32_t bufferId, + drmModeClipPtr clips, uint32_t num_clips) +{ + struct drm_mode_fb_dirty_cmd dirty = { 0 }; + + dirty.fb_id = bufferId; + dirty.clips_ptr = VOID2U64(clips); + dirty.num_clips = num_clips; + + return drmIoctl(fd, DRM_IOCTL_MODE_DIRTYFB, &dirty); +} + /* * Crtc functions diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h index 62304bb9..b15803f9 100644 --- a/libdrm/xf86drmMode.h +++ b/libdrm/xf86drmMode.h @@ -185,6 +185,11 @@ typedef struct _drmModeFB { uint32_t handle; } drmModeFB, *drmModeFBPtr; +typedef struct _drmModeClip { + uint16_t x, y; + uint16_t width, height; +} drmModeClip, *drmModeClipPtr; + typedef struct _drmModePropertyBlob { uint32_t id; uint32_t length; @@ -293,6 +298,13 @@ extern int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth, */ extern int drmModeRmFB(int fd, uint32_t bufferId); +/** + * Mark a region of a framebuffer as dirty. + */ +extern int drmModeDirtyFB(int fd, uint32_t bufferId, + drmModeClipPtr clips, uint32_t num_clips); + + /* * Crtc functions */ diff --git a/shared-core/drm.h b/shared-core/drm.h index d97844f8..d597c784 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -795,6 +795,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_DIRTYFB DRM_IOWR(0xB0, struct drm_mode_fb_dirty_cmd) /*@}*/ diff --git a/shared-core/drm_mode.h b/shared-core/drm_mode.h index 9b92733d..07f78839 100644 --- a/shared-core/drm_mode.h +++ b/shared-core/drm_mode.h @@ -227,6 +227,22 @@ struct drm_mode_fb_cmd { uint32_t handle; }; +struct drm_mode_fb_dirty_cmd { + uint32_t fb_id; + uint32_t flags; + uint32_t num_clips; + uint32_t reserved1; + uint64_t reserved2; + uint64_t clips_ptr; +}; + +struct drm_mode_fb_clip { + uint16_t x; + uint16_t y; + uint16_t width; + uint16_t height; +}; + struct drm_mode_mode_cmd { uint32_t connector_id; struct drm_mode_modeinfo mode; |