summary refs log tree commit diff stats
path: root/ui/egl-helpers.c
diff options
context:
space:
mode:
authorQiang Yu <yuq825@gmail.com>2025-03-27 10:58:45 +0800
committerMarc-André Lureau <marcandre.lureau@redhat.com>2025-05-06 11:57:38 +0400
commitac70568902c3fb77516d93b169cddd0bcaabfb4e (patch)
tree5a10fe95c75518ff393c633214b8283d627163f1 /ui/egl-helpers.c
parent806c861dc6b92019765aed09a016db460cd345fb (diff)
downloadfocaccia-qemu-ac70568902c3fb77516d93b169cddd0bcaabfb4e.tar.gz
focaccia-qemu-ac70568902c3fb77516d93b169cddd0bcaabfb4e.zip
ui/egl: use DRM_FORMAT_MOD_INVALID as default modifier
0 is used as DRM_FORMAT_MOD_LINEAR already.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Message-ID: <20250327025848.46962-4-yuq825@gmail.com>
Diffstat (limited to 'ui/egl-helpers.c')
-rw-r--r--ui/egl-helpers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index 432863d702..8c0e394d2b 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -23,6 +23,7 @@
 #include "system/system.h"
 #include "qapi/error.h"
 #include "trace.h"
+#include "standard-headers/drm/drm_fourcc.h"
 
 EGLDisplay *qemu_egl_display;
 EGLConfig qemu_egl_config;
@@ -333,7 +334,7 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
     attrs[i++] = qemu_dmabuf_get_strides(dmabuf, NULL)[0];
     attrs[i++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
     attrs[i++] = 0;
-    if (modifier) {
+    if (modifier != DRM_FORMAT_MOD_INVALID) {
         attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
         attrs[i++] = (modifier >>  0) & 0xffffffff;
         attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;