diff --git a/display/composer/common/include/display_vdi_adapter_interface.h b/display/composer/common/include/display_vdi_adapter_interface.h index d34b5812362ab82303263dd8bbcec6ca9ed5337f..723a773a45c442327f896a764e4c224dd94d9cb7 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 0115dc988875db86cce7fe9480c1ac0dcf0d7120..94e1dfed16dedbc6a0eb029960c9abcf1c736b44 100644 --- a/display/composer/v1_2/DisplayComposerType.idl +++ b/display/composer/v1_2/DisplayComposerType.idl @@ -118,3 +118,25 @@ 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 */ +}; + +/** + * @brief Enumerates layer types. + * + */ +enum LayerType : ohos.hdi.display.composer.v1_0.LayerType { + LAYER_TYPE_TUNNEL, /**< Tunnel layer */ +}; \ No newline at end of file diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 73b2619856ea3924050be47ab1fe151ea5002a5a..36ffb77b443bc8ba3f3cced9ab398ae1f14617ee 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -135,4 +135,89 @@ 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 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 2b0042e48312e0f423c2dc2cf9cae47dd33a512d..d2f1d6d1cc8c9b71e7bae2972f9a99d20b3c0ef7 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 77ef2d21b334ea73917cbbea59393ac5c24e0d50..5ebb0a67b675b7d623bd928f0b3ffb8b0873bed5 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