summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-08-01 20:21:30 +0100
committerChih-Wei Huang <cwhuang@linux.org.tw>2015-01-22 09:46:13 +0800
commit10334153b198f59cd598fc5fd25185d9032921c9 (patch)
treee66385ce996f2e0646695637f5438314e153c570
parenteccafc5cee44cb0a42a465bd6d9e3ec9018d5a2a (diff)
downloadexternal_drm_gralloc-10334153b198f59cd598fc5fd25185d9032921c9.zip
external_drm_gralloc-10334153b198f59cd598fc5fd25185d9032921c9.tar.gz
external_drm_gralloc-10334153b198f59cd598fc5fd25185d9032921c9.tar.bz2
gralloc_drm_pipe: bail out as soon as the correct screen_create is called
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--gralloc_drm_pipe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gralloc_drm_pipe.c b/gralloc_drm_pipe.c
index 1183ba1..2f96ab5 100644
--- a/gralloc_drm_pipe.c
+++ b/gralloc_drm_pipe.c
@@ -387,15 +387,17 @@ static void pipe_destroy(struct gralloc_drm_drv_t *drv)
static int pipe_init_screen(struct pipe_manager *pm)
{
- struct pipe_screen *screen = NULL;
+ struct pipe_screen *screen;
#ifdef ENABLE_PIPE_FREEDRENO
if (strcmp(pm->driver, "msm"))
screen = fd_drm_screen_create(pm->fd);
+ else
#endif
#ifdef ENABLE_PIPE_NOUVEAU
if (strcmp(pm->driver, "nouveau") == 0)
screen = nouveau_drm_screen_create(pm->fd);
+ else
#endif
#ifdef ENABLE_PIPE_R300
if (strcmp(pm->driver, "r300") == 0) {
@@ -407,6 +409,7 @@ static int pipe_init_screen(struct pipe_manager *pm)
sws->destroy(sws);
}
}
+ else
#endif
#ifdef ENABLE_PIPE_R600
if (strcmp(pm->driver, "r600") == 0) {
@@ -418,6 +421,7 @@ static int pipe_init_screen(struct pipe_manager *pm)
sws->destroy(sws);
}
}
+ else
#endif
#ifdef ENABLE_PIPE_VMWGFX
if (strcmp(pm->driver, "vmwgfx") == 0) {
@@ -430,7 +434,9 @@ static int pipe_init_screen(struct pipe_manager *pm)
sws->destroy(sws);
}
}
+ else
#endif
+ screen = NULL;
if (!screen) {
ALOGW("failed to create screen for %s", pm->driver);