Mesa (master): android: use gralloc_drm_get_gem_handle api

Chad Versace chadversary at kemper.freedesktop.org
Mon Jan 28 20:52:17 UTC 2013


Module: Mesa
Branch: master
Commit: 407029591c24edfd75970e8709f68b8e800ff50a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=407029591c24edfd75970e8709f68b8e800ff50a

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Thu Jan 24 09:56:47 2013 +0200

android: use gralloc_drm_get_gem_handle api

Currently a gralloc internal structure is exposed to Mesa,
Use a query function instead to maintain ABI compatibility.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

---

 src/egl/drivers/dri2/platform_android.c            |    8 ++------
 src/egl/main/Android.mk                            |    4 +++-
 .../state_trackers/egl/android/native_android.cpp  |   10 ++--------
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 7ede48d..3432f18 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -41,6 +41,7 @@
 #include <radeon_drm.h>
 
 #include "egl_dri2.h"
+#include "gralloc_drm.h"
 
 static int
 get_format_bpp(int native)
@@ -72,12 +73,7 @@ get_format_bpp(int native)
 static int
 get_native_buffer_name(struct ANativeWindowBuffer *buf)
 {
-   struct gralloc_drm_handle_t *handle;
-
-   /* check that the buffer is allocated by drm_gralloc and cast */
-   handle = gralloc_drm_handle(buf->handle);
-
-   return (handle) ? handle->name : 0;
+   return gralloc_drm_get_gem_handle(buf->handle);
 }
 
 static EGLBoolean
diff --git a/src/egl/main/Android.mk b/src/egl/main/Android.mk
index 97e4860..3751ecf 100644
--- a/src/egl/main/Android.mk
+++ b/src/egl/main/Android.mk
@@ -65,7 +65,9 @@ LOCAL_SHARED_LIBRARIES := \
 	libdl \
 	libhardware \
 	liblog \
-	libcutils
+	libcutils \
+	libgralloc_drm \
+
 
 # add libdrm if there are hardware drivers
 ifneq ($(MESA_GPU_DRIVERS),swrast)
diff --git a/src/gallium/state_trackers/egl/android/native_android.cpp b/src/gallium/state_trackers/egl/android/native_android.cpp
index 267727d..391decc 100644
--- a/src/gallium/state_trackers/egl/android/native_android.cpp
+++ b/src/gallium/state_trackers/egl/android/native_android.cpp
@@ -147,18 +147,12 @@ get_pipe_format(int native)
 
 #ifndef ANDROID_BACKEND_NO_DRM
 
-#include <gralloc_drm_handle.h>
+#include <gralloc_drm.h>
 static int
 get_handle_name(buffer_handle_t handle)
 {
-   struct gralloc_drm_handle_t *dh;
-
-   /* check that the buffer is allocated by drm_gralloc and cast */
-   dh = gralloc_drm_handle(handle);
-
-   return (dh) ? dh->name : 0;
+   return gralloc_drm_get_gem_handle(handle);
 }
-
 #else
 
 static int




More information about the mesa-commit mailing list