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

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

Issue 2471413006: Disable multi-planar import for now (Closed)
Patch Set: Stopped using bitwise operator Created 4 years, 1 month 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 | no next file » | 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 32c8209d9c3a76cac9cde80f182cb1f960eece0b..0db6f9ac186e4c8f45e5d44bbdcb439079a107c4 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -167,27 +167,22 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds(
// Use scanout if supported.
bool use_scanout = gbm_device_is_format_supported(
- gbm->device(), fourcc_format, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
+ gbm->device(), fourcc_format,
+ GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING) &&
+ (planes.size() == 1);
gbm_bo* bo = nullptr;
if (use_scanout) {
- struct gbm_import_fd_planar_data fd_data {};
- for (size_t i = 0; i < fds.size(); ++i)
- fd_data.fds[i] = fds[i].get();
-
+ struct gbm_import_fd_data fd_data;
+ fd_data.fd = fds[0].get();
fd_data.width = size.width();
fd_data.height = size.height();
+ fd_data.stride = planes[0].stride;
fd_data.format = fourcc_format;
- for (size_t i = 0; i < planes.size(); ++i) {
- fd_data.strides[i] = planes[i].stride;
- fd_data.offsets[i] = planes[i].offset;
- fd_data.format_modifiers[i] = planes[i].modifier;
- }
-
- // The fds passed to gbm_bo_import are not ref-counted and need to be
+ // The fd passed to gbm_bo_import is not ref-counted and need to be
// kept open for the lifetime of the buffer.
- bo = gbm_bo_import(gbm->device(), GBM_BO_IMPORT_FD_PLANAR, &fd_data,
+ bo = gbm_bo_import(gbm->device(), GBM_BO_IMPORT_FD, &fd_data,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
if (!bo) {
LOG(ERROR) << "nullptr returned from gbm_bo_import";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698