intel: Fall back to DRM render nodes under Wayland

Submitted by Yusuke Suzuki on July 31, 2018, 2:41 p.m.

Details

Message ID 20180731144133.23059-1-utatane.tea@gmail.com
State New
Headers show
Series "intel: Fall back to DRM render nodes under Wayland" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Yusuke Suzuki July 31, 2018, 2:41 p.m.
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@gmail.com>
---
 src/intel/intel_driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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
 

Comments

Does your system need this patch to make Beignet work at all, or only to 
get rid of the message?  What hardware (lspci -nn | grep 0300) and what 
version of Beignet?

That message is known to trigger on Wayland, but when I tested it, 
Beignet still worked after it was shown.  It has already been removed 
(but without your other changes) in git master.

https://lists.freedesktop.org/archives/beignet/2018-January/009183.html
https://cgit.freedesktop.org/beignet/commit/?id=d1b99a1da56757971753288986419f1b8b9d55f4