sdm: Do not allow decimation on UBWC framebuffer
MDP hardware cannot apply decimation on UBWC tiled framebuffer. CRs-Fixed: 867832 Change-Id: I6f2f37955ac9e2b4a6d7888c146930dd3863f385
This commit is contained in:
@@ -45,7 +45,7 @@ class ResourceInterface {
|
|||||||
virtual void Purge(Handle display_ctx) = 0;
|
virtual void Purge(Handle display_ctx) = 0;
|
||||||
virtual DisplayError SetMaxMixerStages(Handle display_ctx, uint32_t max_mixer_stages) = 0;
|
virtual DisplayError SetMaxMixerStages(Handle display_ctx, uint32_t max_mixer_stages) = 0;
|
||||||
virtual DisplayError ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
virtual DisplayError ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
||||||
bool rotate90) = 0;
|
bool rotate90, bool ubwc_tiled) = 0;
|
||||||
virtual DisplayError ValidateCursorConfig(Handle display_ctx, const Layer &layer,
|
virtual DisplayError ValidateCursorConfig(Handle display_ctx, const Layer &layer,
|
||||||
bool is_top) = 0;
|
bool is_top) = 0;
|
||||||
virtual DisplayError ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers,
|
virtual DisplayError ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers,
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class Debug {
|
|||||||
static bool IsRotatorUbwcDisabled();
|
static bool IsRotatorUbwcDisabled();
|
||||||
static bool IsRotatorSplitDisabled();
|
static bool IsRotatorSplitDisabled();
|
||||||
static bool IsScalarDisabled();
|
static bool IsScalarDisabled();
|
||||||
|
static bool IsUbwcTiledFrameBuffer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Debug();
|
Debug();
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ void CompManager::AppendDump(char *buffer, uint32_t length) {
|
|||||||
|
|
||||||
DisplayError CompManager::ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
DisplayError CompManager::ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
||||||
bool rotate90) {
|
bool rotate90) {
|
||||||
return resource_intf_->ValidateScaling(crop, dst, rotate90);
|
return resource_intf_->ValidateScaling(crop, dst, rotate90, Debug::IsUbwcTiledFrameBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayError CompManager::ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers,
|
DisplayError CompManager::ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers,
|
||||||
|
|||||||
@@ -554,7 +554,8 @@ DisplayError ResourceDefault::Config(DisplayResourceContext *display_resource_ct
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ValidateScaling(src_rect, dst_rect, false);
|
bool ubwc_tiled = IsUBWCFormat(layer.input_buffer->format);
|
||||||
|
error = ValidateScaling(src_rect, dst_rect, false, ubwc_tiled);
|
||||||
if (error != kErrorNone) {
|
if (error != kErrorNone) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -702,7 +703,7 @@ DisplayError ResourceDefault::ValidateDimensions(const LayerRect &crop, const La
|
|||||||
return kErrorNone;
|
return kErrorNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayError ResourceDefault::ValidatePipeParams(HWPipeInfo *pipe_info) {
|
DisplayError ResourceDefault::ValidatePipeParams(HWPipeInfo *pipe_info, bool ubwc_tiled) {
|
||||||
DisplayError error = kErrorNone;
|
DisplayError error = kErrorNone;
|
||||||
|
|
||||||
const LayerRect &src_rect = pipe_info->src_roi;
|
const LayerRect &src_rect = pipe_info->src_roi;
|
||||||
@@ -713,7 +714,7 @@ DisplayError ResourceDefault::ValidatePipeParams(HWPipeInfo *pipe_info) {
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ValidateScaling(src_rect, dst_rect, false);
|
error = ValidateScaling(src_rect, dst_rect, false, ubwc_tiled);
|
||||||
if (error != kErrorNone) {
|
if (error != kErrorNone) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -722,7 +723,7 @@ DisplayError ResourceDefault::ValidatePipeParams(HWPipeInfo *pipe_info) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisplayError ResourceDefault::ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
DisplayError ResourceDefault::ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
||||||
bool rotate90) {
|
bool rotate90, bool ubwc_tiled) {
|
||||||
DisplayError error = kErrorNone;
|
DisplayError error = kErrorNone;
|
||||||
|
|
||||||
float scale_x = 1.0f;
|
float scale_x = 1.0f;
|
||||||
@@ -733,7 +734,7 @@ DisplayError ResourceDefault::ValidateScaling(const LayerRect &crop, const Layer
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ValidateDownScaling(scale_x, scale_y);
|
error = ValidateDownScaling(scale_x, scale_y, ubwc_tiled);
|
||||||
if (error != kErrorNone) {
|
if (error != kErrorNone) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -746,11 +747,12 @@ DisplayError ResourceDefault::ValidateScaling(const LayerRect &crop, const Layer
|
|||||||
return kErrorNone;
|
return kErrorNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayError ResourceDefault::ValidateDownScaling(float scale_x, float scale_y) {
|
DisplayError ResourceDefault::ValidateDownScaling(float scale_x, float scale_y, bool ubwc_tiled) {
|
||||||
if ((UINT32(scale_x) > 1) || (UINT32(scale_y) > 1)) {
|
if ((UINT32(scale_x) > 1) || (UINT32(scale_y) > 1)) {
|
||||||
float max_scale_down = FLOAT(hw_res_info_.max_scale_down);
|
float max_scale_down = FLOAT(hw_res_info_.max_scale_down);
|
||||||
|
|
||||||
if (hw_res_info_.has_decimation) {
|
// MDP H/W cannot apply decimation on UBWC tiled framebuffer
|
||||||
|
if (!ubwc_tiled && hw_res_info_.has_decimation) {
|
||||||
max_scale_down *= FLOAT(kMaxDecimationDownScaleRatio);
|
max_scale_down *= FLOAT(kMaxDecimationDownScaleRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -867,7 +869,8 @@ DisplayError ResourceDefault::AlignPipeConfig(const Layer &layer, HWPipeInfo *le
|
|||||||
return kErrorNotSupported;
|
return kErrorNotSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ValidatePipeParams(left_pipe);
|
bool ubwc_tiled = IsUBWCFormat(layer.input_buffer->format);
|
||||||
|
error = ValidatePipeParams(left_pipe, ubwc_tiled);
|
||||||
if (error != kErrorNone) {
|
if (error != kErrorNone) {
|
||||||
goto PipeConfigExit;
|
goto PipeConfigExit;
|
||||||
}
|
}
|
||||||
@@ -876,7 +879,7 @@ DisplayError ResourceDefault::AlignPipeConfig(const Layer &layer, HWPipeInfo *le
|
|||||||
// Make sure the left and right ROI are conjunct
|
// Make sure the left and right ROI are conjunct
|
||||||
right_pipe->src_roi.left = left_pipe->src_roi.right;
|
right_pipe->src_roi.left = left_pipe->src_roi.right;
|
||||||
right_pipe->dst_roi.left = left_pipe->dst_roi.right;
|
right_pipe->dst_roi.left = left_pipe->dst_roi.right;
|
||||||
error = ValidatePipeParams(right_pipe);
|
error = ValidatePipeParams(right_pipe, ubwc_tiled);
|
||||||
}
|
}
|
||||||
|
|
||||||
PipeConfigExit:
|
PipeConfigExit:
|
||||||
@@ -915,4 +918,17 @@ DisplayError ResourceDefault::ValidateCursorPosition(Handle display_ctx, HWLayer
|
|||||||
return kErrorNotSupported;
|
return kErrorNotSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ResourceDefault::IsUBWCFormat(LayerBufferFormat format) {
|
||||||
|
switch (format) {
|
||||||
|
case kFormatRGBA8888Ubwc:
|
||||||
|
case kFormatRGBX8888Ubwc:
|
||||||
|
case kFormatRGB565Ubwc:
|
||||||
|
case kFormatYCbCr420SPVenusUbwc:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sdm
|
} // namespace sdm
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class ResourceDefault : public ResourceInterface {
|
|||||||
virtual void Purge(Handle display_ctx);
|
virtual void Purge(Handle display_ctx);
|
||||||
virtual DisplayError SetMaxMixerStages(Handle display_ctx, uint32_t max_mixer_stages);
|
virtual DisplayError SetMaxMixerStages(Handle display_ctx, uint32_t max_mixer_stages);
|
||||||
virtual DisplayError ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
virtual DisplayError ValidateScaling(const LayerRect &crop, const LayerRect &dst,
|
||||||
bool rotate90);
|
bool rotate90, bool ubwc_tiled);
|
||||||
DisplayError ValidateCursorConfig(Handle display_ctx, const Layer& layer, bool is_top);
|
DisplayError ValidateCursorConfig(Handle display_ctx, const Layer& layer, bool is_top);
|
||||||
DisplayError ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers, int x, int y);
|
DisplayError ValidateCursorPosition(Handle display_ctx, HWLayers *hw_layers, int x, int y);
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ class ResourceDefault : public ResourceInterface {
|
|||||||
bool CalculateCropRects(const LayerRect &scissor, LayerRect *crop, LayerRect *dst);
|
bool CalculateCropRects(const LayerRect &scissor, LayerRect *crop, LayerRect *dst);
|
||||||
DisplayError ValidateLayerDimensions(const Layer &layer);
|
DisplayError ValidateLayerDimensions(const Layer &layer);
|
||||||
DisplayError ValidateDimensions(const LayerRect &crop, const LayerRect &dst);
|
DisplayError ValidateDimensions(const LayerRect &crop, const LayerRect &dst);
|
||||||
DisplayError ValidatePipeParams(HWPipeInfo *pipe_info);
|
DisplayError ValidatePipeParams(HWPipeInfo *pipe_info, bool ubwc_tiled);
|
||||||
DisplayError ValidateDownScaling(float scale_x, float scale_y);
|
DisplayError ValidateDownScaling(float scale_x, float scale_y, bool ubwc_tiled);
|
||||||
DisplayError ValidateUpScaling(float scale_x, float scale_y);
|
DisplayError ValidateUpScaling(float scale_x, float scale_y);
|
||||||
DisplayError GetScaleFactor(const LayerRect &crop, const LayerRect &dst, float *scale_x,
|
DisplayError GetScaleFactor(const LayerRect &crop, const LayerRect &dst, float *scale_x,
|
||||||
float *scale_y);
|
float *scale_y);
|
||||||
@@ -141,6 +141,7 @@ class ResourceDefault : public ResourceInterface {
|
|||||||
DisplayError AlignPipeConfig(const Layer &layer, HWPipeInfo *left_pipe, HWPipeInfo *right_pipe);
|
DisplayError AlignPipeConfig(const Layer &layer, HWPipeInfo *left_pipe, HWPipeInfo *right_pipe);
|
||||||
void ResourceStateLog(void);
|
void ResourceStateLog(void);
|
||||||
DisplayError CalculateDecimation(float downscale, uint8_t *decimation);
|
DisplayError CalculateDecimation(float downscale, uint8_t *decimation);
|
||||||
|
bool IsUBWCFormat(LayerBufferFormat format);
|
||||||
|
|
||||||
Locker locker_;
|
Locker locker_;
|
||||||
HWResourceInfo hw_res_info_;
|
HWResourceInfo hw_res_info_;
|
||||||
|
|||||||
@@ -120,5 +120,18 @@ bool Debug::IsScalarDisabled() {
|
|||||||
return (value == 1);
|
return (value == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Debug::IsUbwcTiledFrameBuffer() {
|
||||||
|
int ubwc_disabled = 0;
|
||||||
|
int ubwc_framebuffer = 0;
|
||||||
|
|
||||||
|
debug_.debug_handler_->GetProperty("debug.gralloc.gfx_ubwc_disable", &ubwc_disabled);
|
||||||
|
|
||||||
|
if (!ubwc_disabled) {
|
||||||
|
debug_.debug_handler_->GetProperty("debug.gralloc.enable_fb_ubwc", &ubwc_framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ubwc_framebuffer == 1);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sdm
|
} // namespace sdm
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user