[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dri-patches
Subject:    drm: Branch 'master' - 4 commits
From:       wallbraker () kemper ! freedesktop ! org (Jakob Bornecrantz)
Date:       2009-12-04 0:19:24
Message-ID: 20091204001924.D555B10051 () kemper ! freedesktop ! org
[Download RAW message or body]

 include/drm/drm.h      |    1 +
 include/drm/drm_mode.h |   39 +++++++++++++++++++++++++++++++++++++++
 xf86drmMode.c          |   12 ++++++++++++
 xf86drmMode.h          |   20 ++++++++++++++++++++
 4 files changed, 72 insertions(+)

New commits:
commit 3bd834a2178ee1273fd84628e87210a500f8fc84
Merge: be957cc... ac5595a...
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed Dec 2 19:40:58 2009 +0100

    Merge branch 'modesetting-dirty-libdrm'
    
    Conflicts:
    	include/drm/drm.h

diff --cc include/drm/drm.h
index 5408c08,225ab6c..4822159
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@@ -696,10 -696,8 +696,11 @@@ 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_PAGE_FLIP	DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
+ #define DRM_IOCTL_MODE_DIRTYFB		DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
  
 +/*@}*/
 +
  /**
   * Device specific ioctls should only be in their respective headers
   * The device specific ioctl range is from 0x40 to 0x99.
commit ac5595abc1c28b2c10a1463143e83d17415736f1
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed Dec 2 19:39:16 2009 +0100

    Change the number on the dirty ioctl to match upstream

diff --git a/include/drm/drm.h b/include/drm/drm.h
index 8e1ffb8..225ab6c 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
commit 019a408a69896497ca728b703c349306efd1a225
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Mon Nov 30 00:40:51 2009 +0000

    Change the dirty ioctl a bit and comment it

diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 9252653..042da5c 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;
 };
 
commit 3e48613b482a8ca01ea5719e9cc342a9d4b28db0
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Tue Nov 24 18:00:12 2009 +0100

    Bring dirty code from old branch

diff --git a/include/drm/drm.h b/include/drm/drm.h
index 649c46f..8e1ffb8 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 852505e..9252653 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;
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 6d85113..7481ad6 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -241,6 +241,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/xf86drmMode.h b/xf86drmMode.h
index 62304bb..226d946 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -145,6 +145,17 @@
 
 #endif /* _DRM_MODE_H */
 
+
+/*
+ * Feature defines
+ *
+ * Just because these are defined doesn't mean that the kernel
+ * can do that feature, its just for new code vs old libdrm.
+ */
+#define DRM_MODE_FEATURE_KMS		1
+#define DRM_MODE_FEATURE_DIRTYFB	1
+
+
 typedef struct _drmModeRes {
 
 	int count_fbs;
@@ -185,6 +196,8 @@ typedef struct _drmModeFB {
 	uint32_t handle;
 } drmModeFB, *drmModeFBPtr;
 
+typedef struct drm_clip_rect drmModeClip, *drmModeClipPtr;
+
 typedef struct _drmModePropertyBlob {
 	uint32_t id;
 	uint32_t length;
@@ -293,6 +306,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
  */

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
--
_______________________________________________
Dri-patches mailing list
Dri-patches@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic