gallium/dri: Remove lowered_yuv tracking for plane mapping.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 29 May 2020 11:47:00 +0000 (13:47 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 30 May 2020 02:49:54 +0000 (02:49 +0000)
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 <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5253>

src/gallium/frontends/dri/dri2.c
src/gallium/frontends/dri/dri_screen.h

index 9facc47d1da0f6c8f7f3794181ca4eb69cc11ee3..fbc9f1115adaff1bebb89b9528cdd0c9d0624e9b 100644 (file)
@@ -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)
index d6f7850a2645a801682d7d930da9bad53d04f6d3..e330aa1f2acad74b330619c1d09343d275c97d87 100644 (file)
@@ -106,7 +106,6 @@ struct __DRIimageRec {
    uint32_t dri_components;
    unsigned use;
    unsigned plane;
-   bool lowered_yuv;
 
    void *loader_private;