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

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

Issue 2623963002: ozone: Allocate scanout buffers according to KMS modifiers. (Closed)
Patch Set: Remove unused modifier_. 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 fb9be7e14b2bfb273b993aeb05688e2289fee15f..ad941681e978d446c9b2c2e99eb8ed080f326e1e 100644
--- a/ui/ozone/platform/drm/gpu/drm_thread.cc
+++ b/ui/ozone/platform/drm/gpu/drm_thread.cc
@@ -125,8 +125,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