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

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

Issue 2576263002: ozone: Allocate scanout buffer according to KMS modifiers (Closed)
Patch Set: ozone: Allocate scanout buffer according to KMS modifiers Created 4 years 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/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..a14724d8b31168b82f8606fa989b9ece5a8607da 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);
+ DCHECK(screen_manager_);
dnicoara 2016/12/19 19:44:46 nit: No need to DCHECK, the following access will
hoegsberg1 2016/12/22 23:05:20 Acknowledged.
+ DrmWindow* window = screen_manager_->GetWindow(widget);
+ std::vector<uint64_t> modifiers;
+
+ uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format);
+
+ if (window && window->GetController())
Daniele Castagna 2016/12/20 18:03:28 It'd be nice to understand why this happens, or at
hoegsberg1 2016/12/22 23:05:20 I added a todo there.
+ 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(

Powered by Google App Engine
This is Rietveld 408576698