summaryrefslogtreecommitdiff
path: root/rockchip.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2017-02-08 15:09:13 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-18 00:39:28 -0800
commit6ea14bad3f31e449aa5d01c6b625c6dfe087144b (patch)
tree82daac5e308d5f9216a1666b8150a2c65195c1c1 /rockchip.c
parent7831b04a2dc2935498ad558dbf7edb1e0c562d34 (diff)
minigbm: align first plane to 64 bytes
The chroma stride of Android YV12 buffers is required to be aligned to 16 bytes (see <system/graphics.h>). Additionally, the size of the ARM L1 cache line is 64-bytes (see chrome-os-partner:45777). Let's always align the first plane to 64 bytes. The chroma strides will be aligned to 32 bytes in that case. BUG=chromium:616275 TEST= ImageReaderDecoderTest#testGoogH264ImageReader passes on veyron_minnie-cheets. Change-Id: I87a309ce0612bf8c5be8f8e47dad3da10d61a081 Reviewed-on: https://chromium-review.googlesource.com/441912 Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Diffstat (limited to 'rockchip.c')
-rw-r--r--rockchip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rockchip.c b/rockchip.c
index 30b6822..140ec93 100644
--- a/rockchip.c
+++ b/rockchip.c
@@ -142,6 +142,13 @@ static int rockchip_bo_create_with_modifiers(struct bo *bo,
fprintf(stderr, "no usable modifier found\n");
return -1;
}
+
+ /*
+ * Since the ARM L1 cache line size is 64 bytes, align to that
+ * as a performance optimization.
+ */
+ uint32_t bytes_per_pixel = drv_stride_from_format(format, 1, 0);
+ width = ALIGN(width, DIV_ROUND_UP(64, bytes_per_pixel));
drv_bo_from_format(bo, width, height, format);
}