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

Unified Diff: ui/ozone/platform/drm/gpu/hardware_display_controller.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
Index: ui/ozone/platform/drm/gpu/hardware_display_controller.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index c45ed81146759ef83c64fe507846e9ef399d2ea8..922b74031f37dea4915754eec3d11696f5b3324b 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -143,6 +143,28 @@ bool HardwareDisplayController::IsFormatSupported(uint32_t fourcc_format,
return true;
}
+std::vector<uint64_t> HardwareDisplayController::GetFormatModifiers(
+ uint32_t format) {
+ std::vector<uint64_t> modifiers;
+
+ if (crtc_controllers_.empty())
+ return modifiers;
+
+ modifiers = crtc_controllers_[0]->GetFormatModifiers(format);
+
+ for (size_t i = 1; i < crtc_controllers_.size(); ++i) {
+ std::vector<uint64_t> other =
+ crtc_controllers_[i]->GetFormatModifiers(format);
+ std::vector<uint64_t> intersection;
+
+ std::set_intersection(modifiers.begin(), modifiers.end(), other.begin(),
+ other.end(), std::back_inserter(intersection));
+ modifiers = std::move(intersection);
+ }
+
+ return modifiers;
+}
+
bool HardwareDisplayController::SetCursor(
const scoped_refptr<ScanoutBuffer>& buffer) {
bool status = true;
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_controller.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698