Add displayPresentTime to getFrameTimestamps
Makes HWC1 use displayRetireTime and HWC2 use
displayPresentTime.
Properly takes into account if HWC2On1Adapter is used.
Returns whether present or retire is supported via
eglQueryTimestampSupportedANDROID, which uses a
cached answer in Surface.
Surface::getFrameTimestamps returns with an error
if the caller requests an unsupported timestamp.
Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*
Change-Id: Ib91c2d05d7fb5cbf307e2dec1e20e79bcc19d90b
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
index a3ee798..bc36970 100644
--- a/include/gui/ISurfaceComposer.h
+++ b/include/gui/ISurfaceComposer.h
@@ -32,6 +32,8 @@
#include <gui/IGraphicBufferAlloc.h>
#include <gui/ISurfaceComposerClient.h>
+#include <vector>
+
namespace android {
// ----------------------------------------------------------------------------
@@ -43,6 +45,7 @@
class IDisplayEventConnection;
class IMemoryHeap;
class Rect;
+enum class SupportableFrameTimestamps;
/*
* This class defines the Binder IPC interface for accessing various
@@ -112,6 +115,11 @@
virtual bool authenticateSurfaceTexture(
const sp<IGraphicBufferProducer>& surface) const = 0;
+ /* Returns the frame timestamps supported by SurfaceFlinger.
+ */
+ virtual status_t getSupportedFrameTimestamps(
+ std::vector<SupportableFrameTimestamps>* outSupported) const = 0;
+
/* set display power mode. depending on the mode, it can either trigger
* screen on, off or low power mode and wait for it to complete.
* requires ACCESS_SURFACE_FLINGER permission.
@@ -193,6 +201,7 @@
GET_BUILT_IN_DISPLAY,
SET_TRANSACTION_STATE,
AUTHENTICATE_SURFACE,
+ GET_SUPPORTED_FRAME_TIMESTAMPS,
GET_DISPLAY_CONFIGS,
GET_ACTIVE_CONFIG,
SET_ACTIVE_CONFIG,