hwc/overlay: Force pipe config if list geometry changes
Force pipes of a display, whose geometry has changed, to pass
configuration arguments using MSMFB_SET_IOCTL. This helps the driver
make additive bandwidth calculations and reject the frame if the
requirements go beyond what the hardware can support.
This change still preserves the optmization to avoid ioctl calls, in
cases where pipe params are the same but makes an exception when
list geometry changes.
Change-Id: I909d35b2a8c33059b34b65943ccbbc08650461db
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 4b0ff9a..5286c97 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -134,6 +134,13 @@
ctx->layerProp[dpy] = new LayerProp[numAppLayers];
}
+static void handleGeomChange(hwc_context_t *ctx, int dpy,
+ hwc_display_contents_1_t *list) {
+ if(list->flags & HWC_GEOMETRY_CHANGED) {
+ ctx->mOverlay->forceSet(dpy);
+ }
+}
+
static int display_commit(hwc_context_t *ctx, int dpy) {
struct mdp_display_commit commit_info;
memset(&commit_info, 0, sizeof(struct mdp_display_commit));
@@ -153,6 +160,7 @@
if (LIKELY(list && list->numHwLayers > 1) &&
ctx->dpyAttr[dpy].isActive) {
reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
+ handleGeomChange(ctx, dpy, list);
uint32_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
if(fbLayer->handle) {
@@ -179,6 +187,7 @@
ctx->dpyAttr[dpy].isActive &&
ctx->dpyAttr[dpy].connected) {
reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
+ handleGeomChange(ctx, dpy, list);
uint32_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
if(!ctx->dpyAttr[dpy].isPause) {
@@ -220,6 +229,7 @@
ctx->dpyAttr[dpy].isActive &&
ctx->dpyAttr[dpy].connected) {
reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
+ handleGeomChange(ctx, dpy, list);
uint32_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
if(!ctx->dpyAttr[dpy].isPause) {