diff options
author | Kévin PETIT <kevin.petit@arm.com> | 2014-03-13 17:09:58 +0000 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2014-10-08 01:00:00 +0530 |
commit | 69662efdd127fb6fd1d1eb228e5e7d71a6b8e75e (patch) | |
tree | 7907dcd409addad38213f13a961e793d29676923 | |
parent | 9f4978701783942e836aeab526727458e9cb1492 (diff) | |
download | libhardware-linaro-armv8-14.10.tar.gz |
Don't use memset to clear the framebuffer on arm64linaro-armv8-14.10
Change-Id: Id0ad67505c206b6bfe0ea7b13a4860369b307e70
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
-rw-r--r-- | modules/gralloc/framebuffer.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp index 486e27ab..014fbec6 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp @@ -139,6 +139,27 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) /*****************************************************************************/ +void clearFrameBuffer(void* vaddr, size_t fbSize) +{ +#ifdef __aarch64__ + /* + * The optimised memset for arm64 cannot operate on device memory. + * The zeroing has to be done differently. This is a copy of bionic's + * generic memset. + */ + char* q = (char*)vaddr; + char* end = q + fbSize; + for (;;) { + if (q >= end) break; *q++ = 0; + if (q >= end) break; *q++ = 0; + if (q >= end) break; *q++ = 0; + if (q >= end) break; *q++ = 0; + } +#else + memset(vaddr, 0, fbSize); +#endif +} + int mapFrameBufferLocked(struct private_module_t* module) { // already initialized... @@ -296,7 +317,7 @@ int mapFrameBufferLocked(struct private_module_t* module) return -errno; } module->framebuffer->base = intptr_t(vaddr); - memset(vaddr, 0, fbSize); + clearFrameBuffer(vaddr, fbSize); return 0; } |