diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 7a86fe6f6dfed151ffe83d2ff70e79721d472674..18f64a45cbff2edf8a6d27ce52cfe408aefc0061 100644 --- a/display/composer/v1_2/IDisplayComposer.idl +++ b/display/composer/v1_2/IDisplayComposer.idl @@ -94,4 +94,6 @@ interface IDisplayComposer extends ohos.hdi.display.composer.v1_1.IDisplayCompos * @version 1.0 */ GetHardwareCursorStats([in] unsigned int devId, [out] unsigned int frameCount, [out] unsigned int vsyncCount); + SetSliceInfo([in] unsigned int devId, [in] boolean wltEn, [in] unsigned int sliceRow, [in] unsigned int sliceNum, + [in] unsigned int height, [in] NativeBuffer[] bufferHandles); } 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 8c14a70fd0cc90a95096227d50af3e5e56189570..8a797d0324d15acddc069e22a3ba8c39016274e5 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 @@ -147,6 +147,22 @@ public: return ret; } + virtual int32_t SetSliceInfo(uint32_t devId, bool wltEn, uint32_t sliceRow, uint32_t sliceNum, + uint32_t height, const std::vector inHandles) override + { + COMPOSER_CHECK_NULLPTR_RETURN(hdi_v1_2_); + std::vector> outHandles; + for (auto inHandle : inHandles) { + sptr nativeBuffer = new NativeBuffer(inHandle); + if (nativeBuffer == nullptr) { + HDF_LOGE("failed to alloc mem for NativeBuffer"); + return DISPLAY_FAILURE; + } + outHandles.emplace_back(nativeBuffer); + } + return ToDispErrCode(hdi_v1_2_->SetSliceInfo(devId, wltEn, sliceRow, sliceNum, height, outHandles)); + } + protected: using BaseType1_1 = V1_1::DisplayComposerHdiImpl; using BaseType1_1::WAIT_TIME_INTERVAL; diff --git a/display/composer/v1_2/include/idisplay_composer_interface.h b/display/composer/v1_2/include/idisplay_composer_interface.h index 5a6252b19b5e2446e92fc4d5f4315995f0683750..e99ac2adea7e7880e3c1eaec9feaaa86448505ef 100644 --- a/display/composer/v1_2/include/idisplay_composer_interface.h +++ b/display/composer/v1_2/include/idisplay_composer_interface.h @@ -71,6 +71,9 @@ public: virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0; virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; + + virtual int32_t SetSliceInfo(uint32_t devId, bool wltEn, uint32_t sliceRow, uint32_t sliceNum, + uint32_t height, const std::vector inHandles) = 0; }; } // V1_2 } // Composer