Commit e58bb417 authored by Andreas Baierl's avatar Andreas Baierl

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's avatarVasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl's avatarAndreas Baierl <ichgeh@imkreisrum.de>
Tested-by: Marge Bot <!3946>
Part-of: <!3946>
parent 37a670d7
Pipeline #114507 passed with stages
in 16 minutes and 32 seconds
......@@ -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
......
......@@ -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 *
......
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment