From: Andreas Baierl Date: Wed, 19 Feb 2020 09:42:43 +0000 (+0100) Subject: lima: Add etc1 support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e58bb417b57243d9bf0faa0995522dde5bf3fbfb;p=mesa.git lima: Add etc1 support 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 Signed-off-by: Andreas Baierl Tested-by: Marge Bot Part-of: --- diff --git a/.gitlab-ci/deqp-lima-fails.txt b/.gitlab-ci/deqp-lima-fails.txt index 165b7767a97..10915b9745a 100644 --- a/.gitlab-ci/deqp-lima-fails.txt +++ b/.gitlab-ci/deqp-lima-fails.txt @@ -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 diff --git a/src/gallium/drivers/lima/lima_format.c b/src/gallium/drivers/lima/lima_format.c index f7e4d66e148..e57139af660 100644 --- a/src/gallium/drivers/lima/lima_format.c +++ b/src/gallium/drivers/lima/lima_format.c @@ -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 * diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index 5947b3e8da4..92e3e6391e3 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -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 */