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

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

Issue 1426993003: Ozone: Dont hardcode format to YUV when using Overlay Composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cosmetic fixes Created 5 years, 1 month 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_plane_manager.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
index 75905fc88f7f645ee4b839b34dc6d5b2a14c41a6..5c8ea5493ae9dedc995a6bd84ece224197c631a0 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
@@ -297,4 +297,35 @@ HardwareDisplayPlaneManager::GetCompatibleHardwarePlaneIds(
return plane_ids;
}
+bool HardwareDisplayPlaneManager::IsFormatSupported(uint32_t fourcc_format,
+ uint32_t z_order,
+ uint32_t crtc_id) const {
+ int crtc_index = LookupCrtcIndex(crtc_id);
+ if (crtc_index < 0) {
+ LOG(ERROR) << "Cannot find crtc " << crtc_id;
+ return false;
+ }
+
+ // We dont have a way to query the z_order of a plane. This is a temporary
+ // solution till driver exposes z_order property.
+ uint32_t plane_z_order = 0;
+ for (auto* hardware_plane : planes_) {
+ if (plane_z_order > z_order)
+ break;
+
+ if (!hardware_plane->CanUseForCrtc(crtc_index))
+ continue;
+
+ if (plane_z_order != z_order) {
+ plane_z_order++;
+ continue;
+ }
+
+ if (hardware_plane->IsSupportedFormat(fourcc_format))
+ return true;
+ }
+
+ return false;
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698