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

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 c54e992f66126c9d7d6c130b619c5c10ea0b3cba..c1ea0b1ec1ac7f28fe830d91d16036492ace6155 100644
--- a/ui/ozone/platform/drm/gpu/drm_thread.cc
+++ b/ui/ozone/platform/drm/gpu/drm_thread.cc
@@ -124,8 +124,24 @@ void DrmThread::CreateBuffer(gfx::AcceleratedWidget widget,
break;
}
- *buffer = GbmBuffer::CreateBuffer(
- gbm, ui::GetFourCCFormatFromBufferFormat(format), size, flags);
+ DCHECK(screen_manager_);
+ DrmWindow* window = screen_manager_->GetWindow(widget);
+
+ uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format);
+ uint64_t modifiers[16];
Daniele Castagna 2016/12/16 00:27:41 It'd be nice if this could go away (for a vector m
hoegsberg1 2016/12/17 01:10:49 Acknowledged.
+ uint32_t nmodifiers = 0;
Daniele Castagna 2016/12/16 00:27:41 nit: s/nmodifiers/num_modifiers or modifiers_size
hoegsberg1 2016/12/17 01:10:49 Ack, but it becomes modifers.size(), even better.
+
+ if (window && window->GetController()) {
Daniele Castagna 2016/12/16 00:27:41 Did we figure out when this is not the case?
hoegsberg1 2016/12/17 01:10:49 No... maybe related to the logout button race? (cr
+ nmodifiers = window->GetController()->GetFormatModifiers(fourcc_format,
+ modifiers, arraysize(modifiers));
+ }
+
+ if (nmodifiers > 0 && !(flags & GBM_BO_USE_LINEAR))
Daniele Castagna 2016/12/16 00:27:41 Why do we need to special case for GBM_BO_USE_LINE
hoegsberg1 2016/12/17 01:10:49 If we need a linear buffer, we can either 1) go th
+ *buffer = GbmBuffer::CreateBufferWithModifiers(
Daniele Castagna 2016/12/16 00:27:41 nit: if you split the body of an if, you need to a
hoegsberg1 2016/12/17 01:10:49 Acknowledged.
+ gbm, fourcc_format, size, flags, modifiers, nmodifiers);
+ else
+ *buffer = GbmBuffer::CreateBuffer(
+ gbm, fourcc_format, size, flags);
}
void DrmThread::CreateBufferFromFds(

Powered by Google App Engine
This is Rietveld 408576698