summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@google.com>2015-09-08 15:20:29 +0900
committerOwen Lin <owenlin@google.com>2015-09-22 14:57:27 +0800
commit54b661575f1709d2ed279a4d7f69313231e11d47 (patch)
tree2c65bb377c5db6d6e6ae2d0175d5cef849b4e9c4
parenta43d9523c050b3ddb40190bb8de7920b7521b6ca (diff)
downloaddrm_gralloc-54b661575f1709d2ed279a4d7f69313231e11d47.tar.gz
drm_gralloc: rockchip: Allocate bigger buffers for raw video frames
It is a workaround needed for video decoder hardware that requires extra data at the end of the frame. Change-Id: I6af8f8ae81a56bbbe3721b0cc3b333f09f6fb965
-rw-r--r--gralloc_drm_rockchip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gralloc_drm_rockchip.c b/gralloc_drm_rockchip.c
index de1874e..f9dcb0e 100644
--- a/gralloc_drm_rockchip.c
+++ b/gralloc_drm_rockchip.c
@@ -64,6 +64,18 @@ static struct gralloc_drm_bo_t *drm_gem_rockchip_alloc(
pitch = ALIGN(aligned_width * cpp, 64);
size = aligned_height * pitch;
+ if (handle->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ /*
+ * WAR for H264 decoder requiring additional space
+ * at the end of destination buffers.
+ */
+ uint32_t w_mbs, h_mbs;
+
+ w_mbs = ALIGN(handle->width, 16) / 16;
+ h_mbs = ALIGN(handle->height, 16) / 16;
+ size += 64 * w_mbs * h_mbs;
+ }
+
if (handle->prime_fd >= 0) {
ret = drmPrimeFDToHandle(info->fd, handle->prime_fd,
&gem_handle);