sdm: Set surfaceDamage numRects for solid-fill layer
1. Set surfaceDamage numRects while creating a solid-fill HWC layer.
2. Fix the region count update in AssignLayerRegionsAddress api.
3. SetRect should be called within visible and dirty region counts.
CRs-Fixed: 907823
Change-Id: I8a4ba6a99c851864597904df7e1b685ca30043a1
diff --git a/sdm/libs/hwc/hwc_color_manager.cpp b/sdm/libs/hwc/hwc_color_manager.cpp
index 463014e..891d036 100644
--- a/sdm/libs/hwc/hwc_color_manager.cpp
+++ b/sdm/libs/hwc/hwc_color_manager.cpp
@@ -290,6 +290,7 @@
layer.displayFrame = solid_fill_rect;
layer.visibleRegionScreen.numRects = 1;
layer.visibleRegionScreen.rects = &layer.displayFrame;
+ layer.surfaceDamage.numRects = 0;
return ret;
}
diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp
index 3245eb6..30577a8 100644
--- a/sdm/libs/hwc/hwc_display.cpp
+++ b/sdm/libs/hwc/hwc_display.cpp
@@ -47,12 +47,12 @@
uint8_t **base_address) {
if (rect_count) {
region->rect = reinterpret_cast<LayerRect *>(*base_address);
- region->count = rect_count;
- for (size_t i = 0; i < rect_count; i++) {
+ for (uint32_t i = 0; i < rect_count; i++) {
region->rect[i] = LayerRect();
}
*base_address += rect_count * sizeof(LayerRect);
}
+ region->count = rect_count;
}
static void ApplyDeInterlaceAdjustment(Layer *layer) {
@@ -498,10 +498,10 @@
SetRect(hwc_layer.sourceCropf, &layer.src_rect);
ApplyDeInterlaceAdjustment(&layer);
- for (size_t j = 0; j < hwc_layer.visibleRegionScreen.numRects; j++) {
+ for (uint32_t j = 0; j < layer.visible_regions.count; j++) {
SetRect(hwc_layer.visibleRegionScreen.rects[j], &layer.visible_regions.rect[j]);
}
- for (size_t j = 0; j < hwc_layer.surfaceDamage.numRects; j++) {
+ for (uint32_t j = 0; j < layer.dirty_regions.count; j++) {
SetRect(hwc_layer.surfaceDamage.rects[j], &layer.dirty_regions.rect[j]);
}
SetComposition(hwc_layer.compositionType, &layer.composition);