sdm: Add split rectangle support for split rotation.
1. Add support to split rectangle vertically and horizontally. 2. Add debug property to enable/disable split rotation. Change-Id: I4070e7e754c2a3a3a9ca4f4eab91037f7f9c88b7
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
d5eab0c7b3
commit
345081196a
@@ -69,6 +69,7 @@ class Debug {
|
||||
static int GetMaxPipesPerMixer(DisplayType display_type);
|
||||
static bool IsVideoModeEnabled();
|
||||
static bool IsRotatorUbwcDisabled();
|
||||
static bool IsRotatorSplitDisabled();
|
||||
|
||||
private:
|
||||
Debug();
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace sdm {
|
||||
LayerRect Intersection(const LayerRect &rect1, const LayerRect &rect2);
|
||||
LayerRect Subtract(const LayerRect &rect1, const LayerRect &rect2);
|
||||
LayerRect Reposition(const LayerRect &rect1, const int &x_offset, const int &y_offset);
|
||||
void SplitLeftRight(const LayerRect &in_rect, uint32_t split_count, uint32_t align_x,
|
||||
LayerRect *out_rects);
|
||||
void SplitTopBottom(const LayerRect &in_rect, uint32_t split_count, uint32_t align_y,
|
||||
LayerRect *out_rects);
|
||||
} // namespace sdm
|
||||
|
||||
#endif // __RECT_H__
|
||||
|
||||
@@ -113,5 +113,12 @@ bool Debug::IsRotatorUbwcDisabled() {
|
||||
return (value == 1);
|
||||
}
|
||||
|
||||
bool Debug::IsRotatorSplitDisabled() {
|
||||
int value = 0;
|
||||
debug_.debug_handler_->GetProperty("sdm.debug.disable_rotator_split", &value);
|
||||
|
||||
return (value == 1);
|
||||
}
|
||||
|
||||
} // namespace sdm
|
||||
|
||||
|
||||
@@ -138,5 +138,43 @@ LayerRect Union(const LayerRect &rect1, const LayerRect &rect2) {
|
||||
return res;
|
||||
}
|
||||
|
||||
void SplitLeftRight(const LayerRect &in_rect, uint32_t split_count, uint32_t align_x,
|
||||
LayerRect *out_rects) {
|
||||
LayerRect rect_temp = in_rect;
|
||||
|
||||
uint32_t split_width = UINT32(rect_temp.right - rect_temp.left) / split_count;
|
||||
|
||||
for (uint32_t count = 0; count < split_count; count++) {
|
||||
float aligned_right = rect_temp.left + FLOAT(CeilToMultipleOf(split_width, align_x));
|
||||
out_rects[count].left = rect_temp.left;
|
||||
out_rects[count].right = MIN(rect_temp.right, aligned_right);
|
||||
out_rects[count].top = rect_temp.top;
|
||||
out_rects[count].bottom = rect_temp.bottom;
|
||||
|
||||
rect_temp.left = out_rects[count].right;
|
||||
|
||||
Log(kTagRotator, "SplitLeftRight", out_rects[count]);
|
||||
}
|
||||
}
|
||||
|
||||
void SplitTopBottom(const LayerRect &in_rect, uint32_t split_count, uint32_t align_y,
|
||||
LayerRect *out_rects) {
|
||||
LayerRect rect_temp = in_rect;
|
||||
|
||||
uint32_t split_height = UINT32(rect_temp.bottom - rect_temp.top) / split_count;
|
||||
|
||||
for (uint32_t count = 0; count < split_count; count++) {
|
||||
float aligned_bottom = rect_temp.top + FLOAT(CeilToMultipleOf(split_height, align_y));
|
||||
out_rects[count].top = rect_temp.top;
|
||||
out_rects[count].bottom = MIN(rect_temp.bottom, aligned_bottom);
|
||||
out_rects[count].left = rect_temp.left;
|
||||
out_rects[count].right = rect_temp.right;
|
||||
|
||||
rect_temp.top = out_rects[count].bottom;
|
||||
|
||||
Log(kTagRotator, "SplitTopBottom", out_rects[count]);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sdm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user