summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/platform_android.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 67f799c..30ecefe 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -30,7 +30,10 @@
#include <errno.h>
#include <dlfcn.h>
#include <fcntl.h>
+
+#ifdef HAVE_LIBDRM
#include <xf86drm.h>
+#endif
#if ANDROID_VERSION >= 0x402
#include <sync/sync.h>
@@ -538,7 +541,11 @@ droid_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
EGL_NONE, 0
};
+#ifdef HAVE_LIBDRM
return dri2_create_image_dma_buf(disp, ctx, NULL, attr_list_yv12);
+#else
+ return NULL;
+#endif
}
const EGLint attr_list[] = {
@@ -551,7 +558,11 @@ droid_create_image_from_prime_fd(_EGLDisplay *disp, _EGLContext *ctx,
EGL_NONE, 0
};
+#ifdef HAVE_LIBDRM
return dri2_create_image_dma_buf(disp, ctx, NULL, attr_list);
+#else
+ return NULL;
+#endif
}
static _EGLImage *
@@ -1216,7 +1227,11 @@ dri2_initialize_android_drm(_EGLDriver *drv, _EGLDisplay *dpy)
goto cleanup_driver_name;
}
+#ifdef HAVE_LIBDRM
dri2_dpy->is_render_node = drmGetNodeTypeFromFd(dri2_dpy->fd) == DRM_NODE_RENDER;
+#else
+ dri2_dpy->is_render_node = false;
+#endif
/* render nodes cannot use Gem names, and thus do not support
* the __DRI_DRI2_LOADER extension */