diff options
Diffstat (limited to 'libgralloc/gpu.cpp')
-rw-r--r-- | libgralloc/gpu.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp index 0eee65e53..4f29a7003 100644 --- a/libgralloc/gpu.cpp +++ b/libgralloc/gpu.cpp @@ -53,6 +53,16 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage, { int err = 0; int flags = 0; + int alignedw = 0; + int alignedh = 0; + + AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width, + height, + format, + usage, + alignedw, + alignedh); + size = roundUpToPageSize(size); alloc_data data; data.offset = 0; @@ -159,8 +169,8 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage, flags |= data.allocType; uint64_t eBaseAddr = (uint64_t)(eData.base) + eData.offset; private_handle_t *hnd = new private_handle_t(data.fd, size, flags, - bufferType, format, width, height, eData.fd, eData.offset, - eBaseAddr); + bufferType, format, alignedw, alignedh, width, height, eData.fd, + eData.offset, eBaseAddr); hnd->offset = data.offset; hnd->base = (uint64_t)(data.base) + data.offset; @@ -228,7 +238,7 @@ int gpu_context_t::gralloc_alloc_framebuffer_locked(int usage, private_handle_t::PRIV_FLAGS_USES_ION | private_handle_t::PRIV_FLAGS_FRAMEBUFFER, BUFFER_TYPE_UI, m->fbFormat, m->info.xres, - m->info.yres); + m->info.yres, m->info.xres, m->info.yres); // find a free slot for (uint32_t i=0 ; i<numBuffers ; i++) { @@ -328,7 +338,7 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage, err = gralloc_alloc_framebuffer(usage, pHandle); } else { err = gralloc_alloc_buffer(size, usage, pHandle, bufferType, - grallocFormat, alignedw, alignedh); + grallocFormat, w, h); } if (err < 0) { |