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

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

Issue 2627193003: ozone: Allocate scanout buffers according to KMS modifiers. (Closed)
Patch Set: Created 3 years, 11 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/drm_device.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698