drm_hwcomposer: Remove HWC2 usage for Validate
Add HwcDisplay::ValidateStagedComposition to be called after
HwcDisplay::SetDisplayProperties to check whether any
layer composition types need to be updated.
Change-Id: I3a46e97b1c1721ac62de98fb89c73a1ffb0141fe
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcDisplay.h b/hwc2_device/HwcDisplay.h
index 19b4caa..9c113fd 100644
--- a/hwc2_device/HwcDisplay.h
+++ b/hwc2_device/HwcDisplay.h
@@ -89,6 +89,12 @@
// Get the HwcDisplayConfig, or nullptor if none.
auto GetConfig(hwc2_config_t config_id) const -> const HwcDisplayConfig *;
+ // To be called after SetDisplayProperties. Returns an empty vector if the
+ // requested layers have been validated, otherwise the vector describes
+ // the requested composition type changes.
+ using ChangedLayer = std::pair<hwc2_layer_t, HWC2::Composition>;
+ auto ValidateStagedComposition() -> std::vector<ChangedLayer>;
+
// HWC2 Hooks - these should not be used outside of the hwc2 device.
HWC2::Error AcceptDisplayChanges();
HWC2::Error CreateLayer(hwc2_layer_t *layer);