gallium/dri: fix dri2_from_names
authorJulia Tatz <tatz.j@northeastern.edu>
Thu, 10 Aug 2023 02:35:56 +0000 (22:35 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 15 Aug 2023 23:36:24 +0000 (23:36 +0000)
`createImageFromNames` uses fourcc, not dri_image_formats

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8547
Fixes: 433ca3127a3 ("st/dri: replace format conversion functions with single mapping table")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24597>

src/gallium/frontends/dri/dri2.c

index 8238730..1f71081 100644 (file)
@@ -1622,11 +1622,11 @@ dri2_validate_usage(__DRIimage *image, unsigned int use)
 }
 
 static __DRIimage *
-dri2_from_names(__DRIscreen *screen, int width, int height, int format,
+dri2_from_names(__DRIscreen *screen, int width, int height, int fourcc,
                 int *names, int num_names, int *strides, int *offsets,
                 void *loaderPrivate)
 {
-   const struct dri2_format_mapping *map = dri2_get_mapping_by_format(format);
+   const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
    __DRIimage *img;
    struct winsys_handle whandle;