summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/android
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-08-25 21:36:19 +0800
committerChia-I Wu <[email protected]>2011-08-27 18:02:11 +0800
commit09b5f1fd61bfbb5afdaee81687a9c74c70a62b8a (patch)
treee38f04d23943d6a28b5ee0defb2eb50ca4f08fbf /src/gallium/state_trackers/egl/android
parent534df791878ed90cf7c2e4f14482ff03b7c41e77 (diff)
android: make DRM optional
For BOARD_GPU_DRIVERS=swrast build, DRM is not needed.
Diffstat (limited to 'src/gallium/state_trackers/egl/android')
-rw-r--r--src/gallium/state_trackers/egl/android/native_android.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/android/native_android.cpp b/src/gallium/state_trackers/egl/android/native_android.cpp
index 211d6a2aeef..338427d6925 100644
--- a/src/gallium/state_trackers/egl/android/native_android.cpp
+++ b/src/gallium/state_trackers/egl/android/native_android.cpp
@@ -136,6 +136,8 @@ get_pipe_format(int native)
return fmt;
}
+#ifndef ANDROID_BACKEND_NO_DRM
+
#include <gralloc_drm_handle.h>
static int
get_handle_name(buffer_handle_t handle)
@@ -148,6 +150,16 @@ get_handle_name(buffer_handle_t handle)
return (dh) ? dh->name : 0;
}
+#else
+
+static int
+get_handle_name(buffer_handle_t handle)
+{
+ return 0;
+}
+
+#endif /* ANDROID_BACKEND_NO_DRM */
+
/**
* Import an android_native_buffer_t allocated by the server.
*/
@@ -581,6 +593,7 @@ android_display_init_drm(struct native_display *ndpy)
const hw_module_t *mod;
int fd, err;
+#ifndef ANDROID_BACKEND_NO_DRM
/* get the authorized fd from gralloc */
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
if (!err) {
@@ -594,6 +607,7 @@ android_display_init_drm(struct native_display *ndpy)
adpy->base.screen =
adpy->event_handler->new_drm_screen(&adpy->base, NULL, fd);
}
+#endif
if (adpy->base.screen) {
LOGI("using DRM screen");