summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vc4/vc4_validate.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-11-04 04:53:10 +0300
committerEric Anholt <eric@anholt.net>2016-11-04 04:55:46 +0300
commit7154d76fedf549607afbc0d13db9aaf02da5cebf (patch)
tree293a38135a214f039c88351724c3605b988afb31 /drivers/gpu/drm/vc4/vc4_validate.c
parent457e67a728696c4f8e6423c64e93def50530db9a (diff)
downloadlinux-7154d76fedf549607afbc0d13db9aaf02da5cebf.tar.xz
drm/vc4: Add support for rendering with ETC1 textures.
The validation for it ends up being quite simple, but I hadn't got around to it before merging the driver. For backwards compatibility, we also need to add a flag so that the userspace GL driver can easily tell if the kernel will allow ETC1 textures (on an old kernel, it will continue to convert to RGBA8) Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_validate.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_validate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c
index 26503e307438..e18f88203d32 100644
--- a/drivers/gpu/drm/vc4/vc4_validate.c
+++ b/drivers/gpu/drm/vc4/vc4_validate.c
@@ -644,6 +644,13 @@ reloc_tex(struct vc4_exec_info *exec,
cpp = 1;
break;
case VC4_TEXTURE_TYPE_ETC1:
+ /* ETC1 is arranged as 64-bit blocks, where each block is 4x4
+ * pixels.
+ */
+ cpp = 8;
+ width = (width + 3) >> 2;
+ height = (height + 3) >> 2;
+ break;
case VC4_TEXTURE_TYPE_BW1:
case VC4_TEXTURE_TYPE_A4:
case VC4_TEXTURE_TYPE_A1: