aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-03-13 10:43:35 -0700
committerGurchetan Singh <[email protected]>2019-03-27 17:26:21 +0000
commitf90fc102ed7795634af342fb4bf8aeafbc47d917 (patch)
tree5e6404baf6f9178f5c3f3d2418eb290b8ba81c52
parent7d9719db8340796046f03d1bda0268bad06159db (diff)
egl/android: plumb swrast option
It's good to have options. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
-rw-r--r--src/egl/drivers/dri2/platform_android.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 246951a8a5c..1c508b9feb3 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1346,7 +1346,7 @@ static const __DRIextension *droid_image_loader_extensions[] = {
};
static EGLBoolean
-droid_load_driver(_EGLDisplay *disp)
+droid_load_driver(_EGLDisplay *disp, bool swrast)
{
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const char *err;
@@ -1408,13 +1408,13 @@ droid_filter_device(_EGLDisplay *disp, int fd, const char *vendor)
}
static EGLBoolean
-droid_probe_device(_EGLDisplay *disp)
+droid_probe_device(_EGLDisplay *disp, bool swrast)
{
/* Check that the device is supported, by attempting to:
* - load the dri module
* - and, create a screen
*/
- if (!droid_load_driver(disp))
+ if (!droid_load_driver(disp, swrast))
return EGL_FALSE;
if (!dri2_create_screen(disp)) {
@@ -1427,7 +1427,7 @@ droid_probe_device(_EGLDisplay *disp)
#ifdef HAVE_DRM_GRALLOC
static EGLBoolean
-droid_open_device(_EGLDisplay *disp)
+droid_open_device(_EGLDisplay *disp, bool swrast)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int fd = -1, err = -EINVAL;
@@ -1448,11 +1448,11 @@ droid_open_device(_EGLDisplay *disp)
if (drmGetNodeTypeFromFd(dri2_dpy->fd) == DRM_NODE_RENDER)
return EGL_FALSE;
- return droid_probe_device(disp);
+ return droid_probe_device(disp, swrast);
}
#else
static EGLBoolean
-droid_open_device(_EGLDisplay *disp)
+droid_open_device(_EGLDisplay *disp, bool swrast)
{
#define MAX_DRM_DEVICES 64
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -1495,14 +1495,14 @@ droid_open_device(_EGLDisplay *disp)
/* If the requested device matches - use it. Regardless if
* init fails, do not fall-back to any other device.
*/
- if (!droid_probe_device(disp)) {
+ if (!droid_probe_device(disp, false)) {
close(dri2_dpy->fd);
dri2_dpy->fd = -1;
}
break;
}
- if (droid_probe_device(disp))
+ if (droid_probe_device(disp, swrast))
break;
/* No explicit request - attempt the next device */
@@ -1549,7 +1549,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
disp->DriverData = (void *) dri2_dpy;
- if (!droid_open_device(disp)) {
+ if (!droid_open_device(disp, false)) {
err = "DRI2: failed to open device";
goto cleanup;
}