summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/state_tracker/st_api.h2
-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
4 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 258da8fdeaf..0b953d6fb38 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -182,6 +182,8 @@ struct st_egl_image
unsigned level;
unsigned layer;
+ /* GL internal format. */
+ unsigned internalformat;
};
/**
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.
*/