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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_buffer.cc

Issue 2705733003: ozone: Don't assume AddFB succeeds when importing buffers. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_buffer.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index ebd499fa7662f3b7ecdbb5e29cfac16d6b38cc3b..5d4643411a6e5f0f9de70d737a2c51c0dc209e44 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -183,14 +183,14 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds(
DCHECK_LE(fds.size(), planes.size());
DCHECK_EQ(planes[0].offset, 0);
- // Use scanout if supported.
- bool use_scanout =
+ // Try to use scanout if supported.
+ bool try_scanout =
gbm_device_is_format_supported(
gbm->device(), format, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING) &&
(planes.size() == 1);
gbm_bo* bo = nullptr;
- if (use_scanout) {
+ if (try_scanout) {
struct gbm_import_fd_data fd_data;
fd_data.fd = fds[0].get();
fd_data.width = size.width();
@@ -209,14 +209,10 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds(
}
uint32_t flags = GBM_BO_USE_RENDERING;
- if (use_scanout)
+ if (try_scanout)
flags |= GBM_BO_USE_SCANOUT;
scoped_refptr<GbmBuffer> buffer(new GbmBuffer(
gbm, bo, format, flags, 0, 0, std::move(fds), size, std::move(planes)));
- // If scanout support for buffer is expected then make sure we managed to
- // create a framebuffer for it as otherwise using it for scanout will fail.
- if (use_scanout && !buffer->GetFramebufferId())
- return nullptr;
return buffer;
}
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698