aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-16 15:22:57 -0700
committerEric Anholt <[email protected]>2018-07-20 11:26:12 -0700
commit945524ba0e09447754abc755698e32335d5dbc9b (patch)
tree48ff11b3352f362ac47e75940614c23c8ce662d8 /src/gallium/state_trackers/dri
parentf6750456c54025e30844ee345b1a1c4f997eb3eb (diff)
st/dri: Don't require a dri_format for image creation.
Nothing in EGL_KHR_gl_image.txt seems to let us deny creation based on formats, and doing so causes many failures in dEQP-EGL.functional.image.api.* The NONE value we were protecting from only gets looked at in the __DRI_IMAGE_ATTRIB_FORMAT and __DRI_IMAGE_ATTRIB_FOURCC queries, which are used from wayland and gbm (which throw an error cleanly on unknown format) and DMABUF export. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c2
-rw-r--r--src/gallium/state_trackers/dri/dri_helpers.c12
2 files changed, 1 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index e980698cfb6..34205853335 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1318,7 +1318,7 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
return GL_TRUE;
case __DRI_IMAGE_ATTRIB_FOURCC:
*value = convert_to_fourcc(image->dri_format);
- return GL_TRUE;
+ return *value != -1;
case __DRI_IMAGE_ATTRIB_NUM_PLANES:
*value = 1;
return GL_TRUE;
diff --git a/src/gallium/state_trackers/dri/dri_helpers.c b/src/gallium/state_trackers/dri/dri_helpers.c
index 5d42873a208..25095bbce89 100644
--- a/src/gallium/state_trackers/dri/dri_helpers.c
+++ b/src/gallium/state_trackers/dri/dri_helpers.c
@@ -296,12 +296,6 @@ dri2_create_image_from_renderbuffer2(__DRIcontext *context,
img->dri_format = driGLFormatToImageFormat(rb->Format);
img->loader_private = loaderPrivate;
- if (img->dri_format == __DRI_IMAGE_FORMAT_NONE) {
- *error = __DRI_IMAGE_ERROR_BAD_PARAMETER;
- free(img);
- return NULL;
- }
-
pipe_resource_reference(&img->texture, tex);
*error = __DRI_IMAGE_ERROR_SUCCESS;
@@ -379,12 +373,6 @@ dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture,
img->loader_private = loaderPrivate;
- if (img->dri_format == __DRI_IMAGE_FORMAT_NONE) {
- *error = __DRI_IMAGE_ERROR_BAD_PARAMETER;
- free(img);
- return NULL;
- }
-
pipe_resource_reference(&img->texture, tex);
*error = __DRI_IMAGE_ERROR_SUCCESS;