summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-06-20 12:37:12 +0100
committerDave Airlie <airlied@redhat.com>2012-07-07 10:37:10 +0100
commitf2da2c12042d3447b1c954e7301632d174a08b4f (patch)
tree9db604533955ea3b1332a55d5cd73be4d50c8c82 /include
parent0b0e7148925e1f835d4f4f06e402a97023531828 (diff)
randr: add initial scanout pixmap support (v3)
When randr notices a crtc configuration request for a slave device, it checks if the slave allocated pixmap exists and is suitable, if not it allocates a new shared pixmap from the master, shares it to the slave, and starts the master tracking damage to it, to keep it updated from the current front pixmap. If the resize means the crtc is no longer used it will destroy the slave pixmap. This adds the concept of a scanout_pixmap to the randr_crtc object, and also adds a master pixmap pointer to the pixmap object, along with defining some pixmap helper functions for getting pixmap box/regions. v2: split out pixmap sharing to a separate function. v3: update for void * Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/pixmap.h3
-rw-r--r--include/pixmapstr.h22
2 files changed, 25 insertions, 0 deletions
diff --git a/include/pixmap.h b/include/pixmap.h
index 9bb5bb7b8..8c523bdd9 100644
--- a/include/pixmap.h
+++ b/include/pixmap.h
@@ -109,4 +109,7 @@ extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ ,
extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
+extern _X_EXPORT PixmapPtr
+PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave);
+
#endif /* PIXMAP_H */
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 0800c62b2..40af5c4a3 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -80,6 +80,28 @@ typedef struct _Pixmap {
short screen_y;
#endif
unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */
+
+ PixmapPtr master_pixmap; /* pointer to master copy of pixmap for pixmap sharing */
} PixmapRec;
+static inline void
+PixmapBox(BoxPtr box, PixmapPtr pixmap)
+{
+ box->x1 = 0;
+ box->x2 = pixmap->drawable.width;
+
+ box->y1 = 0;
+ box->y2 = pixmap->drawable.height;
+}
+
+
+static inline void
+PixmapRegionInit(RegionPtr region, PixmapPtr pixmap)
+{
+ BoxRec box;
+
+ PixmapBox(&box, pixmap);
+ RegionInit(region, &box, 1);
+}
+
#endif /* PIXMAPSTRUCT_H */