All of lore.kernel.org
 help / color / mirror / Atom feed
From: yuq825@gmail.com
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Qiang Yu" <yuq825@gmail.com>
Subject: [PATCH 2/6] ui/egl: require EGL_EXT_image_dma_buf_import_modifiers
Date: Mon, 24 Mar 2025 16:19:17 +0800	[thread overview]
Message-ID: <20250324081922.359369-3-yuq825@gmail.com> (raw)
In-Reply-To: <20250324081922.359369-1-yuq825@gmail.com>

From: Qiang Yu <yuq825@gmail.com>

It's used already, just check it explicitly.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
---
 ui/egl-helpers.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index 72a1405782..45b1b0b700 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -257,6 +257,11 @@ int egl_rendernode_init(const char *rendernode, DisplayGLMode mode)
         error_report("egl: EGL_MESA_image_dma_buf_export not supported");
         goto err;
     }
+    if (!epoxy_has_egl_extension(qemu_egl_display,
+                                 "EGL_EXT_image_dma_buf_import_modifiers")) {
+        error_report("egl: EGL_EXT_image_dma_buf_import_modifiers not supported");
+        goto err;
+    }
 
     qemu_egl_rn_ctx = qemu_egl_init_ctx();
     if (!qemu_egl_rn_ctx) {
@@ -308,7 +313,7 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
     EGLImageKHR image = EGL_NO_IMAGE_KHR;
     EGLint attrs[64];
     int i = 0;
-    uint64_t modifier;
+    uint64_t modifier = qemu_dmabuf_get_modifier(dmabuf);
     uint32_t texture = qemu_dmabuf_get_texture(dmabuf);
 
     if (texture != 0) {
@@ -328,15 +333,12 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
     attrs[i++] = qemu_dmabuf_get_stride(dmabuf)[0];
     attrs[i++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
     attrs[i++] = 0;
-#ifdef EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT
-    modifier = qemu_dmabuf_get_modifier(dmabuf);
     if (modifier) {
         attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
         attrs[i++] = (modifier >>  0) & 0xffffffff;
         attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
         attrs[i++] = (modifier >> 32) & 0xffffffff;
     }
-#endif
     attrs[i++] = EGL_NONE;
 
     image = eglCreateImageKHR(qemu_egl_display,
-- 
2.43.0



  parent reply	other threads:[~2025-03-24  8:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24  8:19 [PATCH 0/6] ui: support multi plane texture yuq825
2025-03-24  8:19 ` [PATCH 1/6] ui/dmabuf: extend QemuDmaBuf to support multi-plane yuq825
2025-03-24 10:04   ` Marc-André Lureau
2025-03-24 13:16     ` Qiang Yu
2025-03-24 14:06       ` Marc-André Lureau
2025-03-25  3:26         ` Qiang Yu
2025-03-25  6:37           ` Marc-André Lureau
2025-03-25  6:52             ` Qiang Yu
2025-03-25  7:22               ` Marc-André Lureau
2025-03-24  8:19 ` yuq825 [this message]
2025-03-24 10:09   ` [PATCH 2/6] ui/egl: require EGL_EXT_image_dma_buf_import_modifiers Marc-André Lureau
2025-03-24 13:22     ` Qiang Yu
2025-03-24 13:45       ` Marc-André Lureau
2025-03-25  3:16         ` Qiang Yu
2025-03-24  8:19 ` [PATCH 3/6] ui/egl: use DRM_FORMAT_MOD_INVALID as default modifier yuq825
2025-03-24 10:15   ` Marc-André Lureau
2025-03-24  8:19 ` [PATCH 4/6] ui/egl: support multi-plane dmabuf when egl export/import yuq825
2025-03-24  8:19 ` [PATCH 5/6] ui/dbus: change dbus ScanoutDMABUF interface yuq825
2025-03-24  8:19 ` [PATCH 6/6] ui/spice: support multi plane dmabuf scanout yuq825
2025-03-24  9:30   ` Marc-André Lureau
2025-03-24 10:00     ` Daniel P. Berrangé
2025-03-24 13:35     ` Qiang Yu
2025-03-24 14:02       ` Marc-André Lureau
2025-03-26  1:45         ` Qiang Yu
2025-03-26  6:38           ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250324081922.359369-3-yuq825@gmail.com \
    --to=yuq825@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.