aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2020-01-13 16:07:38 -0800
committerMarge Bot <[email protected]>2020-01-15 01:18:54 +0000
commitbe347863baa8de0ed47da0ad4f85ad9c255ca5c5 (patch)
tree37b028f7ae6a852357186e58c9d284ddf2798ec6 /src/gallium/state_trackers
parent2629cb627c2c4a3f75614886ce0fc0ce76e4f6f1 (diff)
st/dri: track if image is created by a dmabuf
Will be used by EXT_EGL_image_storage later. Acked-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3375>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c1
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c8
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 490c4b16f03..54a05c916f1 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -938,6 +938,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
img->dri_components = map->dri_components;
img->dri_fourcc = fourcc;
img->dri_format = map->dri_format;
+ img->imported_dmabuf = TRUE;
exit:
if (error)
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 8600ce029f0..5a9acd818d0 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -473,6 +473,14 @@ dri_get_egl_image(struct st_manager *smapi,
stimg->level = img->level;
stimg->layer = img->layer;
+ if (img->imported_dmabuf && map) {
+ /* Guess sized internal format for dma-bufs. Could be used
+ * by EXT_EGL_image_storage.
+ */
+ mesa_format mesa_format = driImageFormatToGLFormat(map->dri_format);
+ stimg->internalformat = driGLFormatToSizedInternalGLFormat(mesa_format);
+ }
+
return TRUE;
}
diff --git a/src/gallium/state_trackers/dri/dri_screen.h b/src/gallium/state_trackers/dri/dri_screen.h
index 4a80d96df95..1586439bba3 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -109,6 +109,7 @@ struct __DRIimageRec {
void *loader_private;
+ boolean imported_dmabuf;
/**
* Provided by EGL_EXT_image_dma_buf_import.
*/