From 703199caf7160a33015685b2b0dbf3a29619d354 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Thu, 22 Jan 2015 18:18:26 +0800 Subject: gralloc_drm_pipe: fix building errors with mesa 10.4 --- Android.mk | 4 +++- gralloc_drm_pipe.c | 26 ++++++++------------------ 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; } -- cgit v1.1