From c114ff7aedead6cbfa36c7ebfba827171a7f3727 Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Thu, 28 Jul 2011 11:48:38 -0700 Subject: [PATCH] libgralloc-qsd8k: Invalidate the ashmem cache Invalidate the ashmem cache after allocating an ashmem buffer. Change-Id: I874711297c983d64646e069c17c1f2880c4af3d9 --- gpu.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gpu.cpp b/gpu.cpp index 950e246..c24dee5 100644 --- a/gpu.cpp +++ b/gpu.cpp @@ -21,6 +21,10 @@ #include +#ifdef HOST +#include +#endif + #include "gr.h" #include "gpu.h" @@ -154,6 +158,11 @@ int gpu_context_t::alloc_ashmem_buffer(size_t size, unsigned int postfix, void** *pFd = fd; *pBase = base; *pOffset = offset; +#ifdef HOST + if (ioctl(fd, ASHMEM_CACHE_INV_RANGE, NULL)) { + LOGE("ASHMEM_CACHE_INV_RANGE failed fd = %d", fd); + } +#endif } return err; }