only set the PRIV_FLAGS_NEEDS_FLUSH flag on PMEM buffers

PRIV_FLAGS_NEEDS_FLUSH will trigger an ioctl call into the PMEM
driver in unlock(), so it makes not sense to set this flag for
non pmem buffers.

Change-Id: Ie1e077c10df86d3689b82fa6ce5d6c856fc95688
This commit is contained in:
Mathias Agopian 2010-08-20 11:47:44 -07:00
parent 6abac7a69e
commit 361e52090e

View File

@ -238,8 +238,14 @@ int gralloc_lock(gralloc_module_t const* module,
// if requesting sw write for non-framebuffer handles, flag for
// flushing at unlock
const uint32_t pmemMask =
private_handle_t::PRIV_FLAGS_USES_PMEM |
private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP;
if ((usage & GRALLOC_USAGE_SW_WRITE_MASK) &&
!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
(hnd->flags & pmemMask) &&
!(hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)) {
hnd->flags |= private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
}