[Mesa-dev] [PATCH v3 3/4] platform/android: Enable kms_swrast fallback
Robert Foss
robert.foss at collabora.com
Tue Jul 24 09:09:38 UTC 2018
Add support for the ForceSoftware option, which is togglable
on the Android platform through setting the "drm.gpu.force_software"
property to a non-zero value.
kms_swrast is also enabled as a fallback for when a driver is not
able to be loaded for for a drm node that was opened.
Signed-off-by: Robert Foss <robert.foss at collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
---
Changes since v2:
- Further remove variable/argument that is just a copy of other variable
Changes since v1:
- Added r-b
- Removed local variable
Changes since RFC:
- Removed whitespace change
- Switched variable type from int to EGLBoolean
- Removed software renderer fallback from platform_android, since
it is already implemented in _eglMatchDriver()
src/egl/drivers/dri2/platform_android.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 92b2d2b343e..669881a7152 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1198,7 +1198,11 @@ droid_load_driver(_EGLDisplay *disp)
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const char *err;
- dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd);
+ if (disp->Options.ForceSoftware)
+ dri2_dpy->driver_name = strdup("kms_swrast");
+ else
+ dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd);
+
if (dri2_dpy->driver_name == NULL)
return false;
@@ -1362,10 +1366,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
const char *err;
int ret;
- /* Not supported yet */
- if (disp->Options.ForceSoftware)
- return EGL_FALSE;
-
loader_set_logger(_eglLog);
dri2_dpy = calloc(1, sizeof(*dri2_dpy));
@@ -1384,10 +1384,12 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->fd = droid_open_device(disp);
if (dri2_dpy->fd < 0) {
- err = "DRI2: failed to open device";
+ err = "DRI2: failed to open device, trying software device";
goto cleanup;
}
+ /* Fallback to forcing software rendering is implemented using
+ * disp->Options.ForceSoftware in egldriver.c */
if (!droid_load_driver(disp)) {
err = "DRI2: failed to load driver";
goto cleanup;
--
2.17.1
More information about the mesa-dev
mailing list