Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd436833 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove QCom specific flags" into oc-dev

parents b2f9ce2d 4720c9db
Loading
Loading
Loading
Loading
+2 −34
Original line number Diff line number Diff line
@@ -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::LocalChannelHandle;
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::Unlock() { return buffer_.Unlock(); }
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 @@ int BufferProducer::RemovePersistence() {
      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
+0 −9
Original line number Diff line number Diff line
@@ -131,15 +131,6 @@ class BufferHubBuffer : public pdx::Client {
// 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(
+0 −17
Original line number Diff line number Diff line
#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_
+0 −1
Original line number Diff line number Diff line
@@ -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"