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

Commit 70161a5f authored by Tianyu's avatar Tianyu Committed by Tianyu Jiang
Browse files

Remove GetBlobReadOnlyPointer.

It is actually the same as GetBlobReadWritePointer. It is better not to
make the user of this function think that this function provide immutable
contents, and accidentally do something unexpected.

Tested on master branch with Marlin
and oc-dr1-daydream-dev branch with Vega
Test: buffer_hub_queue-test buffer_hub_queue_producer-test dvr_api-test
dvr_buffer_queue-test buffer_hub-test
Bug: None.
Change-Id: I1e6fd4ed1d7a1bbb611db910d35dc022bb4067a5
parent bc99b990
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -209,10 +209,6 @@ int BufferHubBase::GetBlobReadWritePointer(size_t size, void** addr) {
  return ret;
}

int BufferHubBase::GetBlobReadOnlyPointer(size_t size, void** addr) {
  return GetBlobReadWritePointer(size, addr);
}

void BufferHubBase::GetBlobFds(int* fds, size_t* fds_count,
                               size_t max_fds_count) const {
  size_t numFds = static_cast<size_t>(native_handle()->numFds);
+0 −5
Original line number Diff line number Diff line
@@ -39,11 +39,6 @@ class BufferHubBase : public pdx::Client {
  // after calling this method.
  int GetBlobReadWritePointer(size_t size, void** addr);

  // Gets a blob buffer that was created with ProducerBuffer::CreateBlob.
  // Locking and Unlocking is handled internally. There's no need to Unlock
  // after calling this method.
  int GetBlobReadOnlyPointer(size_t size, void** addr);

  // Returns a dup'd file descriptor for accessing the blob shared memory. The
  // caller takes ownership of the file descriptor and must close it or pass on
  // ownership. Some GPU API extensions can take file descriptors to bind shared
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ class PoseClient : public pdx::ClientBase<PoseClient> {
    }
    constexpr size_t size = DvrVsyncPoseBuffer::kSize * sizeof(DvrPoseAsync);
    void* addr = nullptr;
    int ret = buffer->GetBlobReadOnlyPointer(size, &addr);
    int ret = buffer->GetBlobReadWritePointer(size, &addr);
    if (ret < 0 || !addr) {
      ALOGE("Pose failed to map ring buffer: ret:%d, addr:%p", ret, addr);
      return -EIO;