aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAndreas Baierl <[email protected]>2020-02-19 10:42:43 +0100
committerAndreas Baierl <[email protected]>2020-03-02 10:33:06 +0000
commite58bb417b57243d9bf0faa0995522dde5bf3fbfb (patch)
tree1ad37e60414b6584fdc52199211cb51e0d6a0644 /src/gallium
parent37a670d76c245fab238f84dc31ecb281d62531e3 (diff)
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 <[email protected]> Signed-off-by: Andreas Baierl <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3946> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3946>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/lima/lima_format.c2
-rw-r--r--src/gallium/drivers/lima/lima_resource.c16
2 files changed, 9 insertions, 9 deletions
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 */