summaryrefslogtreecommitdiffstats
path: root/libgralloc/gpu.cpp
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-01 18:42:58 -0600
committerLinux Build Service Account <lnxbuild@localhost>2016-09-01 18:42:58 -0600
commit57aaa5e09827b47df67e08ec165173327a7e6ed8 (patch)
tree9322ba200099a7920bc2d97647489582b9877e10 /libgralloc/gpu.cpp
parent9cc01011e580a2a55ebabd39c62e042f3f9d5dde (diff)
parentbee9c1acdd3a6910d5f4e57d39c4fe4d0ea9909d (diff)
downloadhardware_qcom_display-57aaa5e09827b47df67e08ec165173327a7e6ed8.tar.gz
hardware_qcom_display-57aaa5e09827b47df67e08ec165173327a7e6ed8.tar.bz2
hardware_qcom_display-57aaa5e09827b47df67e08ec165173327a7e6ed8.zip
Promotion of display.lnx.2.0-00048.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1040942 I28d757af4178f581e6a83dc06198106c85fc7262 hwc: Store real buffer resolution in private handle. 1040942 Ic4c03cc5779418959732332d26b8ecb59c2483b5 sdm: Add rect mapping and interface to store actual reso Change-Id: I96c075e51d992f1db521b2f8649913c152439798 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) {