From df65bb660dfca266bca6f419515273d4b5b63ec6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 25 Jul 2013 11:13:02 +1000 Subject: [PATCH] vdpau: add prime support at connection setup --- 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(); -- 1.8.3.1