[Beignet] [PATCH] intel: Fall back to DRM render nodes under Wayland

Yusuke Suzuki utatane.tea at gmail.com
Tue Jul 31 14:41:33 UTC 2018


When we are using Wayland, XOpenDisplay succeeds because of XWayland.
However VA_DRI2QueryExtension for that display fails, and we give up
initializing beignet on Wayland environment. This patch changes this
initialization strategy: falling back to using DRM render nodes or
DRM nodes. In the future, we should have code handling Wayland display
before starting X11 path.

Signed-off-by: Yusuke Suzuki <utatane.tea at gmail.com>
---
 src/intel/intel_driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index 3caf7378..85b3ca35 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -235,8 +235,12 @@ if(intel->x11_display) {
     intel_driver_init_shared(intel, intel->dri_ctx);
     Xfree(driver_name);
   }
-  else
-    fprintf(stderr, "X server found. dri2 connection failed! \n");
+  else {
+    // If you run beignet under Wayland, XOpenDisplay succeeds, but
+    // VA_DRI2QueryExtension fails. We fall back to using DRM render node.
+    XCloseDisplay(intel->x11_display);
+    intel->x11_display = NULL;
+  }
 }
 #endif
 
-- 
2.18.0



More information about the Beignet mailing list