lima: Add etc1 support
authorAndreas Baierl <ichgeh@imkreisrum.de>
Wed, 19 Feb 2020 09:42:43 +0000 (10:42 +0100)
committerAndreas Baierl <ichgeh@imkreisrum.de>
Mon, 2 Mar 2020 10:33:06 +0000 (10:33 +0000)
Layer stride has to be divided by 4. We also have to take care of
the array_size when returning the bo_size.

Drop the affected tests from the fails list.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3946>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3946>

.gitlab-ci/deqp-lima-fails.txt
src/gallium/drivers/lima/lima_format.c
src/gallium/drivers/lima/lima_resource.c

index 165b7767a97d107a1f2ae2f9f4628e4c382b6854..10915b9745acd86273ce3c559a7a4e038304f724 100644 (file)
@@ -178,13 +178,9 @@ dEQP-GLES2.functional.shaders.random.trigonometric.fragment.65
 dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias
 dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2dproj_vec4_bias
 dEQP-GLES2.functional.shaders.texture_functions.fragment.texturecube_bias
-dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_linear_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_linear_clamp_rgba8888
-dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_linear_mirror_etc1
 dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_linear_mirror_rgba8888
-dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_nearest_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_nearest_clamp_rgba8888
-dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_nearest_mirror_etc1
 dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_nearest_mirror_rgba8888
 dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_linear
 dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest
index f7e4d66e148fa759fc9d3aaccb6531fe5ba96f54..e57139af660c56b6613caa93794c20f5f076f125 100644 (file)
@@ -40,6 +40,7 @@
 #define LIMA_TEXEL_FORMAT_RGB_888      0x15
 #define LIMA_TEXEL_FORMAT_RGBA_8888    0x16
 #define LIMA_TEXEL_FORMAT_RGBX_8888    0x17
+#define LIMA_TEXEL_FORMAT_ETC1_RGB8    0x20
 #define LIMA_TEXEL_FORMAT_Z24S8        0x2c
 #define LIMA_TEXEL_FORMAT_NONE         -1
 
@@ -81,6 +82,7 @@ static const struct lima_format lima_format_table[] = {
    LIMA_FORMAT(I16_UNORM,          I16,       NONE,     false),
    LIMA_FORMAT(I8_UNORM,           I8,        NONE,     false),
    LIMA_FORMAT(L8A8_UNORM,         L8A8,      NONE,     false),
+   LIMA_FORMAT(ETC1_RGB8,          ETC1_RGB8, NONE,     false),
 };
 
 static const struct lima_format *
index 5947b3e8da420b89aacf0862fdebd3c29741d326..92e3e6391e39b92768412fefd98d95c6b878a279 100644 (file)
@@ -119,16 +119,14 @@ setup_miptree(struct lima_resource *res,
       res->levels[level].offset = size;
       res->levels[level].layer_stride = util_format_get_stride(pres->format, align(width, 16)) * align(height, 16);
 
-      /* The start address of each level <= 10 must be 64-aligned
-       * in order to be able to pass the addresses
-       * to the hardware.
-       * The start addresses of level 11 and level 12 are passed
-       * implicitely: they start at an offset of respectively
-       * 0x0400 and 0x0800 from the start address of level 10 */
-      if (level < 10)
+      if (util_format_is_compressed(pres->format))
+         res->levels[level].layer_stride /= 4;
+
+      /* The start address of each level except the last level
+       * must be 64-aligned in order to be able to pass the
+       * addresses to the hardware. */
+      if (level != pres->last_level)
          size += align(actual_level_size, 64);
-      else if (level != pres->last_level)
-         size += 0x0400;
       else
          size += actual_level_size;  /* Save some memory */