Cc: [email protected]

On 13-07-24 08:29 PM, Dave Airlie wrote:
From: Dave Airlie <[email protected]>

This just ports the code from the mesa glx setup into vdpau,
this just picks the correct driver to load on the client side,

at least for gallium/vl code we need another similiar change
inside the driver code to pick the correct drm device.

Signed-off-by: Dave Airlie <[email protected]>
---
  src/mesa_dri2.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)

diff --git a/src/mesa_dri2.c b/src/mesa_dri2.c
index 3bc75ef..5f7146a 100644
--- a/src/mesa_dri2.c
+++ b/src/mesa_dri2.c
@@ -128,6 +128,20 @@ _vdp_DRI2Connect(Display * dpy, XID window, char 
**driverName, char **deviceName
     req->dri2ReqType = X_DRI2Connect;
     req->window = window;
     req->driverType = DRI2DriverVDPAU;
+#ifdef DRI2DriverPrimeShift
+   {
+      char *prime = getenv("DRI_PRIME");
+      if (prime) {
+         unsigned int primeid;
+         errno = 0;
+         primeid = strtoul(prime, NULL, 0);
+         if (errno == 0)
+            req->driverType |=
+               ((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
+      }
+   }
+#endif
+
     if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
        UnlockDisplay(dpy);
        SyncHandle();


_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to