Remove QCom specific flags

* We can't have any device specific code on Android

Bug: 38207381
Test: Compiled
Change-Id: I0cab52d71c65ff401985b01140452c7901eef855
diff --git a/libs/vr/libbufferhub/buffer_hub_client.cpp b/libs/vr/libbufferhub/buffer_hub_client.cpp
index a09a7a1..b9a53b0 100644
--- a/libs/vr/libbufferhub/buffer_hub_client.cpp
+++ b/libs/vr/libbufferhub/buffer_hub_client.cpp
@@ -9,7 +9,6 @@
 
 #include <pdx/default_transport/client_channel.h>
 #include <pdx/default_transport/client_channel_factory.h>
-#include <private/dvr/platform_defines.h>
 
 #include "include/private/dvr/bufferhub_rpc.h"
 
@@ -18,15 +17,6 @@
 using android::pdx::rpc::WrapBuffer;
 using android::pdx::Status;
 
-namespace {
-
-// TODO(hendrikw): These flags can not be hard coded.
-constexpr int kUncachedBlobUsageFlags = GRALLOC_USAGE_SW_READ_RARELY |
-                                        GRALLOC_USAGE_SW_WRITE_RARELY |
-                                        GRALLOC_USAGE_PRIVATE_UNCACHED;
-
-}  // anonymous namespace
-
 namespace android {
 namespace dvr {
 
@@ -101,25 +91,14 @@
 int BufferHubBuffer::GetBlobReadWritePointer(size_t size, void** addr) {
   int width = static_cast<int>(size);
   int height = 1;
-  // TODO(hendrikw): These flags can not be hard coded.
-  constexpr int usage = GRALLOC_USAGE_SW_READ_RARELY |
-                        GRALLOC_USAGE_SW_WRITE_RARELY |
-                        GRALLOC_USAGE_PRIVATE_UNCACHED;
-  int ret = Lock(usage, 0, 0, width, height, addr);
+  int ret = Lock(usage(), 0, 0, width, height, addr);
   if (ret == 0)
     Unlock();
   return ret;
 }
 
 int BufferHubBuffer::GetBlobReadOnlyPointer(size_t size, void** addr) {
-  int width = static_cast<int>(size);
-  int height = 1;
-  constexpr int usage =
-      GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_PRIVATE_UNCACHED;
-  int ret = Lock(usage, 0, 0, width, height, addr);
-  if (ret == 0)
-    Unlock();
-  return ret;
+  return GetBlobReadWritePointer(size, addr);
 }
 
 void BufferHubBuffer::GetBlobFds(int* fds, size_t* fds_count,
@@ -429,16 +408,5 @@
       InvokeRemoteMethod<BufferHubRPC::ProducerRemovePersistence>());
 }
 
-std::unique_ptr<BufferProducer> BufferProducer::CreateUncachedBlob(
-    size_t size) {
-  return BufferProducer::Create(kUncachedBlobUsageFlags, size);
-}
-
-std::unique_ptr<BufferProducer> BufferProducer::CreatePersistentUncachedBlob(
-    const std::string& name, int user_id, int group_id, size_t size) {
-  return BufferProducer::Create(name, user_id, group_id,
-                                kUncachedBlobUsageFlags, size);
-}
-
 }  // namespace dvr
 }  // namespace android
diff --git a/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h b/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
index 83e9255..be20e72 100644
--- a/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
+++ b/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
@@ -131,15 +131,6 @@
 // The API also assumes that metadata is a serializable type (plain old data).
 class BufferProducer : public pdx::ClientBase<BufferProducer, BufferHubBuffer> {
  public:
-  // Create a buffer designed to hold arbitrary bytes that can be read and
-  // written from CPU, GPU and DSP. The buffer is mapped uncached so that CPU
-  // reads and writes are predictable.
-  static std::unique_ptr<BufferProducer> CreateUncachedBlob(size_t size);
-
-  // Creates a persistent uncached buffer with the given name and access.
-  static std::unique_ptr<BufferProducer> CreatePersistentUncachedBlob(
-      const std::string& name, int user_id, int group_id, size_t size);
-
   // Imports a bufferhub producer channel, assuming ownership of its handle.
   static std::unique_ptr<BufferProducer> Import(LocalChannelHandle channel);
   static std::unique_ptr<BufferProducer> Import(
diff --git a/libs/vr/libdvrcommon/include/private/dvr/platform_defines.h b/libs/vr/libdvrcommon/include/private/dvr/platform_defines.h
deleted file mode 100644
index 2176903..0000000
--- a/libs/vr/libdvrcommon/include/private/dvr/platform_defines.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef ANDROID_DVR_PLATFORM_DEFINES_H_
-#define ANDROID_DVR_PLATFORM_DEFINES_H_
-
-#include <hardware/gralloc1.h>
-// Platform-specific macros and defines.
-
-// QCOM's GRALLOC_USAGE_PRIVATE_ALLOC_UBWC usage bits.
-#define GRALLOC_USAGE_QCOM_FRAMEBUFFER_COMPRESSION GRALLOC_USAGE_PRIVATE_1 | GRALLOC1_PRODUCER_USAGE_PRIVATE_0
-
-// QCOM bit to use the ADSP heap. This carveout heap is accessible to Linux,
-// Hexagon DSPs, and the GPU.
-#define GRALLOC_USAGE_PRIVATE_ADSP_HEAP 0x01000000
-
-// Force a gralloc buffer to get the uncached ION option set.
-#define GRALLOC_USAGE_PRIVATE_UNCACHED 0x02000000
-
-#endif  // ANDROID_DVR_PLATFORM_DEFINES_H_
diff --git a/libs/vr/libvrflinger/display_surface.cpp b/libs/vr/libvrflinger/display_surface.cpp
index 5829788..fb2751b 100644
--- a/libs/vr/libvrflinger/display_surface.cpp
+++ b/libs/vr/libvrflinger/display_surface.cpp
@@ -3,7 +3,6 @@
 #include <private/android_filesystem_config.h>
 #include <utils/Trace.h>
 
-#include <private/dvr/platform_defines.h>
 #include <private/dvr/trusted_uids.h>
 
 #include "display_service.h"