After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784272 - MetaRendererNative: Give EGLDevice backend priority over GBM
MetaRendererNative: Give EGLDevice backend priority over GBM
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-28 01:47 UTC by Miguel A. Vico Moya
Modified: 2017-07-07 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MetaRendererNative: Give EGLDevice backend priority over GBM (1.78 KB, patch)
2017-06-28 01:47 UTC, Miguel A. Vico Moya
none Details | Review
MetaRendererNative: Give EGLDevice backend priority over GBM (1.51 KB, patch)
2017-06-28 19:18 UTC, Miguel A. Vico Moya
committed Details | Review

Description Miguel A. Vico Moya 2017-06-28 01:47:28 UTC
With GLVND, whenever we have both Mesa's and NVIDIA's drives installed
in the system, initializing the GBM backend will always succeed,
regardless of what GPU you have on your system.

This is due to GBM's software rendering fallback.

It seems better to initialize the EGLDevice backend first, which will
fail to find a device match when given a non-NVIDIA GPU.
Comment 1 Miguel A. Vico Moya 2017-06-28 01:47:31 UTC
Created attachment 354601 [details] [review]
MetaRendererNative: Give EGLDevice backend priority over GBM

With GLVND, whenever we have both Mesa's and NVIDIA's drives installed
in the system, initializing the GBM backend will always succeed,
regardless of what GPU you have on your system.

This is due to GBM's software rendering fallback.

It seems better to initialize the EGLDevice backend first, which will
fail to find a device match when given a non-NVIDIA GPU.
Comment 2 Miguel A. Vico Moya 2017-06-28 01:49:07 UTC
Adding Jonas as suggested reviewer.
Comment 3 Jonas Ådahl 2017-06-28 04:30:27 UTC
Review of attachment 354601 [details] [review]:

Yep. I don't have a better solution for auto detection, so lets do this.

::: src/backends/native/meta-renderer-native.c
@@ +2076,3 @@
+   * we'll fall back to GBM (which will always succeed as it has a software
+   * rendering fallback)
+   */

nit: No need for this comment as its already in the git history.
Comment 4 Miguel A. Vico Moya 2017-06-28 19:18:38 UTC
Created attachment 354640 [details] [review]
MetaRendererNative: Give EGLDevice backend priority over GBM

Addressed comments for 354601
Comment 5 Jonas Ådahl 2017-07-07 04:21:10 UTC
Attachment 354640 [details] pushed as 7eea82d - MetaRendererNative: Give EGLDevice backend priority over GBM
Comment 6 Emmanuele Bassi (:ebassi) 2017-07-07 09:45:35 UTC
This patch broke the Mutter build.

../../src/backends/native/meta-renderer-native.c: In function 'meta_renderer_native_initable_init':
../../src/backends/native/meta-renderer-native.c:2085:21: error: 'egl_device_error' undeclared (first use in this function)
       g_error_free (egl_device_error);
                     ^
../../src/backends/native/meta-renderer-native.c:2085:21: note: each undeclared identifier is reported only once for each function it appears in
Makefile:2196: recipe for target 'backends/native/meta-renderer-native.lo' failed

Full build log: http://build.gnome.org/continuous/buildmaster/builds/2017/07/07/14/build/log-mutter.txt
Comment 7 Jonas Ådahl 2017-07-07 11:33:56 UTC
Missing #ifdef on a g_error_free(). Already on master before I noticed this was reopened.
Comment 8 Miguel A. Vico Moya 2017-07-07 20:38:23 UTC
Thanks for the quick fix, Jonas.