sdm: Add property to enable destination scalar during bootup.
Add property sdm.mixer_resolution to configure the layer mixer resolution during boot up and switch back to requested mixer resolution when a layer with higher resolution disappears. Change-Id: I99f12d5f1a858daa41e41be1ff81833adbe3c651 CRs-Fixed: 1038976
This commit is contained in:
@@ -77,6 +77,7 @@ class Debug {
|
|||||||
static bool IsUbwcTiledFrameBuffer();
|
static bool IsUbwcTiledFrameBuffer();
|
||||||
static bool IsAVRDisabled();
|
static bool IsAVRDisabled();
|
||||||
static bool IsExtAnimDisabled();
|
static bool IsExtAnimDisabled();
|
||||||
|
static DisplayError GetMixerResolution(uint32_t *width, uint32_t *height);
|
||||||
static bool GetProperty(const char *property_name, char *value);
|
static bool GetProperty(const char *property_name, char *value);
|
||||||
static bool SetProperty(const char *property_name, const char *value);
|
static bool SetProperty(const char *property_name, const char *value);
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,16 @@ DisplayError DisplayBase::Init() {
|
|||||||
hw_intf_->GetDisplayAttributes(active_index, &display_attributes_);
|
hw_intf_->GetDisplayAttributes(active_index, &display_attributes_);
|
||||||
fb_config_ = display_attributes_;
|
fb_config_ = display_attributes_;
|
||||||
|
|
||||||
|
error = Debug::GetMixerResolution(&mixer_attributes_.width, &mixer_attributes_.height);
|
||||||
|
if (error != kErrorNone) {
|
||||||
error = hw_intf_->GetMixerAttributes(&mixer_attributes_);
|
error = hw_intf_->GetMixerAttributes(&mixer_attributes_);
|
||||||
if (error != kErrorNone) {
|
if (error != kErrorNone) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
req_mixer_width_ = mixer_attributes_.width;
|
||||||
|
req_mixer_height_ = mixer_attributes_.height;
|
||||||
|
|
||||||
// Override x_pixels and y_pixels of frame buffer with mixer width and height
|
// Override x_pixels and y_pixels of frame buffer with mixer width and height
|
||||||
fb_config_.x_pixels = mixer_attributes_.width;
|
fb_config_.x_pixels = mixer_attributes_.width;
|
||||||
@@ -893,7 +899,16 @@ DisplayError DisplayBase::ReconfigureDisplay() {
|
|||||||
|
|
||||||
DisplayError DisplayBase::SetMixerResolution(uint32_t width, uint32_t height) {
|
DisplayError DisplayBase::SetMixerResolution(uint32_t width, uint32_t height) {
|
||||||
lock_guard<recursive_mutex> obj(recursive_mutex_);
|
lock_guard<recursive_mutex> obj(recursive_mutex_);
|
||||||
return ReconfigureMixer(width, height);
|
|
||||||
|
DisplayError error = ReconfigureMixer(width, height);
|
||||||
|
if (error != kErrorNone) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
req_mixer_width_ = width;
|
||||||
|
req_mixer_height_ = height;
|
||||||
|
|
||||||
|
return kErrorNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayError DisplayBase::GetMixerResolution(uint32_t *width, uint32_t *height) {
|
DisplayError DisplayBase::GetMixerResolution(uint32_t *width, uint32_t *height) {
|
||||||
@@ -963,7 +978,7 @@ bool DisplayBase::NeedsMixerReconfiguration(LayerStack *layer_stack, uint32_t *n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_layer_area > fb_area) {
|
if (max_layer_area >= fb_area) {
|
||||||
Layer *layer = layers.at(max_area_layer_index);
|
Layer *layer = layers.at(max_area_layer_index);
|
||||||
|
|
||||||
uint32_t layer_width = UINT32(layer->src_rect.right - layer->src_rect.left);
|
uint32_t layer_width = UINT32(layer->src_rect.right - layer->src_rect.left);
|
||||||
@@ -986,9 +1001,9 @@ bool DisplayBase::NeedsMixerReconfiguration(LayerStack *layer_stack, uint32_t *n
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (fb_width != mixer_width || fb_height != mixer_height) {
|
if (req_mixer_width_ != mixer_width || req_mixer_height_ != mixer_height) {
|
||||||
*new_mixer_width = fb_width;
|
*new_mixer_width = req_mixer_width_;
|
||||||
*new_mixer_height = fb_height;
|
*new_mixer_height = req_mixer_height_;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ class DisplayBase : public DisplayInterface, DumpImpl {
|
|||||||
HWDisplayAttributes display_attributes_ = {};
|
HWDisplayAttributes display_attributes_ = {};
|
||||||
HWMixerAttributes mixer_attributes_ = {};
|
HWMixerAttributes mixer_attributes_ = {};
|
||||||
DisplayConfigVariableInfo fb_config_ = {};
|
DisplayConfigVariableInfo fb_config_ = {};
|
||||||
|
uint32_t req_mixer_width_ = 0;
|
||||||
|
uint32_t req_mixer_height_ = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Unused
|
// Unused
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <utils/debug.h>
|
#include <utils/debug.h>
|
||||||
#include <utils/constants.h>
|
#include <utils/constants.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace sdm {
|
namespace sdm {
|
||||||
|
|
||||||
@@ -161,6 +162,22 @@ bool Debug::IsExtAnimDisabled() {
|
|||||||
return (value == 1);
|
return (value == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DisplayError Debug::GetMixerResolution(uint32_t *width, uint32_t *height) {
|
||||||
|
char value[64];
|
||||||
|
|
||||||
|
DisplayError error = debug_.debug_handler_->GetProperty("sdm.mixer_resolution", value);
|
||||||
|
if (error !=kErrorNone) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string str(value);
|
||||||
|
|
||||||
|
*width = UINT32(stoi(str));
|
||||||
|
*height = UINT32(stoi(str.substr(str.find('x') + 1)));
|
||||||
|
|
||||||
|
return kErrorNone;
|
||||||
|
}
|
||||||
|
|
||||||
bool Debug::GetProperty(const char* property_name, char* value) {
|
bool Debug::GetProperty(const char* property_name, char* value) {
|
||||||
if (debug_.debug_handler_->GetProperty(property_name, value) != kErrorNone) {
|
if (debug_.debug_handler_->GetProperty(property_name, value) != kErrorNone) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user