-
Balazs Engedy authored
This reverts commit 09825450. Reason for revert: `generate_build_files` failure on `Cast Audio Linux` builder: ERROR at //ui/gfx/linux/BUILD.gn:8:1: Assertion failed. assert(use_x11 || ozone_platform_drm || ozone_platform_wayland || ^----- See //media/gpu/chromeos/BUILD.gn:92:5: which caused the file to be included. "//ui/gfx/linux:drm", ^------------------- Original change's description: > media/platform_vf_utils: Handle null GMB factory. > > This CL handles a null GpuMemoryBufferFactory in > AllocateGpuMemoryBufferHandle() so that the caller is not obligated to > pass a valid factory. This is in preparation for follow-ups CLs to > remove the need for video encode accelerators to have access to a > GpuMemoryBufferFactory. > > When the GpuMemoryBufferFactory is null, we just use the render node > directly to allocate a native buffer object and then we wrap it into a > GpuMemoryBufferHandle. > > So, why do we still keep the option to have a non-null > GpuMemoryBufferFactory? This is because that path is still useful in the > decoding case: when a buffer is created with the GpuMemoryBufferFactory, > the corresponding NativePixmap is cached [1]; eventually, a SharedImage > needs to be created and to do so we pass the GpuMemoryBufferHandle > obtained from the factory [2]; when the SharedImage system needs to > create the GLImage for the buffer, it passes the handle to the > factory [3] which in turn uses it to look up the cached > NativePixmap [4]. This saves us from going through a gbm_bo_import() > (which also implies a thread hop to the DRM thread). > > So, in conclusion, for buffers that need to be displayed later, it's > still better to use the GMB factory owned by the GpuServiceImpl. For > encoders this is not the case. > > [1] https://source.chromium.org/chromium/chromium/src/+/master:gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc;l=319;drc=d81c5852498699fe3cd812e78d31c77c28e29281 > [2] https://source.chromium.org/chromium/chromium/src/+/master:media/gpu/chromeos/mailbox_video_frame_converter.cc;l=355-359;drc=d81c5852498699fe3cd812e78d31c77c28e29281 > [3] https://source.chromium.org/chromium/chromium/src/+/master:gpu/command_buffer/service/shared_image_backing_gl_texture.cc;l=355-356;drc=d81c5852498699fe3cd812e78d31c77c28e29281 > [4] https://source.chromium.org/chromium/chromium/src/+/master:gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc;l=164-172;drc=d81c5852498699fe3cd812e78d31c77c28e29281 > > Bug: b:173167846 > Test: video.EncodeAccel.h264_720p_nv12_dmabuf on elm > Change-Id: I7b730eb843da7503c61bffe30dce7a5ce51dec60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568937 > Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org> > Reviewed-by: Miguel Casas <mcasas@chromium.org> > Reviewed-by: Hirokazu Honda <hiroh@chromium.org> > Cr-Commit-Position: refs/heads/master@{#834608} TBR=mcasas@chromium.org,hiroh@chromium.org,andrescj@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: Ibaf9e8a6e473a3b566ee9d5dd45b25a5f5283c14 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b:173167846 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578836Reviewed-by:
Balazs Engedy <engedy@chromium.org> Commit-Queue: Balazs Engedy <engedy@chromium.org> Cr-Commit-Position: refs/heads/master@{#834633}
48fc2519