diff options
author | Dave Airlie <airlied@redhat.com> | 2013-07-24 20:29:28 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2013-07-25 22:10:04 -0700 |
commit | 22a2f15f3e5f36641f72211da9f786b6778d0481 (patch) | |
tree | e9c0bcc949a221d71e5d19fe7b23f7a37bb1e836 /src | |
parent | e6c11e0be829b0a80a3b020f7f9f56e0c7d0585a (diff) |
vdpau: add prime support at connection setup
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 <airlied@redhat.com>
Tested-by: Martin Peres <martin.peres@ensi-bourges.fr>
Tested-by: Hohahiu <rakothedin@gmail.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67283
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa_dri2.c | 14 |
1 files changed, 14 insertions, 0 deletions
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(); |