From 4e3b559b23624d6a567740f03e1b895c0d7cc4d3 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Thu, 14 Jul 2011 20:49:56 +0530 Subject: [PATCH] msm7k: Add support for non-cached blit Add support for the userspace to make MDP avoid flushing the source image buffer This change is needed if we are using cached video buffers. Since the MDP driver used to flush the entire source buffer before the blit, it was a huge overhead in terms of CPU usage for cases where the entire buffer didn't really need flushing. Any clients that modify the video buffers with CPU should now ensure that they flush the region that they modified (if the memory is cached) Change-Id: I94572644ed5aefac3184b45df05d10be0f2c7660 --- gralloc_priv.h | 1 + mapper.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gralloc_priv.h b/gralloc_priv.h index a9a665d..3869ac3 100644 --- a/gralloc_priv.h +++ b/gralloc_priv.h @@ -311,6 +311,7 @@ struct private_handle_t { PRIV_FLAGS_USES_PMEM_ADSP = 0x00000004, PRIV_FLAGS_NEEDS_FLUSH = 0x00000008, PRIV_FLAGS_USES_ASHMEM = 0x00000010, + PRIV_FLAGS_DO_NOT_FLUSH = 0x00000020, }; enum { diff --git a/mapper.cpp b/mapper.cpp index 4223ae7..4a83483 100644 --- a/mapper.cpp +++ b/mapper.cpp @@ -354,7 +354,8 @@ int gralloc_perform(struct gralloc_module_t const* module, hnd->magic = private_handle_t::sMagic; hnd->fd = fd; hnd->flags = (memoryFlags == GRALLOC_USAGE_PRIVATE_PMEM) ? - private_handle_t::PRIV_FLAGS_USES_PMEM : + private_handle_t::PRIV_FLAGS_USES_PMEM | + private_handle_t::PRIV_FLAGS_DO_NOT_FLUSH: private_handle_t::PRIV_FLAGS_USES_ASHMEM; hnd->size = size; hnd->offset = offset;