Loading libs/vr/libbufferhub/include/private/dvr/buffer_hub_base.h +10 −10 Original line number Diff line number Diff line Loading @@ -21,16 +21,6 @@ class BufferHubBase : public pdx::Client { // a file descriptor for the new channel or a negative error code. Status<LocalChannelHandle> CreateConsumer(); // Locks the area specified by (x, y, width, height) for a specific usage. If // the usage is software then |addr| will be updated to point to the address // of the buffer in virtual memory. The caller should only access/modify the // pixels in the specified area. anything else is undefined behavior. int Lock(int usage, int x, int y, int width, int height, void** addr); // Must be called after Lock() when the caller has finished changing the // buffer. int Unlock(); // 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. Loading Loading @@ -128,6 +118,16 @@ class BufferHubBase : public pdx::Client { int UpdateSharedFence(const LocalHandle& new_fence, const LocalHandle& shared_fence); // Locks the area specified by (x, y, width, height) for a specific usage. If // the usage is software then |addr| will be updated to point to the address // of the buffer in virtual memory. The caller should only access/modify the // pixels in the specified area. anything else is undefined behavior. int Lock(int usage, int x, int y, int width, int height, void** addr); // Must be called after Lock() when the caller has finished changing the // buffer. int Unlock(); // IonBuffer that is shared between bufferhubd, producer, and consumers. size_t metadata_buf_size_{0}; size_t user_metadata_size_{0}; Loading libs/vr/libvrflinger/tests/vrflinger_test.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -205,9 +205,9 @@ TEST(VrFlingerTest, ActivateDeactivate) { ASSERT_EQ(buffer.get()->height(), metrics.get().display_height); void* raw_buf = nullptr; ASSERT_GE(buffer.get()->Lock(AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN, /*x=*/0, /*y=*/0, buffer.get()->width(), buffer.get()->height(), &raw_buf), ASSERT_GE(buffer.get()->buffer()->Lock( AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN, /*x=*/0, /*y=*/0, buffer.get()->width(), buffer.get()->height(), &raw_buf), 0); ASSERT_NE(raw_buf, nullptr); uint32_t* pixels = static_cast<uint32_t*>(raw_buf); Loading @@ -216,7 +216,7 @@ TEST(VrFlingerTest, ActivateDeactivate) { pixels[i] = 0x0000ff00; } ASSERT_GE(buffer.get()->Unlock(), 0); ASSERT_GE(buffer.get()->buffer()->Unlock(), 0); ASSERT_GE(buffer.get()->Post(/*ready_fence=*/pdx::LocalHandle()), 0); Loading Loading
libs/vr/libbufferhub/include/private/dvr/buffer_hub_base.h +10 −10 Original line number Diff line number Diff line Loading @@ -21,16 +21,6 @@ class BufferHubBase : public pdx::Client { // a file descriptor for the new channel or a negative error code. Status<LocalChannelHandle> CreateConsumer(); // Locks the area specified by (x, y, width, height) for a specific usage. If // the usage is software then |addr| will be updated to point to the address // of the buffer in virtual memory. The caller should only access/modify the // pixels in the specified area. anything else is undefined behavior. int Lock(int usage, int x, int y, int width, int height, void** addr); // Must be called after Lock() when the caller has finished changing the // buffer. int Unlock(); // 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. Loading Loading @@ -128,6 +118,16 @@ class BufferHubBase : public pdx::Client { int UpdateSharedFence(const LocalHandle& new_fence, const LocalHandle& shared_fence); // Locks the area specified by (x, y, width, height) for a specific usage. If // the usage is software then |addr| will be updated to point to the address // of the buffer in virtual memory. The caller should only access/modify the // pixels in the specified area. anything else is undefined behavior. int Lock(int usage, int x, int y, int width, int height, void** addr); // Must be called after Lock() when the caller has finished changing the // buffer. int Unlock(); // IonBuffer that is shared between bufferhubd, producer, and consumers. size_t metadata_buf_size_{0}; size_t user_metadata_size_{0}; Loading
libs/vr/libvrflinger/tests/vrflinger_test.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -205,9 +205,9 @@ TEST(VrFlingerTest, ActivateDeactivate) { ASSERT_EQ(buffer.get()->height(), metrics.get().display_height); void* raw_buf = nullptr; ASSERT_GE(buffer.get()->Lock(AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN, /*x=*/0, /*y=*/0, buffer.get()->width(), buffer.get()->height(), &raw_buf), ASSERT_GE(buffer.get()->buffer()->Lock( AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN, /*x=*/0, /*y=*/0, buffer.get()->width(), buffer.get()->height(), &raw_buf), 0); ASSERT_NE(raw_buf, nullptr); uint32_t* pixels = static_cast<uint32_t*>(raw_buf); Loading @@ -216,7 +216,7 @@ TEST(VrFlingerTest, ActivateDeactivate) { pixels[i] = 0x0000ff00; } ASSERT_GE(buffer.get()->Unlock(), 0); ASSERT_GE(buffer.get()->buffer()->Unlock(), 0); ASSERT_GE(buffer.get()->Post(/*ready_fence=*/pdx::LocalHandle()), 0); Loading