From 800fff475c85cf3fa26222f62780ae23e8f8b740 Mon Sep 17 00:00:00 2001 From: ljh Date: Mon, 26 May 2025 15:42:50 +0000 Subject: [PATCH 1/3] Add the low power player HDI interface Signed-off-by: ljh --- .../include/display_vdi_adapter_interface.h | 17 +++- display/composer/v1_2/DisplayComposerType.idl | 14 +++ display/composer/v1_2/IDisplayComposer.idl | 98 +++++++++++++++++++ .../v1_2/hdi_impl/display_composer_hdi_impl.h | 31 ++++++ .../include/idisplay_composer_interface.h | 13 +++ 5 files changed, 171 insertions(+), 2 deletions(-) diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index d34b5812..723a773a 100644 --- a/display/composer/common/include/display_vdi_adapter_interface.h +++ b/display/composer/common/include/display_vdi_adapter_interface.h @@ -20,6 +20,7 @@ #include #include "base/buffer_handle.h" #include "v1_0/include/idisplay_composer_interface.h" +#include "v1_2/include/idisplay_composer_interface.h" #include "v1_0/display_composer_type.h" #include "v1_2/display_composer_type.h" #include "v1_1/imode_callback.h" @@ -97,6 +98,13 @@ struct DisplayComposerVdiAdapter { int32_t (*ClearDisplayClientBuffer)(uint32_t devId); int32_t (*ClearLayerBuffer)(uint32_t devId, uint32_t layerId); int32_t (*GetDisplayIdentificationData)(uint32_t devId, uint8_t& portId, std::vector& edidData); + int32_t (*GetSupportLayerType)(uint32_t devId, std::vector& types); + int32_t (*SetTunnelLayerId)(uint32_t devId, uint32_t layerId, uint64_t tunnelId); + int32_t (*SetTunnelLayerProperty)(uint32_t devId, uint32_t layerId, uint32_t property); + int32_t (*SetTunnelLayerPosition)(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y); + int32_t (*SetTunnelLayerBuffer)(uint32_t devId, uint64_t tunnelId, + uint64_t bufferAddr, int32_t acquireFence); + int32_t (*CommitTunnelLayer)(uint32_t devId, uint64_t tunnelId, int32_t& releaseFence); }; using LoadVdiImplFunc = int32_t (*)(); @@ -165,8 +173,13 @@ using FastPresentFunc = int32_t (*)(uint32_t devId, const PresentParam& param, using ClearDisplayClientBufferFunc = int32_t (*)(uint32_t devId); using ClearLayerBufferFunc = int32_t (*)(uint32_t devId, uint32_t layerId); using GetDisplayIdentificationDataFunc = int32_t (*)(uint32_t devId, uint8_t& portId, std::vector& edidData); - - +using GetSupportLayerTypeFunc = int32_t (*)(uint32_t devId, std::vector& types); +using SetTunnelLayerIdFunc = int32_t (*)(uint32_t devId, uint32_t layerId, uint64_t tunnelId); +using SetTunnelLayerPropertyFunc = int32_t (*)(uint32_t devId, uint32_t layerId, uint32_t property); +using SetTunnelLayerPositionFunc = int32_t (*)(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y); +using SetTunnelLayerBufferFunc = int32_t (*)(uint32_t devId, uint64_t tunnelId, + uint64_t bufferAddr, int32_t acquireFence); +using CommitTunnelLayerFunc = int32_t (*)(uint32_t devId, uint64_t tunnelId, int32_t& releaseFence); } // namespace Composer } // namespace Display } // namespace HDI diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index 0115dc98..c352b86d 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -118,3 +118,17 @@ struct PresentParam { unsigned int imageDimension; /**< low 16 bits: image width, high 16 bits: image height */ int reserve; /**< reserve */ }; + +/** + * @brief Enumerates the property id of tunnel layer. + * + * @since 5.0 + * @version 1.0 + */ +enum TunnelLayerProperty { + TUNNEL_PROP_INVALID = 0, /**< invalid tunnel layer property */ + TUNNEL_PROP_POSTION = (1 << 0), /**< update layer position by tunnel */ + TUNNEL_PROP_BUFFER_ADDR = (1 << 1), /**< update layer buffer address by tunnel */ + TUNNEL_PROP_CLIENT_COMMIT = (1 << 2), /**< tunnel layer update by client */ + TUNNEL_PROP_DEVICE_COMMIT = (1 << 3), /**< tunnel layer update by device */ +}; \ No newline at end of file diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 73b26198..385151db 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -135,4 +135,102 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @version 1.0 */ GetDisplayIdentificationData([in] unsigned int devId, [out] unsigned char portId, [out] unsigned char[] edidData); + + /** + * @brief returns the list of supported layer types + * + * @param devId Indicates the ID of the display device. + * @param types Indicates the supported layer types + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + GetSupportLayerType([in] unsigned int devId, [out] struct LayerType[] types); + + /** + * @brief returns the list of supported layer types + * + * @param devId Indicates the ID of the display device. + * @param types Indicates the supported layer types + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + GetSupportLayerType([in] unsigned int devId, [out] struct LayerType[] types); + + /** + * @brief Set TunnelId for the tunnel layer + * + * @param devId Indicates the ID of the display device. + * @param layerId Indicates the ID of the layer to be operated on. + * @param tunnelId Indicates the ID of the tunnel layer. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + SetTunnelLayerId([in] unsigned int devId, [in] unsigned int layerId, [in] unsigned long tunnelId); + + /** + * @brief Set Tunnel property for the tunnel layer + * + * @param devId Indicates the ID of the display device. + * @param layerId Indicates the ID of the layer to be operated on. + * @param property Indicates the property of the tunnel layer. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + SetTunnelLayerProperty([in] unsigned int devId, [in] unsigned int layerId, [in] unsigned int property); + + /** + * @brief Set position parameter for for the tunnel layer. + * + * @param devId Indicates the ID of the display device. + * @param tunnelId Indicates the ID of the tunnel layer. + * @param x Indicates coordinate. + * @param y Indicates coordinate. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + SetTunnelLayerPosition([in] unsigned int devId, [in] unsigned long tunnelId, [in] int x, [in] int y); + + /** + * @brief Set layer buffer address for the tunnel layer. + * + * @param devId Indicates the ID of the display device. + * @param tunnelId Indicates the ID of the tunnel layer. + * @param bufferAddr Indicates buffer address. + * @param acquireFence Indicates buffer fence. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + SetTunnelLayerBuffer([in] unsigned int devId, [in] unsigned long tunnelId, [in] unsigned long bufferAddr, [in] int acquireFence); + + /** + * @brief slave tunnel commit tunnel layer + * + * @param devId Indicates the ID of the display device. + * @param tunnelId Indicates the ID of the layer to be operated on. + * @param releaseFence Indicates release buffer fence. + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 5.0 + * @version 1.0 + */ + CommitTunnelLayer([in] unsigned int devId, [in] unsigned long tunnelId, [out] int releaseFence); } diff --git a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h index 2b0042e4..d2f1d6d1 100644 --- a/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h +++ b/display/composer/v1_2/hdi_impl/display_composer_hdi_impl.h @@ -137,6 +137,37 @@ public: return ret; } + virtual int32_t GetSupportLayerType(uint32_t devId, std::vector& types) override + { + return ToDispErrCode(hdi_v1_2_->GetSupportLayerType(devId, types)); + } + + virtual int32_t SetTunnelLayerId(uint32_t devId, uint32_t layerId, uint64_t tunnelId) override + { + return ToDispErrCode(hdi_v1_2_->SetTunnelLayerId(devId, layerId, tunnelId)); + } + + virtual int32_t SetTunnelLayerProperty(uint32_t devId, uint32_t layerId, uint32_t property) override + { + return ToDispErrCode(hdi_v1_2_->SetTunnelLayerProperty(devId, layerId, property)); + } + + virtual int32_t SetTunnelLayerPosition(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y) override + { + return ToDispErrCode(hdi_v1_2_->SetTunnelLayerPosition(devId, tunnelId, x, y)); + } + + virtual int32_t SetTunnelLayerBuffer(uint32_t devId, uint64_t tunnelId, + uint64_t bufferAddr, int32_t acquireFence) override + { + return ToDispErrCode(hdi_v1_2_->SetTunnelLayerBuffer(devId, tunnelId, bufferAddr, acquireFence)); + } + + virtual int32_t CommitTunnelLayer(uint32_t devId, uint64_t tunnelId, int32_t& releaseFence) override + { + return ToDispErrCode(hdi_v1_2_->CommitTunnelLayer(devId, tunnelId, releaseFence)); + } + virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) override { COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 77ef2d21..5ebb0a67 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -84,6 +84,19 @@ public: virtual int32_t SetDisplayPerFrameParameterSmq(uint32_t devId, const std::string& key, const std::vector& value) = 0; + + virtual int32_t GetSupportLayerType(uint32_t devId, std::vector& types) = 0; + + virtual int32_t SetTunnelLayerId(uint32_t devId, uint32_t layerId, uint64_t tunnelId) = 0; + + virtual int32_t SetTunnelLayerProperty(uint32_t devId, uint32_t layerId, uint32_t property) = 0; + + virtual int32_t SetTunnelLayerPosition(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y) = 0; + + virtual int32_t SetTunnelLayerBuffer(uint32_t devId, uint64_t tunnelId, + uint64_t bufferAddr, int32_t acquireFence) = 0; + + virtual int32_t CommitTunnelLayer(uint32_t devId, uint64_t tunnelId, int32_t& releaseFence) = 0; }; } // V1_2 } // Composer -- Gitee From 1d9040c021129c86efa2101bca9a0c343c206cc1 Mon Sep 17 00:00:00 2001 From: ljh Date: Mon, 26 May 2025 15:55:47 +0000 Subject: [PATCH 2/3] Add the low power player HDI interface Signed-off-by: ljh --- display/composer/v1_2/DisplayComposerType.idl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/display/composer/v1_2/DisplayComposerType.idl b/display/composer/v1_2/DisplayComposerType.idl index c352b86d..94e1dfed 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -131,4 +131,12 @@ enum TunnelLayerProperty { TUNNEL_PROP_BUFFER_ADDR = (1 << 1), /**< update layer buffer address by tunnel */ TUNNEL_PROP_CLIENT_COMMIT = (1 << 2), /**< tunnel layer update by client */ TUNNEL_PROP_DEVICE_COMMIT = (1 << 3), /**< tunnel layer update by device */ +}; + +/** + * @brief Enumerates layer types. + * + */ +enum LayerType : ohos.hdi.display.composer.v1_0.LayerType { + LAYER_TYPE_TUNNEL, /**< Tunnel layer */ }; \ No newline at end of file -- Gitee From 4996834942dc707e7db5c907ea46f97b950fe890 Mon Sep 17 00:00:00 2001 From: ljh Date: Mon, 26 May 2025 18:55:24 +0000 Subject: [PATCH 3/3] Add the low power player HDI interface Signed-off-by: ljh --- display/composer/v1_2/IDisplayComposer.idl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 385151db..36ffb77b 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -136,19 +136,6 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos */ GetDisplayIdentificationData([in] unsigned int devId, [out] unsigned char portId, [out] unsigned char[] edidData); - /** - * @brief returns the list of supported layer types - * - * @param devId Indicates the ID of the display device. - * @param types Indicates the supported layer types - * - * @return Returns 0 if the operation is successful; returns an error code defined - * in {@link DispErrCode} otherwise. - * @since 5.0 - * @version 1.0 - */ - GetSupportLayerType([in] unsigned int devId, [out] struct LayerType[] types); - /** * @brief returns the list of supported layer types * -- Gitee