summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmanabhan Komanduru <pkomandu@codeaurora.org>2020-07-29 19:06:02 +0530
committerPadmanabhan Komanduru <pkomandu@codeaurora.org>2020-07-31 11:34:24 +0530
commit5d4e8793828728f50e744831be2f617e78012d9e (patch)
treed9350ff242da5d898f628756b08afc68f0a3fd55
parent4064803dc475116bb327c9ec6c8340d6b0221740 (diff)
sdm: remove pending state for POMS transition in Doze
Since Off->Doze transition is now asynchronous, avoid the delay of commit cycle for video->cmd switch request. Change-Id: I8ba84c425a913b0050d6049c08e8f383deab3fe0
-rw-r--r--sdm/libs/core/drm/hw_device_drm.h1
-rw-r--r--sdm/libs/core/drm/hw_peripheral_drm.cpp27
2 files changed, 12 insertions, 16 deletions
diff --git a/sdm/libs/core/drm/hw_device_drm.h b/sdm/libs/core/drm/hw_device_drm.h
index 5933347c..c4a330ac 100644
--- a/sdm/libs/core/drm/hw_device_drm.h
+++ b/sdm/libs/core/drm/hw_device_drm.h
@@ -231,7 +231,6 @@ class HWDeviceDRM : public HWInterface {
uint32_t cmd_mode_index_ = 0;
bool switch_mode_valid_ = false;
bool doze_poms_switch_done_ = false;
- bool pending_poms_switch_ = false;
bool active_ = false;
DRMPowerMode last_power_mode_ = DRMPowerMode::OFF;
bool pending_doze_ = false;
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp
index 85ec982f..6b3faeb5 100644
--- a/sdm/libs/core/drm/hw_peripheral_drm.cpp
+++ b/sdm/libs/core/drm/hw_peripheral_drm.cpp
@@ -105,7 +105,7 @@ DisplayError HWPeripheralDRM::SetDynamicDSIClock(uint64_t bit_clk_rate) {
return kErrorNotSupported;
}
- if (doze_poms_switch_done_ || pending_poms_switch_) {
+ if (doze_poms_switch_done_) {
return kErrorNotSupported;
}
@@ -124,7 +124,7 @@ DisplayError HWPeripheralDRM::GetDynamicDSIClock(uint64_t *bit_clk_rate) {
DisplayError HWPeripheralDRM::SetRefreshRate(uint32_t refresh_rate) {
- if (doze_poms_switch_done_ || pending_poms_switch_) {
+ if (doze_poms_switch_done_) {
// poms switch in progress
// Defer any refresh rate setting.
return kErrorNotSupported;
@@ -139,7 +139,7 @@ DisplayError HWPeripheralDRM::SetRefreshRate(uint32_t refresh_rate) {
}
DisplayError HWPeripheralDRM::SetDisplayMode(const HWDisplayMode hw_display_mode) {
- if (doze_poms_switch_done_ || pending_poms_switch_) {
+ if (doze_poms_switch_done_) {
return kErrorNotSupported;
}
@@ -182,13 +182,6 @@ DisplayError HWPeripheralDRM::Commit(HWLayers *hw_layers) {
synchronous_commit_ = false;
active_ = true;
- if (pending_poms_switch_) {
- HWDeviceDRM::SetDisplayMode(kModeCommand);
- hw_panel_info_.bitclk_rates = bitclk_rates_;
- doze_poms_switch_done_ = true;
- pending_poms_switch_ = false;
- }
-
idle_pc_state_ = sde_drm::DRMIdlePCState::NONE;
return error;
@@ -512,7 +505,6 @@ DisplayError HWPeripheralDRM::PowerOn(const HWQosData &qos_data, int *release_fe
}
idle_pc_state_ = sde_drm::DRMIdlePCState::NONE;
idle_pc_enabled_ = true;
- pending_poms_switch_ = false;
active_ = true;
return kErrorNone;
@@ -526,7 +518,6 @@ DisplayError HWPeripheralDRM::PowerOff(bool teardown) {
return err;
}
- pending_poms_switch_ = false;
active_ = false;
return kErrorNone;
@@ -535,6 +526,7 @@ DisplayError HWPeripheralDRM::PowerOff(bool teardown) {
DisplayError HWPeripheralDRM::Doze(const HWQosData &qos_data, int *release_fence) {
DTRACE_SCOPED();
+ bool pending_poms_switch = false;
if (!first_cycle_ && switch_mode_valid_ && !doze_poms_switch_done_ &&
(current_mode_index_ == video_mode_index_)) {
if (active_) {
@@ -542,7 +534,7 @@ DisplayError HWPeripheralDRM::Doze(const HWQosData &qos_data, int *release_fence
hw_panel_info_.bitclk_rates = bitclk_rates_;
doze_poms_switch_done_ = true;
} else {
- pending_poms_switch_ = true;
+ pending_poms_switch = true;
}
}
@@ -551,6 +543,12 @@ DisplayError HWPeripheralDRM::Doze(const HWQosData &qos_data, int *release_fence
return err;
}
+ if (pending_poms_switch) {
+ HWDeviceDRM::SetDisplayMode(kModeCommand);
+ hw_panel_info_.bitclk_rates = bitclk_rates_;
+ doze_poms_switch_done_ = true;
+ }
+
if (first_cycle_) {
active_ = true;
}
@@ -573,14 +571,13 @@ DisplayError HWPeripheralDRM::DozeSuspend(const HWQosData &qos_data, int *releas
return err;
}
- pending_poms_switch_ = false;
active_ = true;
return kErrorNone;
}
DisplayError HWPeripheralDRM::SetDisplayAttributes(uint32_t index) {
- if (doze_poms_switch_done_ || pending_poms_switch_) {
+ if (doze_poms_switch_done_) {
return kErrorNotSupported;
}