[PATCH 3/4] xfree86: Do not bother registering xv/xvmc on gpu screens

Timo Aaltonen tjaalton at ubuntu.com
Thu Mar 16 10:29:43 UTC 2017


From: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
---
 hw/xfree86/common/xf86xv.c   |  2 +-
 hw/xfree86/common/xf86xvmc.c | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index d613d71..17f7214 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -230,7 +230,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num)
     ScrnInfoPtr pScrn;
     XF86XVScreenPtr ScreenPriv;
 
-    if (num <= 0 || noXvExtension)
+    if (num <= 0 || noXvExtension || pScreen->isGPU)
         return FALSE;
 
     if (Success != XvScreenInit(pScreen))
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index a0a94c7..9091a14 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -148,11 +148,15 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
 {
     XvMCAdaptorPtr pAdapt;
     xf86XvMCScreenPtr pScreenPriv;
-    XvScreenPtr pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
-                                                      XF86XvScreenKey);
+    XvScreenPtr pxvs;
     int i, j;
 
-    if (noXvExtension)
+    if (noXvExtension || pScreen->isGPU || !XF86XvScreenKey)
+        return FALSE;
+
+    pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+                                          XF86XvScreenKey);
+    if (!pxvs)
         return FALSE;
 
     if (!(pAdapt = xallocarray(num_adaptors, sizeof(XvMCAdaptorRec))))
-- 
2.7.4



More information about the xorg-devel mailing list