From 9507d55d06db006ee7336ee0b6d34f86574cb75c Mon Sep 17 00:00:00 2001 From: huyx Date: Mon, 1 Sep 2025 14:52:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyx --- display/buffer/hdi_service/BUILD.gn | 2 - display/buffer/test/benchmarktest/BUILD.gn | 2 +- .../display_buffer_benchmark_test.cpp | 13 +- .../fuzztest/mapper_fuzzer/mapper_fuzzer.cpp | 9 ++ display/buffer/test/moduletest/BUILD.gn | 2 +- .../test/unittest/display_buffer_ut.cpp | 2 +- .../include/display_composer_service.h | 8 +- .../src/display_composer_service.cpp | 113 ++++++++++++++---- display/composer/test/benchmark/BUILD.gn | 3 +- .../composer/test/common/hdi_test_display.cpp | 2 +- .../fuzztest/common/display_common_fuzzer.h | 2 +- .../test/fuzztest/device_fuzzer/BUILD.gn | 3 +- .../fuzztest/device_fuzzer/device_fuzzer.cpp | 3 +- .../test/fuzztest/layer_fuzzer/BUILD.gn | 3 +- display/composer/test/moduletest/BUILD.gn | 3 +- display/composer/test/resource/ohos_test.xml | 8 +- display/composer/test/unittest/BUILD.gn | 7 +- .../test/unittest/hdi_composer_ut.cpp | 2 +- .../vdi_base/src/hdi_device_interface.cpp | 1 + 19 files changed, 140 insertions(+), 48 deletions(-) diff --git a/display/buffer/hdi_service/BUILD.gn b/display/buffer/hdi_service/BUILD.gn index af5cadc3c9..ceae5c3f78 100644 --- a/display/buffer/hdi_service/BUILD.gn +++ b/display/buffer/hdi_service/BUILD.gn @@ -83,8 +83,6 @@ ohos_shared_library("liballocator_driver_1.0") { } ohos_shared_library("libmapper_service_1.0") { - defines = [] - defines += display_defines include_dirs = [ "include", "../../utils/include", diff --git a/display/buffer/test/benchmarktest/BUILD.gn b/display/buffer/test/benchmarktest/BUILD.gn index eef483ab56..70f1f1a8ac 100644 --- a/display/buffer/test/benchmarktest/BUILD.gn +++ b/display/buffer/test/benchmarktest/BUILD.gn @@ -14,7 +14,7 @@ import("//build/ohos.gni") import("//build/test.gni") -module_output_path = "drivers_peripheral_display/drivers_peripheral_display" +module_output_path = "drivers_peripheral_display/display" ohos_benchmarktest("hdf_display_buffer_benchmarktest") { module_out_path = module_output_path diff --git a/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp b/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp index 0a086f3000..a7558be0c1 100644 --- a/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp +++ b/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp @@ -255,6 +255,9 @@ BENCHMARK_F(DisplayBenchmarkTest, IsSupportAllocPassthroughTest)(benchmark::Stat for (auto _ : state) { ret = g_gralloc->AllocMem(g_allocInfo, handle); EXPECT_TRUE(ret == DISPLAY_SUCCESS || ret == DISPLAY_NOT_SUPPORT); + if (handle != nullptr) { + g_gralloc->FreeMem(handle); + } } } @@ -263,8 +266,8 @@ BENCHMARK_REGISTER_F(DisplayBenchmarkTest, IsSupportAllocPassthroughTest)-> /** - * @tc.name: IsSupportAllocPassthroughTest - * @tc.desc: Benchmarktest for interface IsSupportAllocPassthrough. + * @tc.name: ReAllocMemTest + * @tc.desc: Benchmarktest for interface ReAllocMemTest. */ BENCHMARK_F(DisplayBenchmarkTest, ReAllocMemTest)(benchmark::State &state) { @@ -276,6 +279,12 @@ BENCHMARK_F(DisplayBenchmarkTest, ReAllocMemTest)(benchmark::State &state) for (auto _ : state) { ret = g_gralloc->ReAllocMem(g_allocInfo, *inHandle, outHandle); EXPECT_TRUE(ret == DISPLAY_SUCCESS || ret == DISPLAY_NOT_SUPPORT); + if (outHandle != nullptr) { + g_gralloc->FreeMem(*outHandle); + } + } + if (inHandle != nullptr) { + g_gralloc->FreeMem(*inHandle); } } diff --git a/display/buffer/test/fuzztest/mapper_fuzzer/mapper_fuzzer.cpp b/display/buffer/test/fuzztest/mapper_fuzzer/mapper_fuzzer.cpp index 20e26f7093..c09636bce1 100644 --- a/display/buffer/test/fuzztest/mapper_fuzzer/mapper_fuzzer.cpp +++ b/display/buffer/test/fuzztest/mapper_fuzzer/mapper_fuzzer.cpp @@ -132,6 +132,9 @@ void TestIsSupportAllocPassthrough() } (void)g_bufferInterface->AllocMem(info, handle); + if (handle != nullptr) { + (void)g_bufferInterface->FreeMem(handle); + } } void TestReAllocMem(const BufferHandle& handle) @@ -145,6 +148,12 @@ void TestReAllocMem(const BufferHandle& handle) BufferHandle* outHandle = nullptr; (void)g_bufferInterface->ReAllocMem(info, handle, outHandle); + if (handle != nullptr) { + (void)g_bufferInterface->FreeMem(handle); + } + if (outHandle != nullptr) { + (void)g_bufferInterface->FreeMem(outHandle); + } } using TestFuncs = void (*)(const BufferHandle&); diff --git a/display/buffer/test/moduletest/BUILD.gn b/display/buffer/test/moduletest/BUILD.gn index 1c7b33c164..b46e9c440a 100644 --- a/display/buffer/test/moduletest/BUILD.gn +++ b/display/buffer/test/moduletest/BUILD.gn @@ -14,7 +14,7 @@ import("//build/test.gni") import("./../../../display_config.gni") -module_output_path = "drivers_peripheral_display/drivers_peripheral_display" +module_output_path = "drivers_peripheral_display/buffer" ohos_moduletest("hdf_disp_buffer_moduletest") { defines = [] diff --git a/display/buffer/test/unittest/display_buffer_ut.cpp b/display/buffer/test/unittest/display_buffer_ut.cpp index c7a1471bfe..028fb9f940 100644 --- a/display/buffer/test/unittest/display_buffer_ut.cpp +++ b/display/buffer/test/unittest/display_buffer_ut.cpp @@ -49,7 +49,6 @@ using OHOS::HDI::Display::Composer::V1_1::PIXEL_FMT_BGR_565; using OHOS::HDI::Display::Composer::V1_1::PIXEL_FMT_BGRA_5551; using OHOS::HDI::Display::Composer::V1_1::PIXEL_FMT_BGRX_5551; using OHOS::HDI::Display::Composer::V1_1::PIXEL_FMT_RGBA_1010102; -#define TEST_INFO (1<<27) #ifndef DISPLAY_TEST_CHK_RETURN #define DISPLAY_TEST_CHK_RETURN(val, ret, ...) \ do { \ @@ -64,6 +63,7 @@ const uint32_t ALLOC_SIZE_1080 = 1080; // alloc size 1080 const uint32_t ALLOC_SIZE_1920 = 1920; // alloc size 1920 const uint32_t ALLOC_SIZE_1280 = 1280; // alloc size 1280 const uint32_t ALLOC_SIZE_720 = 720; // alloc size 720 +const uint32_t TEST_INFO = (1<<27); // alloc size 1<<27 const AllocInfo DISPLAY_BUFFER_TEST_SETS[] = { // num0 diff --git a/display/composer/hdi_service/include/display_composer_service.h b/display/composer/hdi_service/include/display_composer_service.h index 595c39e06d..9c0555719c 100644 --- a/display/composer/hdi_service/include/display_composer_service.h +++ b/display/composer/hdi_service/include/display_composer_service.h @@ -87,6 +87,13 @@ public: int32_t FastPresent(uint32_t devId, const PresentParam& param, const std::vector>& inHandles) override; int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector& edidData) override; + int32_t GetSupportLayerType(uint32_t devId, std::vector& types) override; + int32_t SetTunnelLayerId(uint32_t devId, uint32_t layerId, uint64_t tunnelId) override; + int32_t SetTunnelLayerProperty(uint32_t devId, uint32_t layerId, uint32_t property) override; + int32_t SetTunnelLayerPosition(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y) override; + int32_t SetTunnelLayerBuffer(uint32_t devId, uint64_t tunnelId, + const sptr& inHandle, const sptr& acquireFence) override; + int32_t CommitTunnelLayer(uint32_t devId, uint64_t tunnelId, sptr& releaseFence) override; int32_t RegHwcEventCallback(const sptr& cb) override; private: @@ -112,7 +119,6 @@ private: std::mutex mutex_; std::shared_ptr cacheMgr_; std::unordered_map currentBacklightLevel_; - std::unordered_map vsyncEnableStatus_; sptr hotPlugCb_; sptr vBlankCb_; sptr modeCb_; diff --git a/display/composer/hdi_service/src/display_composer_service.cpp b/display/composer/hdi_service/src/display_composer_service.cpp index 16dfcdaa1b..d34286827b 100644 --- a/display/composer/hdi_service/src/display_composer_service.cpp +++ b/display/composer/hdi_service/src/display_composer_service.cpp @@ -80,7 +80,6 @@ DisplayComposerService::DisplayComposerService() HidumperInit(); OHOS::system::SetParameter(BOOTEVENT_COMPOSER_HOST_READY.c_str(), "true"); - vsyncEnableStatus_.clear(); currentBacklightLevel_.clear(); } @@ -265,6 +264,16 @@ void DisplayComposerService::LoadVdiFuncPart3() reinterpret_cast(dlsym(libHandle_, "SetDisplayPerFrameParameter")); vdiAdapter_->GetDisplayIdentificationData = reinterpret_cast(dlsym(libHandle_, "GetDisplayIdentificationData")); + vdiAdapter_->GetSupportLayerType = + reinterpret_cast(dlsym(libHandle_, "GetSupportLayerType")); + vdiAdapter_->SetTunnelLayerId = reinterpret_cast(dlsym(libHandle_, "SetTunnelLayerId")); + vdiAdapter_->SetTunnelLayerProperty = + reinterpret_cast(dlsym(libHandle_, "SetTunnelLayerProperty")); + vdiAdapter_->SetTunnelLayerPosition = + reinterpret_cast(dlsym(libHandle_, "SetTunnelLayerPosition")); + vdiAdapter_->SetTunnelLayerBuffer = + reinterpret_cast(dlsym(libHandle_, "SetTunnelLayerBuffer")); + vdiAdapter_->CommitTunnelLayer = reinterpret_cast(dlsym(libHandle_, "CommitTunnelLayer")); vdiAdapter_->RegHwcEventCallback = reinterpret_cast(dlsym(libHandle_, "RegHwcEventCallback")); } @@ -338,11 +347,9 @@ void DisplayComposerService::OnHotPlug(uint32_t outputId, bool connected, void* } } - auto vsyncEnableStatus = reinterpret_cast(data)->vsyncEnableStatus_; auto currentBacklightLevel = reinterpret_cast(data)->currentBacklightLevel_; - vsyncEnableStatus[outputId] = false; currentBacklightLevel[outputId] = 0; - + sptr remoteCb = reinterpret_cast(data)->hotPlugCb_; if (remoteCb == nullptr) { DISPLAY_LOGE("hotPlugCb_ is nullptr outputId:%{public}u, connected:%{public}d", outputId, connected); @@ -399,7 +406,7 @@ int32_t DisplayComposerService::GetDisplayCapability(uint32_t devId, DisplayCapa int32_t ret = vdiAdapter_->GetDisplayCapability(devId, info); DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("%{public}s fail devId:%{public}u", __func__, devId)); - DISPLAY_LOGI("%{public}s fail devId:%{public}u, width:%{public}u, height:%{public}u, count:%{public}u", + DISPLAY_LOGI("%{public}s devId:%{public}u, width:%{public}u, height:%{public}u, count:%{public}u", __func__, devId, info.phyWidth, info.phyHeight, info.propertyCount); return HDF_SUCCESS; } @@ -456,10 +463,6 @@ int32_t DisplayComposerService::SetDisplayPowerStatus(uint32_t devId, V1_0::Disp int32_t ret = vdiAdapter_->SetDisplayPowerStatus(devId, status); DISPLAY_LOGI("devid: %{public}u, status: %{public}u, vdi return %{public}d", devId, status, ret); DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, HDF_FAILURE, DISPLAY_LOGE(" fail")); - if (vsyncEnableStatus_[devId]) { - (void)SetDisplayVsyncEnabled(devId, false); - vsyncEnableStatus_[devId] = false; - } if (status == V1_0::DispPowerStatus::POWER_STATUS_OFF) { currentBacklightLevel_[devId] = 0; @@ -511,6 +514,7 @@ int32_t DisplayComposerService::UpdateHardwareCursor(uint32_t devId, int32_t x, CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->UpdateHardwareCursor, HDF_ERR_NOT_SUPPORT); CHECK_NULLPOINTER_RETURN_VALUE(buffer, HDF_ERR_NOT_SUPPORT); BufferHandle* handle = buffer->GetBufferHandle(); + CHECK_NULLPOINTER_RETURN_VALUE(handle, HDF_ERR_NOT_SUPPORT); int32_t ret = vdiAdapter_->UpdateHardwareCursor(devId, x, y, handle); DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, DISPLAY_LOGE("%{public}s fail devId:%{public}u", __func__, devId)); @@ -554,19 +558,12 @@ int32_t DisplayComposerService::SetDisplayVsyncEnabled(uint32_t devId, bool enab { DISPLAY_TRACE; - /*Already enabled, return success */ - if (enabled && vsyncEnableStatus_[devId]) { - DISPLAY_LOGW("%{public}s:vsyncStatus[%{public}u] = %{public}d, skip", - __func__, devId, vsyncEnableStatus_[devId]); - return HDF_SUCCESS; - } - CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); int32_t ret = vdiAdapter_->SetDisplayVsyncEnabled(devId, enabled); DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, HDF_FAILURE, - DISPLAY_LOGE("%{public}s: vsyncStatus[%{public}u] = %{public}d, fail", __func__, devId, enabled)); + DISPLAY_LOGE("%{public}s fail: vsyncStatus[%{public}u] = %{public}d", __func__, devId, enabled)); vsyncEnableStatus_[devId] = enabled; - return ret; + return ret; } int32_t DisplayComposerService::RegDisplayVBlankCallback(uint32_t devId, const sptr& cb) @@ -789,7 +786,6 @@ int32_t DisplayComposerService::CmdRequest( uint32_t inEleCnt, const std::vector& inFds, uint32_t& outEleCnt, std::vector& outFds) { int32_t ret = HDF_FAILURE; - if (cmdResponser_ != nullptr) { ret = cmdResponser_->CmdRequest(inEleCnt, inFds, outEleCnt, outFds); } @@ -822,6 +818,84 @@ int32_t DisplayComposerService::SetLayerPerFrameParameter(uint32_t devId, uint32 return ret; } +int32_t DisplayComposerService::GetSupportLayerType(uint32_t devId, std::vector& types) +{ + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->GetSupportLayerType, HDF_ERR_NOT_SUPPORT); + int32_t ret = vdiAdapter_->GetSupportLayerType(devId, types); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + return ret; +} + +int32_t DisplayComposerService::SetTunnelLayerId(uint32_t devId, uint32_t layerId, uint64_t tunnelId) +{ + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->SetTunnelLayerId, HDF_ERR_NOT_SUPPORT); + int32_t ret = vdiAdapter_->SetTunnelLayerId(devId, layerId, tunnelId); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + return ret; +} + +int32_t DisplayComposerService::SetTunnelLayerProperty(uint32_t devId, uint32_t layerId, uint32_t property) +{ + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->SetTunnelLayerProperty, HDF_ERR_NOT_SUPPORT); + int32_t ret = vdiAdapter_->SetTunnelLayerProperty(devId, layerId, property); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + return ret; +} + +int32_t DisplayComposerService::SetTunnelLayerPosition(uint32_t devId, uint64_t tunnelId, int32_t x, int32_t y) +{ + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->SetTunnelLayerPosition, HDF_ERR_NOT_SUPPORT); + int32_t ret = vdiAdapter_->SetTunnelLayerPosition(devId, tunnelId, x, y); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + return ret; +} + +int32_t DisplayComposerService::SetTunnelLayerBuffer( + uint32_t devId, uint64_t tunnelId, const sptr& inHandle, const sptr& acquireFence) +{ + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->SetTunnelLayerBuffer, HDF_ERR_NOT_SUPPORT); + CHECK_NULLPOINTER_RETURN_VALUE(acquireFence, HDF_FAILURE); + int32_t inFence = acquireFence->GetFd(); + int32_t ret = vdiAdapter_->SetTunnelLayerBuffer(devId, tunnelId, inHandle->GetBufferHandle(), inFence); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + return ret; +} + +int32_t DisplayComposerService::CommitTunnelLayer(uint32_t devId, uint64_t tunnelId, + sptr& releaseFence) +{ + DISPLAY_TRACE; + int32_t outFence; + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(vdiAdapter_->CommitTunnelLayer, HDF_ERR_NOT_SUPPORT); + int32_t ret = vdiAdapter_->CommitTunnelLayer(devId, tunnelId, outFence); + DISPLAY_CHK_RETURN(ret == DISPLAY_NOT_SUPPORT, HDF_ERR_NOT_SUPPORT); + DISPLAY_CHK_RETURN(ret != HDF_SUCCESS && ret != HDF_ERR_NOT_SUPPORT, HDF_FAILURE, + DISPLAY_LOGE("%{public}s fail", __func__)); + releaseFence->Init(outFence); + return ret; +} + int32_t DisplayComposerService::GetSupportedLayerPerFrameParameterKey(std::vector& keys) { DISPLAY_TRACE; @@ -988,7 +1062,6 @@ int32_t DisplayComposerService::GetDisplayIdentificationData(uint32_t devId, uin DISPLAY_LOGI("%{public}s: ret %{public}d, devId {%{public}u, the param idx [{%{public}u]," "the length of edidData [%{public}zu]", __func__, ret, devId, portId, edidData.size()); - return ret; } diff --git a/display/composer/test/benchmark/BUILD.gn b/display/composer/test/benchmark/BUILD.gn index 8c54363bf4..b87bdbeb4b 100644 --- a/display/composer/test/benchmark/BUILD.gn +++ b/display/composer/test/benchmark/BUILD.gn @@ -14,8 +14,7 @@ import("//build/ohos.gni") import("//build/test.gni") -module_output_path = - "drivers_peripheral_display/drivers_peripheral_display_composer" +module_output_path = "drivers_peripheral_display/drivers_peripheral_display_composer" ohos_benchmarktest("hdf_display_benchmark_test") { module_out_path = module_output_path diff --git a/display/composer/test/common/hdi_test_display.cpp b/display/composer/test/common/hdi_test_display.cpp index c992f02791..8ca01e2b2e 100644 --- a/display/composer/test/common/hdi_test_display.cpp +++ b/display/composer/test/common/hdi_test_display.cpp @@ -105,7 +105,7 @@ std::shared_ptr HdiTestDisplay::CreateHdiTestLayer(uint32_t w, uin { const int32_t BPP = 32; - LayerInfo info = {w, h, LAYER_TYPE_GRAPHIC, BPP, Composer::V1_0::PIXEL_FMT_RGBA_8888}; + LayerInfo info = {w, h, Composer::V1_0::LAYER_TYPE_GRAPHIC, BPP, Composer::V1_0::PIXEL_FMT_RGBA_8888}; return CreateHdiTestLayer(info); } diff --git a/display/composer/test/fuzztest/common/display_common_fuzzer.h b/display/composer/test/fuzztest/common/display_common_fuzzer.h index 5aaa238ac3..99b748f6e2 100644 --- a/display/composer/test/fuzztest/common/display_common_fuzzer.h +++ b/display/composer/test/fuzztest/common/display_common_fuzzer.h @@ -78,7 +78,7 @@ const BufferUsage CONVERT_TABLE_USAGE[] = { }; -const LayerType CONVERT_TABLE_LAYER_TYPE[] = { +const Composer::V1_0::LayerType CONVERT_TABLE_LAYER_TYPE[] = { LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_CURSOR, LAYER_TYPE_BUTT, diff --git a/display/composer/test/fuzztest/device_fuzzer/BUILD.gn b/display/composer/test/fuzztest/device_fuzzer/BUILD.gn index a0d4775414..3ce8eca477 100644 --- a/display/composer/test/fuzztest/device_fuzzer/BUILD.gn +++ b/display/composer/test/fuzztest/device_fuzzer/BUILD.gn @@ -14,8 +14,7 @@ import("//build/config/features.gni") import("//build/test.gni") -module_output_path = - "drivers_peripheral_display/drivers_peripheral_display_composer" +module_output_path = "drivers_peripheral_display/drivers_peripheral_display_composer" ohos_fuzztest("DeviceFuzzTest") { module_out_path = module_output_path diff --git a/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp b/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp index 5e8070bd66..523253a4a5 100644 --- a/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp +++ b/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp @@ -219,6 +219,7 @@ int32_t TestUpdateHardwareCursor(uint32_t devId) int32_t x = GetData(); int32_t y = GetData(); int32_t ret = g_composerInterface->UpdateHardwareCursor(devId, x, y, buffer); + g_bufferInterface->FreeMem(*buffer); if ((ret != DISPLAY_SUCCESS) && (ret != DISPLAY_NOT_SUPPORT)) { HDF_LOGE("%{public}s: function UpdateHardwareCursor failed, %{public}d", __func__, ret); return DISPLAY_FAILURE; @@ -496,7 +497,7 @@ int TestGetDisplayIdentificationData(uint32_t devId) if ((ret != DISPLAY_SUCCESS) && (ret != DISPLAY_NOT_SUPPORT)) { HDF_LOGE("%{public}s: failed with ret=%{public}d", __func__, ret); } - HDF_LOGD("displayId[%u], portId[%u], edidDataLength[%u]", devId, portId, edidData.size()); + HDF_LOGD("displayId[%u], portId[%u], edidDataLength[%lu]", devId, portId, edidData.size()); return ret; } diff --git a/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn b/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn index fc29d6a23c..5f5956a257 100644 --- a/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn +++ b/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn @@ -14,8 +14,7 @@ import("//build/config/features.gni") import("//build/test.gni") -module_output_path = - "drivers_peripheral_display/drivers_peripheral_display_composer" +module_output_path = "drivers_peripheral_display/drivers_peripheral_display_composer" ohos_fuzztest("LayerFuzzTest") { module_out_path = module_output_path diff --git a/display/composer/test/moduletest/BUILD.gn b/display/composer/test/moduletest/BUILD.gn index b0d0d548ea..e779750451 100644 --- a/display/composer/test/moduletest/BUILD.gn +++ b/display/composer/test/moduletest/BUILD.gn @@ -19,8 +19,7 @@ group("hdf_disp_composer_moduletest") { deps = [ ":composer_mt" ] } -module_output_path = - "drivers_peripheral_display/drivers_peripheral_display_composer" +module_output_path = "drivers_peripheral_display/drivers_peripheral_display_composer" config("module_private_config") { visibility = [ ":*" ] diff --git a/display/composer/test/resource/ohos_test.xml b/display/composer/test/resource/ohos_test.xml index 358fa3ca47..4335b860d0 100644 --- a/display/composer/test/resource/ohos_test.xml +++ b/display/composer/test/resource/ohos_test.xml @@ -23,7 +23,7 @@ @@ -35,7 +35,7 @@ @@ -47,7 +47,7 @@ @@ -59,7 +59,7 @@ \ No newline at end of file diff --git a/display/composer/test/unittest/BUILD.gn b/display/composer/test/unittest/BUILD.gn index e23dd7816e..d5dc878a53 100644 --- a/display/composer/test/unittest/BUILD.gn +++ b/display/composer/test/unittest/BUILD.gn @@ -21,8 +21,7 @@ group("hdf_disp_composer_unittest") { ] } -module_output_path = - "drivers_peripheral_display/drivers_peripheral_display_composer" +module_output_path = "drivers_peripheral_display/drivers_peripheral_display_composer" config("module_private_config") { visibility = [ ":*" ] @@ -42,8 +41,8 @@ ohos_unittest("composer_ut") { "drivers_interface_display:libdisplay_composer_stub_1.0", "drivers_interface_display:libdisplay_composer_stub_1.1", "drivers_interface_display:libdisplay_composer_stub_1.2", - "drivers_interface_display:libdisplay_composer_stub_1.3", "drivers_interface_display:libhdifd_parcelable", + "drivers_interface_display:libdisplay_composer_stub_1.3", "googletest:gtest", "graphic_surface:buffer_handle", "hdf_core:libhdf_utils", @@ -65,7 +64,7 @@ ohos_unittest("composer_death_test") { "c_utils:utils", "drivers_interface_display:libdisplay_buffer_hdi_impl", "drivers_interface_display:libdisplay_buffer_stub_1.0", - "drivers_interface_display:libdisplay_composer_hdi_impl_1.2", + "drivers_interface_display:libdisplay_composer_hdi_impl", "drivers_interface_display:libdisplay_composer_stub_1.0", "googletest:gtest", "graphic_surface:buffer_handle", diff --git a/display/composer/test/unittest/hdi_composer_ut.cpp b/display/composer/test/unittest/hdi_composer_ut.cpp index 99e4855ecf..1d84be2be1 100644 --- a/display/composer/test/unittest/hdi_composer_ut.cpp +++ b/display/composer/test/unittest/hdi_composer_ut.cpp @@ -330,7 +330,7 @@ HWTEST_F(DeviceTest, test_GetDisplayIdentificationData, TestSize.Level1) uint8_t portId = 0; std::vector edidData = {}; auto ret = g_composerDevice->GetDisplayIdentificationData(g_displayIds[0], portId, edidData); - DISPLAY_TEST_LOGD("displayId[%u], portId[%u], edidDataLength[%u]", g_displayIds[0], portId, edidData.size()); + DISPLAY_TEST_LOGD("displayId[%u], portId[%u], edidDataLength[%lu]", g_displayIds[0], portId, edidData.size()); if (ret == DISPLAY_NOT_SUPPORT) { return; } diff --git a/display/composer/vdi_base/src/hdi_device_interface.cpp b/display/composer/vdi_base/src/hdi_device_interface.cpp index 44de85979d..99df600ef2 100644 --- a/display/composer/vdi_base/src/hdi_device_interface.cpp +++ b/display/composer/vdi_base/src/hdi_device_interface.cpp @@ -29,6 +29,7 @@ std::vector> HdiDeviceInterface::DiscoveryDe std::shared_ptr drmDevice = DrmDevice::Create(); if (!drmDevice) { DISPLAY_LOGE("can not create drm device"); + return devices; } ret = drmDevice->Init(); if (ret == DISPLAY_SUCCESS) { -- Gitee From fb1623ce6c30108cef2f09c849866e3ccfa71a7d Mon Sep 17 00:00:00 2001 From: huyx Date: Mon, 1 Sep 2025 15:14:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyx --- display/composer/test/unittest/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/test/unittest/BUILD.gn b/display/composer/test/unittest/BUILD.gn index d5dc878a53..0d0a135216 100644 --- a/display/composer/test/unittest/BUILD.gn +++ b/display/composer/test/unittest/BUILD.gn @@ -64,7 +64,7 @@ ohos_unittest("composer_death_test") { "c_utils:utils", "drivers_interface_display:libdisplay_buffer_hdi_impl", "drivers_interface_display:libdisplay_buffer_stub_1.0", - "drivers_interface_display:libdisplay_composer_hdi_impl", + "drivers_interface_display:libdisplay_composer_hdi_impl_1.2", "drivers_interface_display:libdisplay_composer_stub_1.0", "googletest:gtest", "graphic_surface:buffer_handle", -- Gitee From 283470a5d87018c24c55cbfac20eba9ade5bfb23 Mon Sep 17 00:00:00 2001 From: huyx Date: Mon, 1 Sep 2025 16:33:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyx --- .../buffer/test/benchmarktest/display_buffer_benchmark_test.cpp | 2 +- display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp b/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp index a7558be0c1..d96b57bf76 100644 --- a/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp +++ b/display/buffer/test/benchmarktest/display_buffer_benchmark_test.cpp @@ -256,7 +256,7 @@ BENCHMARK_F(DisplayBenchmarkTest, IsSupportAllocPassthroughTest)(benchmark::Stat ret = g_gralloc->AllocMem(g_allocInfo, handle); EXPECT_TRUE(ret == DISPLAY_SUCCESS || ret == DISPLAY_NOT_SUPPORT); if (handle != nullptr) { - g_gralloc->FreeMem(handle); + g_gralloc->FreeMem(*handle); } } } diff --git a/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp b/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp index 523253a4a5..1aad224e7d 100644 --- a/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp +++ b/display/composer/test/fuzztest/device_fuzzer/device_fuzzer.cpp @@ -497,7 +497,7 @@ int TestGetDisplayIdentificationData(uint32_t devId) if ((ret != DISPLAY_SUCCESS) && (ret != DISPLAY_NOT_SUPPORT)) { HDF_LOGE("%{public}s: failed with ret=%{public}d", __func__, ret); } - HDF_LOGD("displayId[%u], portId[%u], edidDataLength[%lu]", devId, portId, edidData.size()); + HDF_LOGD("displayId[%u], portId[%u], edidDataLength[%u]", devId, portId, edidData.size()); return ret; } -- Gitee From dd9a97bcddb10b9bd5396e9b92d838753e23ceb6 Mon Sep 17 00:00:00 2001 From: huyx Date: Thu, 4 Sep 2025 15:49:58 +0800 Subject: [PATCH 4/5] format Signed-off-by: huyx --- display/composer/test/unittest/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/composer/test/unittest/BUILD.gn b/display/composer/test/unittest/BUILD.gn index 0d0a135216..d5dc878a53 100644 --- a/display/composer/test/unittest/BUILD.gn +++ b/display/composer/test/unittest/BUILD.gn @@ -64,7 +64,7 @@ ohos_unittest("composer_death_test") { "c_utils:utils", "drivers_interface_display:libdisplay_buffer_hdi_impl", "drivers_interface_display:libdisplay_buffer_stub_1.0", - "drivers_interface_display:libdisplay_composer_hdi_impl_1.2", + "drivers_interface_display:libdisplay_composer_hdi_impl", "drivers_interface_display:libdisplay_composer_stub_1.0", "googletest:gtest", "graphic_surface:buffer_handle", -- Gitee From 2282f7ae231bb84f22d7458162ea1dfe667613e0 Mon Sep 17 00:00:00 2001 From: huyx Date: Fri, 5 Sep 2025 17:41:57 +0800 Subject: [PATCH 5/5] format Signed-off-by: huyx --- display/composer/hdi_service/src/display_composer_service.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/display/composer/hdi_service/src/display_composer_service.cpp b/display/composer/hdi_service/src/display_composer_service.cpp index d34286827b..62b3e0fcac 100644 --- a/display/composer/hdi_service/src/display_composer_service.cpp +++ b/display/composer/hdi_service/src/display_composer_service.cpp @@ -562,7 +562,6 @@ int32_t DisplayComposerService::SetDisplayVsyncEnabled(uint32_t devId, bool enab int32_t ret = vdiAdapter_->SetDisplayVsyncEnabled(devId, enabled); DISPLAY_CHK_RETURN(ret != HDF_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("%{public}s fail: vsyncStatus[%{public}u] = %{public}d", __func__, devId, enabled)); - vsyncEnableStatus_[devId] = enabled; return ret; } -- Gitee