From 7c96b4a99ad8ee00ef03301a4b1ddba3c59ef844 Mon Sep 17 00:00:00 2001 From: Ray Zhang Date: Wed, 7 Aug 2019 19:23:17 +0800 Subject: [PATCH] commonsys-intf: display: Update SmoMo interface Add version information in SmoMo interface to make sure the API of clients and SmoMo implementation are compatible. Also add buffer dequeue duration in SmoMo interface which is used to update SmoMo internal states. Change-Id: I65cf2cdb8afedb45d6576d4931e4d074b8b2f7f4 --- include/smomo_interface.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/include/smomo_interface.h b/include/smomo_interface.h index ac785750..ed13de54 100644 --- a/include/smomo_interface.h +++ b/include/smomo_interface.h @@ -39,6 +39,15 @@ namespace smomo { +#define SMOMO_LIBRARY_NAME "libsmomo.qti.so" +#define CREATE_SMOMO_INTERFACE_NAME "CreateSmomoInterface" +#define DESTROY_SMOMO_INTERFACE_NAME "DestroySmomoInterface" + +#define SMOMO_REVISION_MAJOR (1) +#define SMOMO_REVISION_MINOR (0) +#define SMOMO_VERSION_TAG ((uint16_t) ((SMOMO_REVISION_MAJOR << 8) \ + | SMOMO_REVISION_MINOR)) + typedef int64_t nsecs_t; /*! @brief This structure defines the layer stats required by SmoMo. @@ -47,7 +56,7 @@ typedef int64_t nsecs_t; */ struct SmomoLayerStats { std::string name; // layer full name - int32_t id; // layer ID + int32_t id; // layer ID }; /*! @brief This structure defines the buffer stats required by SmoMo. @@ -56,10 +65,11 @@ struct SmomoLayerStats { @sa SmomoIntf::ShouldPresentNow */ struct SmomoBufferStats { - int32_t id; // layer ID + int32_t id; // layer ID int32_t queued_frames; // queued frame count of this layer bool auto_timestamp; // whether timestamp was generated automatically nsecs_t timestamp; // layer buffer's timestamp + nsecs_t dequeue_latency; // last dequeue duration }; /*! @brief SmoMo interface implemented by SmoMo library. @@ -128,13 +138,16 @@ class SmomoIntf { @details This function is called to tell SmoMo what refresh rates this display can suport. - @param[in] refresh_rates The refresh rates list supported by the display + @param[in] refresh_rates The refresh rates supported by the display @return \link void \endlink */ virtual void SetDisplayRefreshRates(const std::vector &refresh_rates) = 0; }; +typedef bool (*CreateSmomoInterface)(uint16_t version, SmomoIntf **interface); +typedef void (*DestroySmomoInterface)(SmomoIntf *interface); + } // namespace smomo #endif // __SMOMO_INTERFACE_H__