HWC: Update DisplayFrame of all layers properly in Dynamic FB
Use change in HWC_GEOMETRY_CHANGED flag appropriately to avoid
redundant and unintentional overwrites of DisplayFrame values,
which may result fall back to GPU.
Change-Id: Ifb0f8dc5d356c965b6e80644f32392c460fb1ae7
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 7499ba5..60a853a 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -85,20 +85,19 @@
void changeResolution(hwc_context_t *ctx, int xres_orig, int yres_orig) {
//Store original display resolution.
- ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres_orig = xres_orig;
- ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres_orig = yres_orig;
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres_new = xres_orig;
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres_new = yres_orig;
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].customFBSize = false;
-
char property[PROPERTY_VALUE_MAX] = {'\0'};
char *yptr = NULL;
if (property_get("debug.hwc.fbsize", property, NULL) > 0) {
yptr = strcasestr(property,"x");
- int xres = atoi(property);
- int yres = atoi(yptr + 1);
- if (isValidResolution(ctx,xres,yres) &&
- xres != xres_orig && yres != yres_orig) {
- ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres = xres;
- ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres = yres;
+ int xres_new = atoi(property);
+ int yres_new = atoi(yptr + 1);
+ if (isValidResolution(ctx,xres_new,yres_new) &&
+ xres_new != xres_orig && yres_new != yres_orig) {
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres_new = xres_new;
+ ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres_new = yres_new;
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].customFBSize = true;
}
}