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/hardware_display_controller.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/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..f53c45c23bb3f4da40ce43ee11a04930db03164f 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -143,6 +143,29 @@ 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