From cbf96c0d9e4fec7462dd9ce71a2805437501418f Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sun, 10 Apr 2016 16:22:58 +0200 Subject: gralloc_drm: use pipe as a fallback instead of default Current implementation prefers gralloc_drm_pipe over gralloc_drm_{driver} while it may be the target solution, for nouveau it causes problems because it is not anymore possible to use gralloc_drm_nouveau whenever there is a driver ( e.g. swrast) in BoardConfig.mk BOARD_GPU_DRIVERS not matching the list of valid drivers in drm_gralloc Android.mk --- gralloc_drm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gralloc_drm.c b/gralloc_drm.c index 6b3825e..23815bb 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -68,13 +68,6 @@ init_drv_from_fd(int fd) } if (version->name) { -#ifdef ENABLE_PIPE - drv = gralloc_drm_drv_create_for_pipe(fd, version->name); - if (drv) { - ALOGI("create pipe for driver %s", version->name); - } else -#endif - #ifdef ENABLE_FREEDRENO if (!strcmp(version->name, "msm")) { drv = gralloc_drm_drv_create_for_freedreno(fd); @@ -99,6 +92,12 @@ init_drv_from_fd(int fd) ALOGI_IF(drv, "create nouveau for driver nouveau"); } else #endif +#ifdef ENABLE_PIPE + if (!drv) { + drv = gralloc_drm_drv_create_for_pipe(fd, version->name); + ALOGI_IF(drv, "create pipe for driver %s", version->name); + } else +#endif if (!drv) { ALOGE("unsupported driver: %s", (version->name) ? version->name : "NULL"); -- cgit v1.1