[PATCH] dri2proto: add prime protocol support.

Dave Airlie airlied at gmail.com
Tue Jun 26 02:20:13 PDT 2012


From: Dave Airlie <airlied at redhat.com>

So we reserve bits 8->16 for offload device ids, this means we can
have 7 offload devices, which is plenty for now, and we can bump
this further later without fear.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 dri2tokens.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dri2tokens.h b/dri2tokens.h
index 16c9008..872c179 100644
--- a/dri2tokens.h
+++ b/dri2tokens.h
@@ -45,6 +45,11 @@
 #define DRI2BufferDepthStencil		9
 #define DRI2BufferHiz			10
 
+/* keep bits 16 and above for prime IDs */
+#define DRI2DriverMaxPrime              8 /* 0 - 7 */              
+#define DRI2DriverPrimeShift           16
+#define DRI2DriverPrimeId(x)         (((x) >> DRI2DriverPrimeShift) & (DRI2DriverMaxPrime-1))
+
 #define DRI2DriverDRI			0
 #define DRI2DriverVDPAU			1
 
-- 
1.7.10.2



More information about the xorg-devel mailing list