am 0771ec63: libgralloc: Align secure video and rotator buffers to 2M

* commit '0771ec63c5a81c89626d8e3bccec2db933ca2972':
  libgralloc: Align secure video and rotator buffers to 2M
This commit is contained in:
Praveen Chavan 2014-11-06 05:44:00 +00:00 committed by Android Git Automerger
commit baa7bf5311
2 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@
using namespace gralloc;
#define SZ_1M 0x100000
#define SZ_2M 0x200000
gpu_context_t::gpu_context_t(const private_module_t* module,
IAllocController* alloc_ctrl ) :
@ -71,7 +72,7 @@ int gpu_context_t::gralloc_alloc_buffer(size_t size, int usage,
#ifdef MDSS_TARGET
if ((usage & GRALLOC_USAGE_PROTECTED) &&
(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP)) {
data.align = ALIGN((int) data.align, SZ_1M);
data.align = ALIGN((int) data.align, SZ_2M);
size = ALIGN(size, data.align);
}
#endif

View File

@ -41,6 +41,7 @@
#include "mdpWrapper.h"
#define SIZE_1M 0x00100000
#define SIZE_2M 0x00200000
namespace overlay {
@ -138,8 +139,8 @@ inline bool OvMem::open(uint32_t numbufs,
if(isSecure) {
allocFlags = GRALLOC_USAGE_PRIVATE_MM_HEAP;
allocFlags |= GRALLOC_USAGE_PROTECTED;
mBufSzAligned = utils::align(bufSz, SIZE_1M);
data.align = SIZE_1M;
mBufSzAligned = utils::align(bufSz, SIZE_2M);
data.align = SIZE_2M;
} else {
mBufSzAligned = bufSz;
data.align = getpagesize();