Skip to content

Commit

Permalink
hwc2: add support to enforce pipe split for built-in display
Browse files Browse the repository at this point in the history
Add support to enforce pipe split when there is only one
built-in display connected when the panel fps is above 60.
This is needed to keep MDP clock down for high fps
use-cases.

Change-Id: Ie8cdd8eb45df98684d04ac8c96552fa33484d93b
CRs-Fixed: 2512607
  • Loading branch information
xiaomi-sm7435 authored and Ravikanth Tuniki committed Oct 4, 2019
1 parent d821aa9 commit 57278ca
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/display_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#define QDCM_DISABLE_FACTORY_MODE_PROP DISPLAY_PROP("qdcm.disable_factory_mode")
#define ENABLE_ASYNC_POWERMODE DISPLAY_PROP("enable_async_powermode")
#define ENABLE_GPU_TONEMAPPER_PROP DISPLAY_PROP("enable_gpu_tonemapper")
#define ENABLE_FORCE_SPLIT DISPLAY_PROP("enable_force_split")

// Add all vendor.display properties above

Expand Down
1 change: 1 addition & 0 deletions sdm/include/private/resource_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ResourceInterface {
kCmdDisableRotatorOneFrame,
kCmdSetDisplayState,
kCmdUpdateSyncHandle,
kCmdCheckEnforceSplit,
kCmdMax,
};

Expand Down
18 changes: 18 additions & 0 deletions sdm/libs/core/comp_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ DisplayError CompManager::UnregisterDisplay(Handle display_ctx) {
return kErrorNone;
}

DisplayError CompManager::CheckEnforceSplit(Handle comp_handle,
uint32_t new_refresh_rate) {
SCOPE_LOCK(locker_);
DisplayError error = kErrorNone;
DisplayCompositionContext *display_comp_ctx =
reinterpret_cast<DisplayCompositionContext *>(comp_handle);

error = resource_intf_->Perform(ResourceInterface::kCmdCheckEnforceSplit,
display_comp_ctx->display_resource_ctx, new_refresh_rate);
return error;
}

DisplayError CompManager::ReconfigureDisplay(Handle comp_handle,
const HWDisplayAttributes &display_attributes,
const HWPanelInfo &hw_panel_info,
Expand All @@ -211,6 +223,12 @@ DisplayError CompManager::ReconfigureDisplay(Handle comp_handle,
return error;
}

error = resource_intf_->Perform(ResourceInterface::kCmdCheckEnforceSplit,
display_comp_ctx->display_resource_ctx, display_attributes.fps);
if (error != kErrorNone) {
return error;
}

if (display_comp_ctx->strategy) {
error = display_comp_ctx->strategy->Reconfigure(hw_panel_info, display_attributes,
mixer_attributes, fb_config);
Expand Down
1 change: 1 addition & 0 deletions sdm/libs/core/comp_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class CompManager {
bool CanSkipValidate(Handle display_ctx);
bool IsSafeMode() { return safe_mode_; }
void GenerateROI(Handle display_ctx, HWLayers *hw_layers);
DisplayError CheckEnforceSplit(Handle comp_handle, uint32_t new_refresh_rate);

private:
static const int kMaxThermalLevel = 3;
Expand Down
5 changes: 5 additions & 0 deletions sdm/libs/core/display_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ DisplayError DisplayBuiltIn::SetRefreshRate(uint32_t refresh_rate, bool final_ra
handle_idle_timeout_ = false;
return error;
}

error = comp_manager_->CheckEnforceSplit(display_comp_ctx_, refresh_rate);
if (error != kErrorNone) {
return error;
}
}

// On success, set current refresh rate to new refresh rate
Expand Down

0 comments on commit 57278ca

Please sign in to comment.