Mesa (master): egl/android: chose node type based on swrast and preprocessor flags

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 27 17:39:50 UTC 2019


Module: Mesa
Branch: master
Commit: ac839bbf79d9ddcc11669bd9d9f19ac62a0366c0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac839bbf79d9ddcc11669bd9d9f19ac62a0366c0

Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date:   Tue Mar 26 19:20:13 2019 -0700

egl/android: chose node type based on swrast and preprocessor flags

kms_swrast can work with primary nodes out of the box, but also
with rendernodes if the build environment specifies the
EGL_FORCE_RENDERNODE flag.

Suggested-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/egl/drivers/dri2/platform_android.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index e25a6f73ed8..e9ea9e6002b 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1480,6 +1480,12 @@ droid_open_device(_EGLDisplay *disp, bool swrast)
    char *vendor_name = NULL;
    char vendor_buf[PROPERTY_VALUE_MAX];
 
+#ifdef EGL_FORCE_RENDERNODE
+   const unsigned node_type = DRM_NODE_RENDER;
+#else
+   const unsigned node_type = swrast ? DRM_NODE_PRIMARY : DRM_NODE_RENDER;
+#endif
+
    if (property_get("drm.gpu.vendor_name", vendor_buf, NULL) > 0)
       vendor_name = vendor_buf;
 
@@ -1490,13 +1496,13 @@ droid_open_device(_EGLDisplay *disp, bool swrast)
    for (int i = 0; i < num_devices; i++) {
       device = devices[i];
 
-      if (!(device->available_nodes & (1 << DRM_NODE_RENDER)))
+      if (!(device->available_nodes & (1 << node_type)))
          continue;
 
-      dri2_dpy->fd = loader_open_device(device->nodes[DRM_NODE_RENDER]);
+      dri2_dpy->fd = loader_open_device(device->nodes[node_type]);
       if (dri2_dpy->fd < 0) {
          _eglLog(_EGL_WARNING, "%s() Failed to open DRM device %s",
-                 __func__, device->nodes[DRM_NODE_RENDER]);
+                 __func__, device->nodes[node_type]);
          continue;
       }
 




More information about the mesa-commit mailing list