diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-07-30 03:15:42 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-07-30 03:15:42 +0000 |
commit | 4dbb075a9ad60d56a98d21832c06eb1d24c7787d (patch) | |
tree | 98a31fc084510dd11c2809491441b0982df32a06 | |
parent | f3109fa2ca63f714d79f9c9639d2c79dfdb7edf0 (diff) | |
parent | ff9e26650889fe4740683eaabb6e207608f9fdb9 (diff) | |
download | goldfish-opengl-4dbb075a9ad60d56a98d21832c06eb1d24c7787d.tar.gz |
Snap for 4920102 from ff9e26650889fe4740683eaabb6e207608f9fdb9 to pi-qpr1-release
Change-Id: I36ea18d8d4795eb5bcfdffa971048fb6ccec6569
-rw-r--r-- | system/gralloc/gralloc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index 7423a1ec..fc68f4e7 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -52,6 +52,8 @@ #define DBG_FUNC DBG("%s\n", __FUNCTION__) +#define GOLDFISH_OFFSET_UNIT 8 + #ifdef GOLDFISH_HIDL_GRALLOC static bool isHidlGralloc = true; #else @@ -64,8 +66,8 @@ int32_t* getOpenCountPtr(cb_handle_t* cb) { uint32_t getAshmemColorOffset(cb_handle_t* cb) { uint32_t res = 0; - if (cb->canBePosted()) res = sizeof(intptr_t); - if (isHidlGralloc) res = sizeof(intptr_t) * 2; + if (cb->canBePosted()) res = GOLDFISH_OFFSET_UNIT; + if (isHidlGralloc) res = GOLDFISH_OFFSET_UNIT * 2; return res; } @@ -633,12 +635,12 @@ static int gralloc_alloc(alloc_device_t* dev, if (needHostCb || (usage & GRALLOC_USAGE_HW_FB)) { // keep space for postCounter // AND openCounter for all host cb - ashmem_size += sizeof(uint32_t) * 2; + ashmem_size += GOLDFISH_OFFSET_UNIT * 2; } } else { if (usage & GRALLOC_USAGE_HW_FB) { // keep space for postCounter - ashmem_size += sizeof(uint32_t) * 1; + ashmem_size += GOLDFISH_OFFSET_UNIT * 1; } } |