hwc: fix for not ignoring framebuffer
If the FB is not used, because all the app layers are overlays, then set the
flag to have the driver not fetch from the FB pipe.
Bug: 7183992
Change-Id: I96ecc1610ac052e8512158d189b0614ecf82d139
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 12c880a..620506d 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -292,10 +292,11 @@
VideoOverlay::draw(ctx, list, HWC_DISPLAY_EXTERNAL);
private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
- if(fbLayer->compositionType == HWC_FRAMEBUFFER_TARGET && hnd) {
+ if(fbLayer->compositionType == HWC_FRAMEBUFFER_TARGET &&
+ !(fbLayer->flags & HWC_SKIP_LAYER) && hnd) {
UIMirrorOverlay::draw(ctx, fbLayer);
- ctx->mExtDisplay->post();
}
+ ctx->mExtDisplay->post();
}
return 0;
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index d27c509..0307e10 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -177,7 +177,6 @@
Callbacks priv_proc;
- int numHwLayers;
int overlayInUse[HWC_NUM_DISPLAY_TYPES];
//Framebuffer device
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index 5791ffd..cb5cf1e 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -131,7 +131,7 @@
}
ovutils::eIsFg isFgFlag = ovutils::IS_FG_OFF;
- if (ctx->numHwLayers == 1) {
+ if (ctx->listStats[HWC_DISPLAY_PRIMARY].numAppLayers == 1) {
isFgFlag = ovutils::IS_FG_SET;
}
@@ -203,7 +203,7 @@
}
ovutils::eIsFg isFgFlag = ovutils::IS_FG_OFF;
- if (ctx->numHwLayers == 1) {
+ if (ctx->listStats[HWC_DISPLAY_EXTERNAL].numAppLayers == 1) {
isFgFlag = ovutils::IS_FG_SET;
}