dri: check for dmabuf_import at top of dri2_from_dma_bufs

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472>
This commit is contained in:
Mike Blumenkrantz 2024-07-26 16:07:32 -04:00 committed by Marge Bot
parent a7d8892f0e
commit 9362ae7ecd

View file

@ -1685,6 +1685,9 @@ dri2_from_dma_bufs(__DRIscreen *screen,
__DRIimage *img;
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
if (!dri_screen(screen)->dmabuf_import)
return NULL;
unsigned err = __DRI_IMAGE_ERROR_SUCCESS;
/* Allow a NULL error arg since many callers don't care. */
unsigned unused_error;