aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2022-03-09 12:12:18 -0800
committerAlistair Delva <adelva@google.com>2022-03-28 12:35:53 -0700
commit347027d2587b26834b1f370c77e00ada0efe1ddd (patch)
tree855fafaa6ce616675b24d2861cf5219af1c57ba8
parent82359ab805f77e1e96249362d7f227a4818dd1af (diff)
downloadmesa3d-347027d2587b26834b1f370c77e00ada0efe1ddd.tar.gz
Hack to handle latest minigbm changes
... which introduces another fd into the native handle which is created from libdmuabufheap which doesn't seem to work with `dri2_dpy->image->createImageFromDmaBufs()`. [adelva: Land temporarily to restore QEMU compatibility] Bug: b/223646636 Test: cvd start --gpu_mode=drm_virgl Change-Id: I237f9b9dbf9672f8f06f272c5ac3bdb2343f93ee
-rw-r--r--src/egl/Android.mk5
-rw-r--r--src/egl/drivers/dri2/platform_android.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 322a1113841..823ba94100c 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -88,6 +88,11 @@ ifneq ($(MESA_BUILD_GALLIUM),)
LOCAL_REQUIRED_MODULES += gallium_dri
endif
+# TODO(b/223646636): Temporary hack for handles with HDR metadata fds
+ifeq ($(BOARD_GPU_DRIVERS),virgl)
+LOCAL_CFLAGS += -DNUM_FDS_HACK
+endif
+
LOCAL_MODULE := libGLES_mesa
LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT
LOCAL_LICENSE_CONDITIONS := notice
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 2b75dfa98a4..782d66a3a87 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -174,7 +174,11 @@ get_native_buffer_fds(struct ANativeWindowBuffer *buf, int fds[3])
for (int i = 0; i < handle->numFds; i++)
fds[i] = handle->data[i];
+#ifdef NUM_FDS_HACK
+ return 1;
+#else
return handle->numFds;
+#endif
}
#ifdef HAVE_DRM_GRALLOC