Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed)

Created:
5 years, 9 months ago by emircan
Modified:
5 years, 8 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, jam, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, sievers+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

We redesigned the GpuMemoryBuffer interface to handle multiple buffers. These changes started with the purpose of making use of new EGL_LINUX_DMA_BUF_EXT capabilities[0] and followed by an attempt to change the high level API [1]. [0] https://code.google.com/p/chromium/issues/detail?id=439520 [1] https://codereview.chromium.org/962723002/ The future steps are: - Add new GPUMemoryBuffer format gfx::GpuMemoryBuffer::YUV_420 StrideInBytes() should take index as input - Implement multi buffer support on GpuMemoryBufferFactoryOzoneNativeBuffer Change BufferToPixmapMap as std::map<std::pair<uint32_t, uint32_t>, ScopedVector<NativePixmap> > so that we can create multiple pixmaps(file descriptors) for single GpuMemoryBufferId - Add support for multiple pixmaps in GLImageLinuxDMABuffer - Implement support for GpuMemoryBufferImplSharedMemory Change GpuMemoryBufferHandle to contain std::vector<base::SharedMemoryHandle> - Add support for GLImageSharedMemory and GLImageMemory - Look for possible use cases of multiple buffers on Android, Mac, and Win platforms The new functions added are as below: class GFX_EXPORT GpuMemoryBuffer { // Maps each plane of the buffer into the client's address space so it can be // written to by the CPU. A pointer to plane K is stored at index K-1 of the // |data| array. This call may block, for instance if the GPU needs to finish // accessing the buffer or if CPU caches need to be synchronized. Returns // false on failure. virtual bool Map(void** data) = 0; // Fills the stride in bytes for the each plane of the buffer. The stride of // plane K is stored at index K-1 of the |stride| array. virtual void GetStride(uint32* stride) const = 0; }; The classes effected by this change is as below(except the test implementations). Currently none of them supports multiple buffers as the format doesn't exist. They are going to be implemented per platform in future CLs. +---------------+ |GpuMemoryBuffer| +------+--------+ | +--------+----------+ |GpuMemoryBufferImpl| ++----+-----+------++ | | | | | | | | +------------------------------++ | | +--+-------------------------+ |GpuMemoryBufferImplSharedMemory| | | |GpuMemoryBufferImplIOSurface| +-------------------------------+ | | +----------------------------+ | | +-----------------------------------++ +-+-------------------------------+ |GpuMemoryBufferImplOzoneNatiVeBuffer| |GpuMemoryBufferImplSurfaceTexture| +------------------------------------+ +---------------------------------+ |ui::GpuMemoryBufferFactory | |OzoneNatiVeBuffer | | INITALIZES | | ui::GLImageOzoneNatiVePixmapDmaBuf | | OR | | ui::GLImageOzoneNatiVePixmap | +------------------------------------+ BUG=439520 TEST= GpuMemoryBufferTest.* in gl_tests and GpuMemoryBufferImplTest.* in content_unittests. Committed: https://crrev.com/164855329ada6f5ef96d2147fe38ae25111258c4 Cr-Commit-Position: refs/heads/master@{#322503}

Patch Set 1 : #

Total comments: 12

Patch Set 2 : reveman@ comments. #

Patch Set 3 : Comment and typo fix. #

Total comments: 19

Patch Set 4 : reveman@ comments. #

Total comments: 16

Patch Set 5 : reveman@ comments. #

Total comments: 8

Patch Set 6 : GpuMemoryBufferImplTest fixes. #

Patch Set 7 : reveman@ comments. #

Patch Set 8 : Return val fix. #

Patch Set 9 : Comment fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -56 lines) Patch
M cc/resources/one_copy_tile_task_worker_pool.cc View 1 2 3 1 chunk +7 lines, -3 lines 0 comments Download
M cc/resources/zero_copy_tile_task_worker_pool.cc View 1 2 3 1 chunk +8 lines, -3 lines 0 comments Download
M cc/test/test_gpu_memory_buffer_manager.cc View 1 2 3 4 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/compositor/buffer_queue_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_texture_wrapper.cc View 1 2 3 1 chunk +8 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc View 1 2 3 4 2 chunks +5 lines, -4 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc View 1 2 3 4 5 6 7 3 chunks +7 lines, -6 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +5 lines, -3 lines 0 comments Download
M gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc View 1 2 3 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 2 3 4 1 chunk +5 lines, -4 lines 0 comments Download
M ui/gfx/gpu_memory_buffer.h View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 29 (10 generated)
emircan
Please take a look. This doesn't do much other than changing the interfaces, as I ...
5 years, 9 months ago (2015-03-20 23:45:59 UTC) #4
reveman
https://codereview.chromium.org/1024113003/diff/40001/content/common/gpu/client/gpu_memory_buffer_impl.h File content/common/gpu/client/gpu_memory_buffer_impl.h (right): https://codereview.chromium.org/1024113003/diff/40001/content/common/gpu/client/gpu_memory_buffer_impl.h#newcode61 content/common/gpu/client/gpu_memory_buffer_impl.h:61: const size_t num_planes_; This can be derived from the ...
5 years, 9 months ago (2015-03-21 03:03:55 UTC) #5
emircan
Please take a look. I changed function singatures as requested. https://codereview.chromium.org/1024113003/diff/40001/content/common/gpu/client/gpu_memory_buffer_impl.h File content/common/gpu/client/gpu_memory_buffer_impl.h (right): https://codereview.chromium.org/1024113003/diff/40001/content/common/gpu/client/gpu_memory_buffer_impl.h#newcode61 ...
5 years, 9 months ago (2015-03-23 19:21:36 UTC) #6
reveman
https://codereview.chromium.org/1024113003/diff/100001/cc/resources/one_copy_tile_task_worker_pool.cc File cc/resources/one_copy_tile_task_worker_pool.cc (right): https://codereview.chromium.org/1024113003/diff/100001/cc/resources/one_copy_tile_task_worker_pool.cc#newcode324 cc/resources/one_copy_tile_task_worker_pool.cc:324: size_t num_buffers = gpu_memory_buffer->GetNumberOfPlanes(); This code is for contents ...
5 years, 9 months ago (2015-03-23 22:24:01 UTC) #8
emircan
https://codereview.chromium.org/1024113003/diff/100001/cc/resources/one_copy_tile_task_worker_pool.cc File cc/resources/one_copy_tile_task_worker_pool.cc (right): https://codereview.chromium.org/1024113003/diff/100001/cc/resources/one_copy_tile_task_worker_pool.cc#newcode324 cc/resources/one_copy_tile_task_worker_pool.cc:324: size_t num_buffers = gpu_memory_buffer->GetNumberOfPlanes(); On 2015/03/23 22:24:00, reveman wrote: ...
5 years, 9 months ago (2015-03-24 16:52:27 UTC) #9
reveman
https://codereview.chromium.org/1024113003/diff/100001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (right): https://codereview.chromium.org/1024113003/diff/100001/ui/gfx/gpu_memory_buffer.h#newcode79 ui/gfx/gpu_memory_buffer.h:79: virtual size_t GetNumberOfPlanes() const = 0; On 2015/03/24 16:52:27, ...
5 years, 9 months ago (2015-03-24 20:13:59 UTC) #10
emircan
https://codereview.chromium.org/1024113003/diff/100001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (right): https://codereview.chromium.org/1024113003/diff/100001/ui/gfx/gpu_memory_buffer.h#newcode79 ui/gfx/gpu_memory_buffer.h:79: virtual size_t GetNumberOfPlanes() const = 0; On 2015/03/24 20:13:59, ...
5 years, 9 months ago (2015-03-24 21:43:45 UTC) #12
reveman
https://codereview.chromium.org/1024113003/diff/160001/content/browser/compositor/buffer_queue_unittest.cc File content/browser/compositor/buffer_queue_unittest.cc (right): https://codereview.chromium.org/1024113003/diff/160001/content/browser/compositor/buffer_queue_unittest.cc#newcode34 content/browser/compositor/buffer_queue_unittest.cc:34: void GetStride(uint32* stride) const override { *stride = 0; ...
5 years, 9 months ago (2015-03-24 22:16:53 UTC) #13
emircan
https://codereview.chromium.org/1024113003/diff/160001/content/browser/compositor/buffer_queue_unittest.cc File content/browser/compositor/buffer_queue_unittest.cc (right): https://codereview.chromium.org/1024113003/diff/160001/content/browser/compositor/buffer_queue_unittest.cc#newcode34 content/browser/compositor/buffer_queue_unittest.cc:34: void GetStride(uint32* stride) const override { *stride = 0; ...
5 years, 9 months ago (2015-03-24 22:45:16 UTC) #14
reveman
lgtm after updating the description to match the latest version of the patch. thanks!
5 years, 9 months ago (2015-03-24 22:53:52 UTC) #16
emircan
Thanks a lot reveman@. I updated the post and comments. I still need owners review. ...
5 years, 9 months ago (2015-03-24 23:44:27 UTC) #18
emircan
On 2015/03/24 23:44:27, emircan wrote: > Thanks a lot reveman@. I updated the post and ...
5 years, 9 months ago (2015-03-26 19:29:49 UTC) #19
reveman
cc/, ui/gfx/ and content/common/gpu/*gpu_memory_buffer* still lgtm :)
5 years, 9 months ago (2015-03-26 19:38:49 UTC) #20
no sievers
lgtm
5 years, 9 months ago (2015-03-26 20:21:52 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1024113003/260001
5 years, 9 months ago (2015-03-26 22:59:54 UTC) #23
commit-bot: I haz the power
Committed patchset #9 (id:260001)
5 years, 9 months ago (2015-03-27 00:06:15 UTC) #24
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/164855329ada6f5ef96d2147fe38ae25111258c4 Cr-Commit-Position: refs/heads/master@{#322503}
5 years, 9 months ago (2015-03-27 00:06:58 UTC) #25
bobbycheva
lgtm
5 years, 8 months ago (2015-04-11 07:30:54 UTC) #28
bobbycheva
5 years, 8 months ago (2015-04-11 07:30:54 UTC) #29
Message was sent while issue was closed.
lgtm

lgtm

Powered by Google App Engine
This is Rietveld 408576698