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 355b0afdc665c17f567182eb3b9859e94080a32f..407f0200b4faa4a6364bfc07be3b02ab18776fe8 100644 |
--- a/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc |
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer_base.cc |
@@ -11,35 +11,27 @@ |
namespace ui { |
-namespace { |
- |
-// Pixel configuration for the current buffer format. |
-// TODO(dnicoara) These will need to change once we query the hardware for |
-// supported configurations. |
-const uint8_t kColorDepth = 24; |
-const uint8_t kPixelDepth = 32; |
- |
-} // namespace |
- |
GbmBufferBase::GbmBufferBase(const scoped_refptr<DrmDevice>& drm, |
gbm_bo* bo, |
bool scanout) |
: drm_(drm), bo_(bo) { |
if (scanout) { |
- if (!drm_->AddFramebuffer(gbm_bo_get_width(bo), gbm_bo_get_height(bo), |
- kColorDepth, kPixelDepth, gbm_bo_get_stride(bo), |
- gbm_bo_get_handle(bo).u32, &framebuffer_)) { |
- PLOG(ERROR) << "Failed to register buffer"; |
- return; |
- } |
- |
fb_pixel_format_ = gbm_bo_get_format(bo); |
if (fb_pixel_format_ == GBM_FORMAT_ARGB8888) |
fb_pixel_format_ = GBM_FORMAT_XRGB8888; |
- // For now, we always create a frame buffer of 24 bit color depth and |
- // support only XRGB format. |
- DCHECK(fb_pixel_format_ == GBM_FORMAT_XRGB8888); |
+ 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}; |
+ |
+ if (!drm_->AddFramebuffer2(gbm_bo_get_width(bo), gbm_bo_get_height(bo), |
+ fb_pixel_format_, handles, strides, offsets, |
+ &framebuffer_, 0)) { |
+ PLOG(ERROR) << "Failed to register buffer"; |
+ return; |
+ } |
} |
} |