summaryrefslogtreecommitdiff
authorXu Jintao <jintao.xu@amlogic.com>2017-04-20 04:58:16 (GMT)
committer Jiyu Yang <jiyu.yang@amlogic.com>2017-04-27 05:22:20 (GMT)
commitd42c2161d65f92a8d03769f48147688f14c2c39e (patch)
tree0eaee02c3943c8127e3ec4691cb5e457f5b1f404
parented1798fd4ba7dfb801ae5cb9ecce69f3877c18af (diff)
downloadgralloc-d42c2161d65f92a8d03769f48147688f14c2c39e.zip
gralloc-d42c2161d65f92a8d03769f48147688f14c2c39e.tar.gz
gralloc-d42c2161d65f92a8d03769f48147688f14c2c39e.tar.bz2
PD#139269: platform overlay size allocation
omx decoder set output buffer actual size but gralloc only alloc a small size Change-Id: Ic376de385ead526eab023a195f0bc74c6a51b579
Diffstat
-rw-r--r--alloc_device.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/alloc_device.cpp b/alloc_device.cpp
index 761baa8..9c6ca87 100644
--- a/alloc_device.cpp
+++ b/alloc_device.cpp
@@ -42,6 +42,9 @@
#define AFBC_HEADER_BUFFER_BYTES_PER_BLOCKENTRY 16
#define AFBC_WIDEBLK_WIDTH_ALIGN 32
+#define OMX_VIDEOLAYER_ALLOC_BUFFER_WIDTH 192
+#define OMX_VIDEOLAYER_ALLOC_BUFFER_HEIGHT 90
+
static int gralloc_alloc_framebuffer_locked(alloc_device_t* dev, size_t size, int usage, buffer_handle_t* pHandle, int* stride, int* byte_stride)
{
private_module_t* private_t = reinterpret_cast<private_module_t*>(dev->common.module);
@@ -810,6 +813,7 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, int
AllocType type = UNCOMPRESSED;
bool alloc_for_extended_yuv = false, alloc_for_arm_afbc_yuv = false;
int internalWidth,internalHeight;
+ int buffer_width = w;
#if defined(GRALLOC_FB_SWAP_RED_BLUE)
/* match the framebuffer format */
@@ -860,6 +864,13 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, int
/* Some formats require an internal width and height that may be used by
* consumers/producers.
*/
+#if PLATFORM_SDK_VERSION >= 24
+ if (usage & GRALLOC_USAGE_AML_OMX_OVERLAY)
+ {
+ w = OMX_VIDEOLAYER_ALLOC_BUFFER_WIDTH;
+ h = OMX_VIDEOLAYER_ALLOC_BUFFER_HEIGHT;
+ }
+#endif
internalWidth = w;
internalHeight = h;
@@ -932,6 +943,12 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, int
{
return -EINVAL;
}
+#if PLATFORM_SDK_VERSION >= 24
+ if (usage & GRALLOC_USAGE_AML_OMX_OVERLAY)
+ {
+ pixel_stride = buffer_width;
+ }
+#endif
break;
/*