diff --git a/display/buffer/hdi_service/BUILD.gn b/display/buffer/hdi_service/BUILD.gn index af5cadc3c9475d36016cf12cc05785f7bf62ea4c..ceae5c3f78794a992d612f82eb19dc9fcfbfac07 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 eef483ab56ce5c917676cf41dff6ee6d155b2a41..70f1f1a8acdeef627a0a852db359f8500cada5ba 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 0a086f30009a2e7094fc813285c7618882f9d6ad..d96b57bf76c644cb20402c07d8c299ea59ffbcb5 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 20e26f70930ea9e67614445632f80b82471b5d1d..c09636bce18a1e341c861c1b9516cc1372aaa581 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 1c7b33c164f710624502b822cb251820dcf691e8..b46e9c440a6566722d582b0a7bf4150e0a8d5ce9 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 c7a1471bfec0faf4ac440b53f0f79c16f73e3b68..028fb9f94084afd20d690d10660d6e057f3b9487 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 595c39e06dd71494310f048045fd1cf5ed715148..9c0555719c60fea5673a19da3e546796b1d4f418 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 16dfcdaa1ba4df301ea3309e6a55db62e1d4cfa3..62b3e0fcac9c76e35164508c8cb4e5e6e0cd6640 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,11 @@ 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)); - vsyncEnableStatus_[devId] = enabled; - return ret; + DISPLAY_LOGE("%{public}s fail: vsyncStatus[%{public}u] = %{public}d", __func__, devId, enabled)); + return ret; } int32_t DisplayComposerService::RegDisplayVBlankCallback(uint32_t devId, const sptr& cb) @@ -789,7 +785,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 +817,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 +1061,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 8c54363bf4b3a076530490b2c6ae3dafdd586099..b87bdbeb4b6fafa87bc889ab8e95b70f7d45010f 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 c992f02791cf9d7af1ff76291932149fac969ac8..8ca01e2b2ead9ef432fec69dc567a7aaa8111ad7 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 5aaa238ac304e98bfd84fff4e71b46e9a00cd00d..99b748f6e2addcd37e292ec8dfef602480dde7dd 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 a0d477541472364c28f21a4438d0d002da6fdd02..3ce8eca477914dd54077be637c7e22b52dad85db 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 5e8070bd66fdd8bdea41d1d41812960fb69176ee..1aad224e7dae8822a42d38bd6d867cfe0197836a 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; diff --git a/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn b/display/composer/test/fuzztest/layer_fuzzer/BUILD.gn index fc29d6a23cf13deff4b70186fa8b76235485dc25..5f5956a2570bd71569197b44af0df8e54e763f14 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 b0d0d548ea6efeb593cd37464e66b8a91f6b503b..e7797504518b90b007d3d71733e87a7674b7fe91 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 358fa3ca473e94e9b9b679ecc1bb3d4fac3ca952..4335b860d01c44d5a589f111fb645ff527e65036 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 e23dd7816e3b2e96acc2030426fc79ec856c8ea4..d5dc878a53aa4e5afdbed87564f8a0a4ac875ffd 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 99e4855ecf9a6e2ae3ee173a5ec64ed55d56c039..1d84be2be1ae8baec4581d647d3c0ef5964f5d12 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 44de85979de0cb960b156eeb9b2729e40b85c627..99df600ef2bfb882914b22d3666f0fc85c9fbd04 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) {