drm_hwcomposer: Add fallback to client for layers flattening
Google recommends to delegate composition to GLES instead of HWC when
screen isn't updating to conserve power, as stated on page
https://source.android.com/devices/graphics/implement-hwc.
Current implementation of hwcomposer has flattening of layers if after
some time there were no updates of frames, but it uses writeback
connector. Not every device has a support of writeback feature, so
some sort of fallback should be provided.
It is possible to fallback to client composition in case if writeback
isn't available. This is used to reduce power consumption since
squashing layers into a single layer on GPU and then using that buffer
is more efficient than loading drm device.
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
diff --git a/include/drmhwctwo.h b/include/drmhwctwo.h
index 444c6ed..43f1fce 100644
--- a/include/drmhwctwo.h
+++ b/include/drmhwctwo.h
@@ -163,6 +163,9 @@
HWC2::Error RegisterVsyncCallback(hwc2_callback_data_t data,
hwc2_function_pointer_t func);
+ void RegisterRefreshCallback(hwc2_callback_data_t data,
+ hwc2_function_pointer_t func);
+
void ClearDisplay();
std::string Dump();