From 25f569f58a15ad1d7ba1127915e9fc10b98381e8 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 19 Sep 2022 07:16:49 -0400 Subject: [PATCH] gallium: track if st_egl_image was created by a dmabuf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required by GL_EXT_EGL_image_storage to verify if the image is valid Signed-off-by: Simon Zeni Reviewed-by: Marek Olšák Part-of: --- src/gallium/frontends/dri/dri_screen.c | 1 + src/gallium/frontends/wgl/stw_image.c | 1 + src/gallium/include/frontend/api.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index e9f36712134..60e06b2fd9c 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -738,6 +738,7 @@ dri_get_egl_image(struct st_manager *smapi, stimg->format = map ? map->pipe_format : img->texture->format; stimg->level = img->level; stimg->layer = img->layer; + stimg->imported_dmabuf = img->imported_dmabuf; if (img->imported_dmabuf && map) { /* Guess sized internal format for dma-bufs. Could be used diff --git a/src/gallium/frontends/wgl/stw_image.c b/src/gallium/frontends/wgl/stw_image.c index 78b245242d7..64e01043b6a 100644 --- a/src/gallium/frontends/wgl/stw_image.c +++ b/src/gallium/frontends/wgl/stw_image.c @@ -140,4 +140,5 @@ stw_translate_image(struct stw_image *in, struct st_egl_image *out) out->format = in->format; out->layer = in->layer; out->level = in->level; + out->imported_dmabuf = false; } diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 8fc425b351b..91a15b4bbe7 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -193,6 +193,8 @@ struct st_egl_image /* one of __DRI_YUV_RANGE_* */ unsigned yuv_range; + + bool imported_dmabuf; }; /**