summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_tiling.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-01-04 14:08:10 -0800
committerEric Anholt <[email protected]>2018-08-08 16:45:44 -0700
commit25bee5ef9ea923bf0d99f5f8eb19082c449f3e53 (patch)
tree1fa6ac86f339ec7ffce5664ba8f450d1a2fe3a12 /src/gallium/drivers/vc4/vc4_tiling.c
parent3e06b918aab3c6a4ca30f5e935aa6996f7009d56 (diff)
vc4: Handle partial loads/stores of tiled textures.
Previously, we would load out the tile-aligned area, update the raster copy, and store it back. This was a huge cost for XPutImage calls to the screen under glamor. Instead, implement a general load/store path that walks over the source x/y writing into the corresponding pixel of the destination (using clever math from https://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/). If things are aligned, we go through the previous utile-at-a-time loop. Improves x11perf -putimage10 performance by 139.777% +/- 2.83464% (n=5) Improves x11perf -putimage100 performance by 383.908% +/- 22.6297% (n=11) Improves x11perf -getimage10 performance by 2.75731% +/- 0.585054% (n=145)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_tiling.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_tiling.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/gallium/drivers/vc4/vc4_tiling.c b/src/gallium/drivers/vc4/vc4_tiling.c
index 07e1c9c5f67..2da520eb4db 100644
--- a/src/gallium/drivers/vc4/vc4_tiling.c
+++ b/src/gallium/drivers/vc4/vc4_tiling.c
@@ -63,15 +63,6 @@ vc4_size_is_lt(uint32_t width, uint32_t height, int cpp)
height <= 4 * vc4_utile_height(cpp));
}
-static void
-check_box_utile_alignment(const struct pipe_box *box, int cpp)
-{
- assert(!(box->x & (vc4_utile_width(cpp) - 1)));
- assert(!(box->y & (vc4_utile_height(cpp) - 1)));
- assert(!(box->width & (vc4_utile_width(cpp) - 1)));
- assert(!(box->height & (vc4_utile_height(cpp) - 1)));
-}
-
/**
* Takes a utile x and y (and the number of utiles of width of the image) and
* returns the offset to the utile within a VC4_TILING_FORMAT_TF image.
@@ -216,8 +207,6 @@ vc4_load_tiled_image(void *dst, uint32_t dst_stride,
uint8_t tiling_format, int cpp,
const struct pipe_box *box)
{
- check_box_utile_alignment(box, cpp);
-
if (tiling_format == VC4_TILING_FORMAT_LT) {
vc4_load_lt_image(dst, dst_stride,
src, src_stride,
@@ -240,8 +229,6 @@ vc4_store_tiled_image(void *dst, uint32_t dst_stride,
uint8_t tiling_format, int cpp,
const struct pipe_box *box)
{
- check_box_utile_alignment(box, cpp);
-
if (tiling_format == VC4_TILING_FORMAT_LT) {
vc4_store_lt_image(dst, dst_stride,
src, src_stride,