From 3e48613b482a8ca01ea5719e9cc342a9d4b28db0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 24 Nov 2009 18:00:12 +0100 Subject: Bring dirty code from old branch --- include/drm/drm.h | 1 + include/drm/drm_mode.h | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'include/drm') diff --git a/include/drm/drm.h b/include/drm/drm.h index 649c46f3..8e1ffb86 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -696,6 +696,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, unsigned int) +#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB0, struct drm_mode_fb_dirty_cmd) /** * Device specific ioctls should only be in their respective headers diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 852505e7..92526537 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h @@ -222,6 +222,15 @@ struct drm_mode_fb_cmd { __u32 handle; }; +struct drm_mode_fb_dirty_cmd { + __u32 fb_id; + __u32 flags; + __u32 num_clips; + __u32 reserved1; + __u64 reserved2; + __u64 clips_ptr; +}; + struct drm_mode_mode_cmd { __u32 connector_id; struct drm_mode_modeinfo mode; -- cgit v1.2.3 From 019a408a69896497ca728b703c349306efd1a225 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 30 Nov 2009 00:40:51 +0000 Subject: Change the dirty ioctl a bit and comment it --- include/drm/drm_mode.h | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'include/drm') diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 92526537..042da5c3 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h @@ -222,12 +222,42 @@ struct drm_mode_fb_cmd { __u32 handle; }; +#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 +#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 +#define DRM_MODE_FB_DIRTY_FLAGS 0x03 + +/* + * Mark a region of a framebuffer as dirty. + * + * Some hardware does not automatically update display contents + * as a hardware or software draw to a framebuffer. This ioctl + * allows userspace to tell the kernel and the hardware what + * regions of the framebuffer have changed. + * + * The kernel or hardware is free to update more then just the + * region specified by the clip rects. The kernel or hardware + * may also delay and/or coalesce several calls to dirty into a + * single update. + * + * Userspace may annotate the updates, the annotates are a + * promise made by the caller that the change is either a copy + * of pixels or a fill of a single color in the region specified. + * + * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then + * the number of updated regions are half of num_clips given, + * where the clip rects are paired in src and dst. The width and + * height of each one of the pairs must match. + * + * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller + * promises that the region specified of the clip rects is filled + * completely with a single color as given in the color argument. + */ + struct drm_mode_fb_dirty_cmd { __u32 fb_id; __u32 flags; + __u32 color; __u32 num_clips; - __u32 reserved1; - __u64 reserved2; __u64 clips_ptr; }; -- cgit v1.2.3 From ac5595abc1c28b2c10a1463143e83d17415736f1 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 2 Dec 2009 19:39:16 +0100 Subject: Change the number on the dirty ioctl to match upstream --- include/drm/drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/drm') diff --git a/include/drm/drm.h b/include/drm/drm.h index 8e1ffb86..225ab6ce 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -696,7 +696,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, unsigned int) -#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB0, struct drm_mode_fb_dirty_cmd) +#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) /** * Device specific ioctls should only be in their respective headers -- cgit v1.2.3