From e03a345a1187024b5d8eb3d969f19a4a3a4381c3 Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Thu, 10 Feb 2011 10:27:59 -0800 Subject: [PATCH] libgralloc-qsd8k: Flush the cache after buffer allocation Change-Id: Idb720b8c64b323216f77de834c83c328caccd6ef --- libgralloc-qsd8k/Android.mk | 2 +- libgralloc-qsd8k/pmemalloc.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libgralloc-qsd8k/Android.mk b/libgralloc-qsd8k/Android.mk index 2c32796..0d69b03 100644 --- a/libgralloc-qsd8k/Android.mk +++ b/libgralloc-qsd8k/Android.mk @@ -30,7 +30,7 @@ LOCAL_SRC_FILES := \ pmemalloc.cpp LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM) -LOCAL_CFLAGS:= -DLOG_TAG=\"$(TARGET_BOARD_PLATFORM).gralloc\" +LOCAL_CFLAGS:= -DLOG_TAG=\"$(TARGET_BOARD_PLATFORM).gralloc\" -DHOST ifneq (, $(filter msm7625_ffa msm7625_surf msm7627_ffa msm7627_surf msm7627_7x_ffa msm7627_7x_surf, $(QCOM_TARGET_PRODUCT))) LOCAL_CFLAGS += -DTARGET_MSM7x27 diff --git a/libgralloc-qsd8k/pmemalloc.cpp b/libgralloc-qsd8k/pmemalloc.cpp index ea30b2b..6604e25 100755 --- a/libgralloc-qsd8k/pmemalloc.cpp +++ b/libgralloc-qsd8k/pmemalloc.cpp @@ -181,7 +181,9 @@ int PmemUserspaceAllocator::alloc_pmem_buffer(size_t size, int usage, } else { LOGV("%s: mapped fd %d at offset %d, size %d", pmemdev, fd, offset, size); memset((char*)base + offset, 0, size); - //cacheflush(intptr_t(base) + offset, intptr_t(base) + offset + size, 0); +#ifdef HOST + cacheflush(intptr_t(base) + offset, intptr_t(base) + offset + size, 0); +#endif *pBase = base; *pOffset = offset; *pFd = fd;