sdm: Align system properties with customer documentation

Align the system properties to those in customer documentation
for consistency.

Change-Id: I0012b77cddf0c057f24503fa1611254a25537a27
This commit is contained in:
Tatenda Chipeperekwa
2015-05-27 15:42:49 -07:00
parent 4b800e8855
commit 299b030056
7 changed files with 58 additions and 26 deletions

View File

@@ -33,6 +33,7 @@
#include <stdint.h>
#include <core/sdm_types.h>
#include <core/debug_interface.h>
#include <core/display_interface.h>
#define DLOG(tag, method, format, ...) Debug::Get()->method(tag, __CLASS__ "::%s: " format, \
__FUNCTION__, ##__VA_ARGS__)
@@ -65,7 +66,8 @@ class Debug {
static bool IsRotatorDownScaleDisabled();
static bool IsDecimationDisabled();
static bool IsPartialUpdateEnabled();
static int GetMaxPipesPerMixer();
static int GetMaxPipesPerMixer(DisplayType display_type);
static bool IsVideoModeEnabled();
private:
Debug();

View File

@@ -93,7 +93,7 @@ DisplayError DisplayBase::Init() {
HWResourceInfo hw_resource_info = HWResourceInfo();
hw_info_intf_->GetHWResourceInfo(&hw_resource_info);
int max_mixer_stages = hw_resource_info.num_blending_stages;
int property_value = Debug::GetMaxPipesPerMixer();
int property_value = Debug::GetMaxPipesPerMixer(display_type_);
if (property_value >= 0) {
max_mixer_stages = MIN(UINT32(property_value), hw_resource_info.num_blending_stages);
}

View File

@@ -65,6 +65,14 @@ DisplayError DisplayPrimary::Init() {
hw_primary_intf_->SetIdleTimeoutMs(Debug::GetIdleTimeoutMs());
}
if (hw_panel_info_.mode == kModeCommand && Debug::IsVideoModeEnabled()) {
error = hw_primary_intf_->SetDisplayMode(kModeVideo);
if (error != kErrorNone) {
DLOGW("Retaining current display mode. Current = %d, Requested = %d", hw_panel_info_.mode,
kModeVideo);
}
}
return error;
}
@@ -198,7 +206,7 @@ DisplayError DisplayPrimary::SetDisplayMode(uint32_t mode) {
HWDisplayMode hw_display_mode = kModeDefault;
if (state_ != kStateOn) {
DLOGW("Invalid display state (%d). Panel must be on.", state_);
DLOGW("Invalid display state = %d. Panel must be on.", state_);
return kErrorNotSupported;
}
@@ -210,19 +218,19 @@ DisplayError DisplayPrimary::SetDisplayMode(uint32_t mode) {
hw_display_mode = kModeCommand;
break;
default:
DLOGW("Invalid panel mode parameters. Requested (%d)", mode);
DLOGW("Invalid panel mode parameters. Requested = %d", mode);
return kErrorParameters;
}
if (hw_display_mode == hw_panel_info_.mode) {
DLOGW("Same display mode requested. Current (%d) Requested (%d)", hw_panel_info_.mode,
DLOGW("Same display mode requested. Current = %d, Requested = %d", hw_panel_info_.mode,
hw_display_mode);
return kErrorNone;
}
error = hw_primary_intf_->SetDisplayMode(hw_display_mode);
if (error != kErrorNone) {
DLOGW("Retaining current display mode. Current (%d), Requested (%d)", hw_panel_info_.mode,
DLOGW("Retaining current display mode. Current = %d, Requested = %d", hw_panel_info_.mode,
hw_display_mode);
return error;
}

View File

@@ -58,9 +58,9 @@ int HWCDisplay::Init() {
return -EINVAL;
}
char property[PROPERTY_VALUE_MAX];
if (property_get("debug.egl.swapinterval", property, "1") > 0) {
if (atoi(property) == 0) {
int property_swap_interval = 1;
if (HWCDebugHandler::Get()->GetProperty("debug.egl.swapinterval", &property_swap_interval)) {
if (property_swap_interval == 0) {
swap_interval_zero_ = true;
}
}

View File

@@ -59,8 +59,9 @@ int HWCDisplayExternal::Create(CoreInterface *core_intf, hwc_procs_t const **hwc
hwc_display_external->GetPanelResolution(&external_width, &external_height);
if (property_get("sys.hwc.mdp_downscale_enabled", property, "false") &&
!strcmp(property, "true")) {
int downscale_enabled = 0;
HWCDebugHandler::Get()->GetProperty("sdm.debug.sde_downscale_enabled", &downscale_enabled);
if (downscale_enabled == 1) {
uint32_t primary_area = primary_width * primary_height;
uint32_t external_area = external_width * external_height;
@@ -150,11 +151,11 @@ void HWCDisplayExternal::ApplyScanAdjustment(hwc_rect_t *display_frame) {
}
// Read user defined width and height ratio
char property[PROPERTY_VALUE_MAX];
property_get("persist.sys.actionsafe.width", property, "0");
float width_ratio = FLOAT(atoi(property)) / 100.0f;
property_get("persist.sys.actionsafe.height", property, "0");
float height_ratio = FLOAT(atoi(property)) / 100.0f;
int width = 0, height = 0;
HWCDebugHandler::Get()->GetProperty("sdm.external_action_safe_width", &width);
float width_ratio = FLOAT(width) / 100.0f;
HWCDebugHandler::Get()->GetProperty("sdm.external_action_safe_height", &height);
float height_ratio = FLOAT(height) / 100.0f;
if (width_ratio == 0.0f || height_ratio == 0.0f) {
return;

View File

@@ -59,10 +59,12 @@ int HWCDisplayPrimary::Create(CoreInterface *core_intf, hwc_procs_t const **hwc_
}
hwc_display_primary->GetPanelResolution(&primary_width, &primary_height);
if (property_get("debug.hwc.fbsize", property, NULL) > 0) {
char *yptr = strcasestr(property, "x");
primary_width = atoi(property);
primary_height = atoi(yptr + 1);
int width = 0, height = 0;
HWCDebugHandler::Get()->GetProperty("sdm.fb_size_width", &width);
HWCDebugHandler::Get()->GetProperty("sdm.fb_size_height", &height);
if (width > 0 && height > 0) {
primary_width = width;
primary_height = height;
}
status = hwc_display_primary->SetFrameBufferResolution(primary_width, primary_height);

View File

@@ -40,7 +40,7 @@ Debug::Debug() : debug_handler_(&default_debug_handler_) {
uint32_t Debug::GetSimulationFlag() {
int value = 0;
debug_.debug_handler_->GetProperty("debug.hwc.simulate", &value);
debug_.debug_handler_->GetProperty("sdm.composition_simulation", &value);
return value;
}
@@ -54,14 +54,14 @@ uint32_t Debug::GetHDMIResolution() {
uint32_t Debug::GetIdleTimeoutMs() {
int value = IDLE_TIMEOUT_DEFAULT_MS;
debug_.debug_handler_->GetProperty("debug.mdpcomp.idletime", &value);
debug_.debug_handler_->GetProperty("sdm.idle_time", &value);
return value;
}
bool Debug::IsRotatorDownScaleDisabled() {
int value = 0;
debug_.debug_handler_->GetProperty("sdm.disable_rotator_downscaling", &value);
debug_.debug_handler_->GetProperty("sdm.debug.rotator_downscale", &value);
return (value == 1);
}
@@ -75,17 +75,36 @@ bool Debug::IsDecimationDisabled() {
bool Debug::IsPartialUpdateEnabled() {
int value = 0;
debug_.debug_handler_->GetProperty("sdm.hwc.partial_update", &value);
debug_.debug_handler_->GetProperty("sdm.partial_update", &value);
return (value == 1);
}
int Debug::GetMaxPipesPerMixer() {
int Debug::GetMaxPipesPerMixer(DisplayType display_type) {
int value = -1;
debug_.debug_handler_->GetProperty("persist.hwc.mdpcomp.maxpermixer", &value);
switch (display_type) {
case kPrimary:
debug_.debug_handler_->GetProperty("sdm.primary.mixer_stages", &value);
break;
case kHDMI:
debug_.debug_handler_->GetProperty("sdm.external.mixer_stages", &value);
break;
case kVirtual:
debug_.debug_handler_->GetProperty("sdm.virtual.mixer_stages", &value);
break;
default:
break;
}
return value;
}
bool Debug::IsVideoModeEnabled() {
int value = 0;
debug_.debug_handler_->GetProperty("sdm.video_mode_panel", &value);
return (value == 1);
}
} // namespace sdm