From: Bas Nieuwenhuizen Date: Fri, 29 May 2020 11:47:00 +0000 (+0200) Subject: gallium/dri: Remove lowered_yuv tracking for plane mapping. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e4c8949c6f79090b7d8675b488c7bdc90477e26;p=mesa.git gallium/dri: Remove lowered_yuv tracking for plane mapping. Just heard that etnaviv is also compatible with it even in the non-lowered cases, so let us enable it for everyone. Reviewed-by: Lucas Stach Part-of: --- diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 9facc47d1da..fbc9f1115ad 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -801,7 +801,6 @@ dri2_create_image_from_winsys(__DRIscreen *_screen, img->layer = 0; img->use = 0; img->loader_private = loaderPrivate; - img->lowered_yuv = use_lowered; return img; } @@ -1011,7 +1010,6 @@ dri2_create_image_common(__DRIscreen *_screen, img->dri_fourcc = map->dri_fourcc; img->dri_components = 0; img->use = use; - img->lowered_yuv = false; img->loader_private = loaderPrivate; return img; @@ -1262,7 +1260,6 @@ dri2_dup_image(__DRIimage *image, void *loaderPrivate) /* This should be 0 for sub images, but dup is also used for base images. */ img->dri_components = image->dri_components; img->loader_private = loaderPrivate; - img->lowered_yuv = image->lowered_yuv; return img; } @@ -1552,16 +1549,13 @@ dri2_map_image(__DRIcontext *context, __DRIimage *image, if (!image || !data || *data) return NULL; - if (image->lowered_yuv) { - unsigned plane = image->plane; - if (plane >= dri2_get_mapping_by_format(image->dri_format)->nplanes) - return NULL; - - while (plane--) - resource = resource->next; - } else if (dri2_get_mapping_by_format(image->dri_format)->nplanes > 1) + unsigned plane = image->plane; + if (plane >= dri2_get_mapping_by_format(image->dri_format)->nplanes) return NULL; + while (plane--) + resource = resource->next; + if (flags & __DRI_IMAGE_TRANSFER_READ) pipe_access |= PIPE_TRANSFER_READ; if (flags & __DRI_IMAGE_TRANSFER_WRITE) diff --git a/src/gallium/frontends/dri/dri_screen.h b/src/gallium/frontends/dri/dri_screen.h index d6f7850a264..e330aa1f2ac 100644 --- a/src/gallium/frontends/dri/dri_screen.h +++ b/src/gallium/frontends/dri/dri_screen.h @@ -106,7 +106,6 @@ struct __DRIimageRec { uint32_t dri_components; unsigned use; unsigned plane; - bool lowered_yuv; void *loader_private;