gpu: Retry to allocate an image when SCANOUT fails
CreateSharedImage with usage SHARED_IMAGE_USAGE_SCANOUT tries to allocate the underlying buffer with BufferUsage::SCANOUT. BufferUsage::SCANOUT might fail in some circumentances when a buffer can still be allocated, but it's not possible to use it for scanout (e.g: on virtio_gpu AddFramebuffer will fail for buffers smaller than a certain threshold). This changes the logic of CreateSharedImage so that in cases where we fail to allocate a buffer for scanout, we try again to allocate just for GL. Bug: 1024019 Test: crrev.com/c/1918316 in webgl_conformance_tests on chromeos-amd64-generic-rel Change-Id: I20615e0780e47425a4074204f706bc66018e2071 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933198 Commit-Queue: Daniele Castagna <dcastagna@chromium.org> Reviewed-by:Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#718970}
Showing
Please register or sign in to comment