drm_hwcomposer: Check the composition before sending to frame worker
Before we send a composition to the frame worker and display, run it
through the kernel to test whether it can be put on hardware. If the
kernel rejects the composition, use the squashing code to flatten it
on one layer and send the result to the frame worker.
Bug: 25379136
Test: Tested on smaug, frames were squashed, fun was had
Change-Id: Icac3c034d0eb4c0becbdc0f8ace1de75ab8ae2b8
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmdisplaycompositor.h b/drmdisplaycompositor.h
index 975de63..541d807 100644
--- a/drmdisplaycompositor.h
+++ b/drmdisplaycompositor.h
@@ -32,7 +32,9 @@
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
-#define DRM_DISPLAY_BUFFERS 2
+// One for the front, one for the back, and one for cases where we need to
+// squash a frame that the hw can't display with hw overlays.
+#define DRM_DISPLAY_BUFFERS 3
namespace android {