summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2015-01-22 18:18:26 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2015-01-22 18:18:26 +0800
commit703199caf7160a33015685b2b0dbf3a29619d354 (patch)
treec74b3f32c1443c9465a93e3039cd2ea52768db5f
parentd71e7963c186d6c83b5c11028bf1261bab65fa54 (diff)
downloadexternal_drm_gralloc-703199caf7160a33015685b2b0dbf3a29619d354.zip
external_drm_gralloc-703199caf7160a33015685b2b0dbf3a29619d354.tar.gz
external_drm_gralloc-703199caf7160a33015685b2b0dbf3a29619d354.tar.bz2
gralloc_drm_pipe: fix building errors with mesa 10.4
-rw-r--r--Android.mk4
-rw-r--r--gralloc_drm_pipe.c26
2 files changed, 11 insertions, 19 deletions
diff --git a/Android.mk b/Android.mk
index 116225a..b31538b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -153,7 +153,9 @@ LOCAL_C_INCLUDES += \
endif
LOCAL_STATIC_LIBRARIES += \
- libmesa_gallium
+ libmesa_gallium \
+ libmesa_util \
+
LOCAL_SHARED_LIBRARIES += libdl
endif # DRM_USES_PIPE
include $(BUILD_SHARED_LIBRARY)
diff --git a/gralloc_drm_pipe.c b/gralloc_drm_pipe.c
index 2f96ab5..477e98f 100644
--- a/gralloc_drm_pipe.c
+++ b/gralloc_drm_pipe.c
@@ -401,25 +401,19 @@ static int pipe_init_screen(struct pipe_manager *pm)
#endif
#ifdef ENABLE_PIPE_R300
if (strcmp(pm->driver, "r300") == 0) {
- struct radeon_winsys *sws = radeon_drm_winsys_create(pm->fd);
+ struct radeon_winsys *sws =
+ radeon_drm_winsys_create(pm->fd, r300_screen_create);
- if (sws) {
- screen = r300_screen_create(sws);
- if (!screen)
- sws->destroy(sws);
- }
+ screen = sws ? sws->screen : NULL;
}
else
#endif
#ifdef ENABLE_PIPE_R600
if (strcmp(pm->driver, "r600") == 0) {
- struct radeon_winsys *sws = radeon_drm_winsys_create(pm->fd);
+ struct radeon_winsys *sws =
+ radeon_drm_winsys_create(pm->fd, r600_screen_create);
- if (sws) {
- screen = r600_screen_create(sws);
- if (!screen)
- sws->destroy(sws);
- }
+ screen = sws ? sws->screen : NULL;
}
else
#endif
@@ -428,18 +422,14 @@ static int pipe_init_screen(struct pipe_manager *pm)
struct svga_winsys_screen *sws =
svga_drm_winsys_screen_create(pm->fd);
- if (sws) {
- screen = svga_screen_create(sws);
- if (!screen)
- sws->destroy(sws);
- }
+ screen = sws ? svga_screen_create(sws) : NULL;
}
else
#endif
screen = NULL;
if (!screen) {
- ALOGW("failed to create screen for %s", pm->driver);
+ ALOGW("failed to create pipe screen for %s", pm->driver);
return -EINVAL;
}