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-05-08 02:48:03 +0530 |
commit | 81776a7e8c227ee54334c0b63900cd7b3143bf31 (patch) | |
tree | 4f8bcea01c2e7ae9e35490d37df43447270db07d | |
parent | 90bcfe42b42742b3d814e5d91f2288ffb9eb5f12 (diff) | |
download | libhardware-linaro-juice2-20140507.tar.gz |
Don't use memset to clear the framebuffer on arm64linaro-juice2-20140507
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 b7ba3b1a..3f8ed51b 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp @@ -132,6 +132,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... @@ -284,7 +305,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; } |