summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-03 20:43:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-04 08:49:59 +0100
commitdf68723baae71498de95924c72d4f23fa7fc7fdf (patch)
treeff2c26b526c490f3bb611e28f7a447079a7a0fa8 /src/sna/sna.h
parente3ad18036b4dca29744ecfa4694006f01dd3fd18 (diff)
sna: Port prime interfacing
Preliminary prime support. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r--src/sna/sna.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index d655da0b..b8760616 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -47,6 +47,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <xorg-server.h>
#include <xf86Crtc.h>
+#if XF86_CRTC_VERSION >= 5
+#define HAS_PIXMAP_SHARING 1
+#endif
+
#include <xf86str.h>
#include <windowstr.h>
#include <glyphstr.h>
@@ -149,9 +153,11 @@ static inline PixmapPtr get_drawable_pixmap(DrawablePtr drawable)
return get_window_pixmap((WindowPtr)drawable);
}
+extern DevPrivateKeyRec sna_pixmap_key;
+
constant static inline struct sna_pixmap *sna_pixmap(PixmapPtr pixmap)
{
- return ((void **)pixmap->devPrivates)[1];
+ return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[1];
}
static inline struct sna_pixmap *sna_pixmap_from_drawable(DrawablePtr drawable)
@@ -167,7 +173,7 @@ struct sna_gc {
static inline struct sna_gc *sna_gc(GCPtr gc)
{
- return (struct sna_gc *)gc->devPrivates;
+ return dixGetPrivateAddr(&gc->devPrivates, &sna_gc_key);
}
enum {
@@ -309,7 +315,7 @@ to_sna_from_screen(ScreenPtr screen)
constant static inline struct sna *
to_sna_from_pixmap(PixmapPtr pixmap)
{
- return *(void **)pixmap->devPrivates;
+ return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[0];
}
constant static inline struct sna *