Mesa (master): egl/android: move droid_open_device_drm_gralloc down a bit
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Mar 27 17:39:50 UTC 2019
Module: Mesa
Branch: master
Commit: 95ad1744c11cb3e1e226eb598984108f20ac9a7f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=95ad1744c11cb3e1e226eb598984108f20ac9a7f
Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date: Mon Mar 25 16:46:31 2019 -0700
egl/android: move droid_open_device_drm_gralloc down a bit
1) Removes a forward declaration.
2) Makes next patch easier.
Suggested-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/egl/drivers/dri2/platform_android.c | 51 ++++++++++++++++-----------------
1 file changed, 24 insertions(+), 27 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 0de68afc615..b9ba29f6979 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1206,33 +1206,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
return (config_count != 0);
}
-static EGLBoolean
-droid_probe_device(_EGLDisplay *disp);
-
-#ifdef HAVE_DRM_GRALLOC
-static EGLBoolean
-droid_open_device_drm_gralloc(_EGLDisplay *disp)
-{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- int fd = -1, err = -EINVAL;
-
- if (dri2_dpy->gralloc->perform)
- err = dri2_dpy->gralloc->perform(dri2_dpy->gralloc,
- GRALLOC_MODULE_PERFORM_GET_DRM_FD,
- &fd);
- if (err || fd < 0) {
- _eglLog(_EGL_WARNING, "fail to get drm fd");
- return EGL_FALSE;
- }
-
- dri2_dpy->fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
- if (dri2_dpy->fd < 0)
- return EGL_FALSE;
-
- return droid_probe_device(disp);
-}
-#endif /* HAVE_DRM_GRALLOC */
-
static const struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
.create_window_surface = droid_create_window_surface,
@@ -1459,6 +1432,30 @@ droid_probe_device(_EGLDisplay *disp)
return EGL_TRUE;
}
+#ifdef HAVE_DRM_GRALLOC
+static EGLBoolean
+droid_open_device_drm_gralloc(_EGLDisplay *disp)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ int fd = -1, err = -EINVAL;
+
+ if (dri2_dpy->gralloc->perform)
+ err = dri2_dpy->gralloc->perform(dri2_dpy->gralloc,
+ GRALLOC_MODULE_PERFORM_GET_DRM_FD,
+ &fd);
+ if (err || fd < 0) {
+ _eglLog(_EGL_WARNING, "fail to get drm fd");
+ return EGL_FALSE;
+ }
+
+ dri2_dpy->fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
+ if (dri2_dpy->fd < 0)
+ return EGL_FALSE;
+
+ return droid_probe_device(disp);
+}
+#endif /* HAVE_DRM_GRALLOC */
+
static EGLBoolean
droid_open_device(_EGLDisplay *disp)
{
More information about the mesa-commit
mailing list