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

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

Issue 2761533002: ozone: Import multi-planar GBMs. (Closed)
Patch Set: LE not LT. Created 3 years, 9 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 | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | 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_base.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc b/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc
index d36ec22e2424be49593ada0ea3225ba22e6118b8..3342791fc49b121f8a10afaf6e4925aa4862189a 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc
@@ -25,14 +25,17 @@ GbmBufferBase::GbmBufferBase(const scoped_refptr<GbmDevice>& drm,
opaque_framebuffer_pixel_format_ = GetFourCCFormatForOpaqueFramebuffer(
GetBufferFormatFromFourCCFormat(format));
- // TODO(dcastagna): Add multi-planar support.
uint32_t handles[4] = {0};
- handles[0] = gbm_bo_get_handle(bo).u32;
uint32_t strides[4] = {0};
- strides[0] = gbm_bo_get_stride(bo);
uint32_t offsets[4] = {0};
uint64_t modifiers[4] = {0};
- modifiers[0] = modifier;
+
+ for (size_t i = 0; i < gbm_bo_get_num_planes(bo); ++i) {
+ handles[i] = gbm_bo_get_plane_handle(bo, i).u32;
+ strides[i] = gbm_bo_get_plane_stride(bo, i);
+ offsets[i] = gbm_bo_get_plane_offset(bo, i);
+ modifiers[i] = modifier;
+ }
// AddFramebuffer2 only considers the modifiers if addfb_flags has
// DRM_MODE_FB_MODIFIERS set. We only set that when we've created
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698