drm_hwcomposer: Deprecate usage of HWC2 setActiveConfig*
Setting a config is currently implemented by queuing a config change to
take effect at the next vsync. Add HwcDisplay::QueueConfig to support
this functionality, which is implemented using the HWC2
setActiveConfigWithConstraints and setActiveConfigInternal as a
reference.
Implement HWC3 setActiveConfig and setActiveConfigWithConstraints in
terms of HwcDisplay::QueueConfig.
Change-Id: I127f569fe889e7370de1987137345b5b75ff04b6
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcDisplay.h b/hwc2_device/HwcDisplay.h
index a315540..91e5df7 100644
--- a/hwc2_device/HwcDisplay.h
+++ b/hwc2_device/HwcDisplay.h
@@ -41,6 +41,13 @@
// NOLINTNEXTLINE
class HwcDisplay {
public:
+ enum ConfigError {
+ kNone,
+ kBadConfig,
+ kSeamlessNotAllowed,
+ kSeamlessNotPossible
+ };
+
HwcDisplay(hwc2_display_t handle, HWC2::DisplayType type, DrmHwc *hwc);
HwcDisplay(const HwcDisplay &) = delete;
~HwcDisplay();
@@ -60,12 +67,16 @@
}
// Get the config representing the mode that has been committed to KMS.
- const HwcDisplayConfig *GetCurrentConfig() const;
+ auto GetCurrentConfig() const -> const HwcDisplayConfig *;
// Get the config that was last requested through SetActiveConfig and similar
// functions. This may differ from the GetCurrentConfig if the config change
// is queued up to take effect in the future.
- const HwcDisplayConfig *GetLastRequestedConfig() const;
+ auto GetLastRequestedConfig() const -> const HwcDisplayConfig *;
+
+ // Queue a configuration change to take effect in the future.
+ auto QueueConfig(hwc2_config_t config, int64_t desired_time, bool seamless,
+ QueuedConfigTiming *out_timing) -> ConfigError;
// HWC2 Hooks - these should not be used outside of the hwc2 device.
HWC2::Error AcceptDisplayChanges();