gralloc: Cache maintenance handling updates

- Make buffer allocations for ubwc formats as uncached since
  access from cpu is not expected.
- Bracket each cache maintenance operation with dma buf sync
  start and sync end.

Change-Id: Ic2676ad9fff9a7ca6111f14e24aaec4c3d7f6ef2
CRs-Fixed: 2210256
diff --git a/gralloc/gr_allocator.h b/gralloc/gr_allocator.h
index 46ec09d..17fb0cb 100644
--- a/gralloc/gr_allocator.h
+++ b/gralloc/gr_allocator.h
@@ -48,13 +48,13 @@
   int ImportBuffer(int fd);
   int FreeBuffer(void *base, unsigned int size, unsigned int offset, int fd, int handle);
   int CleanBuffer(void *base, unsigned int size, unsigned int offset, int handle, int op, int fd);
-  int AllocateMem(AllocData *data, uint64_t usage);
+  int AllocateMem(AllocData *data, uint64_t usage, int format);
   // @return : index of the descriptor with maximum buffer size req
   bool CheckForBufferSharing(uint32_t num_descriptors,
                              const std::vector<std::shared_ptr<BufferDescriptor>> &descriptors,
                              ssize_t *max_index);
   int GetImplDefinedFormat(uint64_t usage, int format);
-  bool UseUncached(uint64_t usage);
+  bool UseUncached(int format, uint64_t usage);
 
  private:
   void GetIonHeapInfo(uint64_t usage, unsigned int *ion_heap_id, unsigned int *alloc_type,