Index: ui/ozone/platform/drm/gpu/drm_thread.cc |
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.cc b/ui/ozone/platform/drm/gpu/drm_thread.cc |
index 1b91c7eca2f8074ca60aef733c224e520e5bdeb1..823a6963e96cc5397a00d8b449dc065d6e5dc109 100644 |
--- a/ui/ozone/platform/drm/gpu/drm_thread.cc |
+++ b/ui/ozone/platform/drm/gpu/drm_thread.cc |
@@ -124,8 +124,21 @@ void DrmThread::CreateBuffer(gfx::AcceleratedWidget widget, |
break; |
} |
- *buffer = GbmBuffer::CreateBuffer( |
- gbm, ui::GetFourCCFormatFromBufferFormat(format), size, flags); |
+ DrmWindow* window = screen_manager_->GetWindow(widget); |
+ std::vector<uint64_t> modifiers; |
+ |
+ uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format); |
+ |
+ // TODO(hoegsberg): We shouldn't really get here without a window, |
+ // but it happens during init. Need to figure out why. |
+ if (window && window->GetController()) |
+ modifiers = window->GetController()->GetFormatModifiers(fourcc_format); |
+ |
+ if (modifiers.size() > 0 && !(flags & GBM_BO_USE_LINEAR)) |
+ *buffer = GbmBuffer::CreateBufferWithModifiers(gbm, fourcc_format, size, |
+ flags, modifiers); |
+ else |
+ *buffer = GbmBuffer::CreateBuffer(gbm, fourcc_format, size, flags); |
} |
void DrmThread::CreateBufferFromFds( |