gralloc: Optimize ION cache clean and invalidate calls

-Clients not having WRITE_OFTEN or READ_OFTEN are uncached.
-Invalidate cache on lock only if CPU needs to read and there
are non-CPU writers in system (camera,gpu etc)
-Flush cache on unlock only if CPU writes. Since all buffers will be
read in HWC(MDP) there is no need to check if readers exist.

Change-Id: Icd114e60b7456bd71592b81016892e806c37cb22
diff --git a/libgralloc/gralloc_priv.h b/libgralloc/gralloc_priv.h
index f029b80..75b8349 100644
--- a/libgralloc/gralloc_priv.h
+++ b/libgralloc/gralloc_priv.h
@@ -180,6 +180,7 @@
             PRIV_FLAGS_USES_ION           = 0x00000008,
             PRIV_FLAGS_USES_ASHMEM        = 0x00000010,
             PRIV_FLAGS_NEEDS_FLUSH        = 0x00000020,
+            // Uncached memory or no CPU writers
             PRIV_FLAGS_DO_NOT_FLUSH       = 0x00000040,
             PRIV_FLAGS_SW_LOCK            = 0x00000080,
             PRIV_FLAGS_NONCONTIGUOUS_MEM  = 0x00000100,