summaryrefslogtreecommitdiffstats
path: root/libgralloc/gpu.cpp
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-08-25 15:04:21 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-30 21:27:28 -0700
commit5353ccce11eedce467ab622b6d06263defe6a64f (patch)
tree274439640f774fe212f361155d9340f43d992ce1 /libgralloc/gpu.cpp
parent7b5fe87e3052fe6802e380c649d845b887eaa486 (diff)
downloadhardware_qcom_display-5353ccce11eedce467ab622b6d06263defe6a64f.tar.gz
hardware_qcom_display-5353ccce11eedce467ab622b6d06263defe6a64f.tar.bz2
hardware_qcom_display-5353ccce11eedce467ab622b6d06263defe6a64f.zip
hwc: Store real buffer resolution in private handle.
Add real_width and real_height in private_handle_t to store the actual buffer resolution without alignment that client asked to allocate. Change-Id: I28d757af4178f581e6a83dc06198106c85fc7262 CRs-Fixed: 1040942
Diffstat (limited to 'libgralloc/gpu.cpp')
-rw-r--r--libgralloc/gpu.cpp18
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) {