From 244a363291bc25cdeaead00c854b346ddc1ed0b6 Mon Sep 17 00:00:00 2001 From: zhurongting Date: Sat, 26 Oct 2024 09:49:27 +0800 Subject: [PATCH] display Signed-off-by: zhurongting --- display/composer/v1_2/IDisplayComposer.idl | 2 ++ .../v1_2/hdi_impl/display_composer_hdi_impl.h | 16 ++++++++++++++++ .../v1_2/include/idisplay_composer_interface.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/display/composer/v1_2/IDisplayComposer.idl b/display/composer/v1_2/IDisplayComposer.idl index 7a86fe6f..18f64a45 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 8c14a70f..8a797d03 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 5a6252b1..e99ac2ad 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 -- Gitee