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

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

Issue 2743403005: ozone: Add an opaque fb to ScanoutBuffer for primary planes. (Closed)
Patch Set: Replace PrimaryPlane with Opaque. 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
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 eb0b9009349fef71bfba41624f5deacaa660bd94..d36ec22e2424be49593ada0ea3225ba22e6118b8 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc
@@ -21,11 +21,9 @@ GbmBufferBase::GbmBufferBase(const scoped_refptr<GbmDevice>& drm,
: drm_(drm), bo_(bo) {
if (flags & GBM_BO_USE_SCANOUT) {
DCHECK(bo_);
- // The framebuffer format might be different than the format:
- // drm supports 24 bit color depth and formats with alpha will
- // be converted to one without it.
- framebuffer_pixel_format_ =
- GetFourCCFormatForFramebuffer(GetBufferFormatFromFourCCFormat(format));
+ framebuffer_pixel_format_ = format;
+ opaque_framebuffer_pixel_format_ = GetFourCCFormatForOpaqueFramebuffer(
+ GetBufferFormatFromFourCCFormat(format));
// TODO(dcastagna): Add multi-planar support.
uint32_t handles[4] = {0};
@@ -43,6 +41,12 @@ GbmBufferBase::GbmBufferBase(const scoped_refptr<GbmDevice>& drm,
drm_->AddFramebuffer2(gbm_bo_get_width(bo), gbm_bo_get_height(bo),
framebuffer_pixel_format_, handles, strides, offsets,
modifiers, &framebuffer_, addfb_flags);
+ if (opaque_framebuffer_pixel_format_ != framebuffer_pixel_format_) {
+ drm_->AddFramebuffer2(gbm_bo_get_width(bo), gbm_bo_get_height(bo),
+ opaque_framebuffer_pixel_format_, handles, strides,
+ offsets, modifiers, &opaque_framebuffer_,
+ addfb_flags);
+ }
}
}
@@ -55,6 +59,10 @@ uint32_t GbmBufferBase::GetFramebufferId() const {
return framebuffer_;
}
+uint32_t GbmBufferBase::GetOpaqueFramebufferId() const {
+ return opaque_framebuffer_ ? opaque_framebuffer_ : framebuffer_;
+}
+
uint32_t GbmBufferBase::GetHandle() const {
return gbm_bo_get_handle(bo_).u32;
}
@@ -68,6 +76,11 @@ uint32_t GbmBufferBase::GetFramebufferPixelFormat() const {
return framebuffer_pixel_format_;
}
+uint32_t GbmBufferBase::GetOpaqueFramebufferPixelFormat() const {
+ DCHECK(framebuffer_);
+ return opaque_framebuffer_pixel_format_;
+}
+
const DrmDevice* GbmBufferBase::GetDrmDevice() const {
return drm_.get();
}
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer_base.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698