diff --git a/dm/include/display_manager_adapter.h b/dm/include/display_manager_adapter.h index 099ebe23..f32756f3 100644 --- a/dm/include/display_manager_adapter.h +++ b/dm/include/display_manager_adapter.h @@ -48,8 +48,8 @@ public: virtual DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts); virtual DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut); virtual DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx); - virtual DMError GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap); - virtual DMError SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap); + virtual DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap); + virtual DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap); virtual DMError SetScreenColorTransform(ScreenId screenId); virtual bool RegisterDisplayManagerAgent(const sptr& displayManagerAgent, diff --git a/dm/src/display_manager_adapter.cpp b/dm/src/display_manager_adapter.cpp index 0914b59a..611eb4f0 100644 --- a/dm/src/display_manager_adapter.cpp +++ b/dm/src/display_manager_adapter.cpp @@ -129,29 +129,29 @@ DMError DisplayManagerAdapter::SetScreenColorGamut(ScreenId screenId, int32_t co return ret; } -DMError DisplayManagerAdapter::GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) +DMError DisplayManagerAdapter::GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) { std::lock_guard lock(mutex_); if (!InitDMSProxyLocked()) { - WLOGFE("displayManagerAdapter::GetScreenGamutsMap: InitDMSProxyLocked failed!"); + WLOGFE("displayManagerAdapter::GetScreenGamutMap: InitDMSProxyLocked failed!"); return DMError::DM_ERROR_INIT_DMS_PROXY_LOCKED; } - DMError ret = displayManagerServiceProxy_->GetScreenGamutsMap(screenId, gamutMap); + DMError ret = displayManagerServiceProxy_->GetScreenGamutMap(screenId, gamutMap); return ret; } -DMError DisplayManagerAdapter::SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) +DMError DisplayManagerAdapter::SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) { std::lock_guard lock(mutex_); if (!InitDMSProxyLocked()) { - WLOGFE("displayManagerAdapter::SetScreenGamutsMap: InitDMSProxyLocked failed!"); + WLOGFE("displayManagerAdapter::SetScreenGamutMap: InitDMSProxyLocked failed!"); return DMError::DM_ERROR_INIT_DMS_PROXY_LOCKED; } - DMError ret = displayManagerServiceProxy_->SetScreenGamutsMap(screenId, gamutMap); + DMError ret = displayManagerServiceProxy_->SetScreenGamutMap(screenId, gamutMap); return ret; } diff --git a/dm/src/screen.cpp b/dm/src/screen.cpp index c1745455..0b9c6148 100644 --- a/dm/src/screen.cpp +++ b/dm/src/screen.cpp @@ -133,14 +133,14 @@ DMError Screen::SetScreenColorGamut(int32_t colorGamutIdx) return SingletonContainer::Get().SetScreenColorGamut(pImpl_->id_, colorGamutIdx); } -DMError Screen::GetScreenGamutsMap(ScreenGamutMap& gamutMap) const +DMError Screen::GetScreenGamutMap(ScreenGamutMap& gamutMap) const { - return SingletonContainer::Get().GetScreenGamutsMap(pImpl_->id_, gamutMap); + return SingletonContainer::Get().GetScreenGamutMap(pImpl_->id_, gamutMap); } -DMError Screen::SetScreenGamutsMap(ScreenGamutMap gamutMap) +DMError Screen::SetScreenGamutMap(ScreenGamutMap gamutMap) { - return SingletonContainer::Get().SetScreenGamutsMap(pImpl_->id_, gamutMap); + return SingletonContainer::Get().SetScreenGamutMap(pImpl_->id_, gamutMap); } DMError Screen::SetScreenColorTransform() diff --git a/dm/test/systemtest/screen_gamut_test.cpp b/dm/test/systemtest/screen_gamut_test.cpp index a9aa962c..4ec3d542 100644 --- a/dm/test/systemtest/screen_gamut_test.cpp +++ b/dm/test/systemtest/screen_gamut_test.cpp @@ -87,10 +87,10 @@ HWTEST_F(ScreenGamutTest, ScreenGamut02, Function | MediumTest | Level1) DMError ret; ScreenGamutMap gamutMap; - ret = defaultScreen_->GetScreenGamutsMap(gamutMap); + ret = defaultScreen_->GetScreenGamutMap(gamutMap); ASSERT_EQ(ret, DMError::DM_OK); - ret = defaultScreen_->SetScreenGamutsMap(gamutMap); + ret = defaultScreen_->SetScreenGamutMap(gamutMap); ASSERT_EQ(ret, DMError::DM_OK); } diff --git a/dmserver/include/abstract_screen.h b/dmserver/include/abstract_screen.h index 4adf94f6..4cafa07b 100644 --- a/dmserver/include/abstract_screen.h +++ b/dmserver/include/abstract_screen.h @@ -53,6 +53,14 @@ public: void UpdateRSTree(std::shared_ptr& surfaceNode, bool isAdd); void InitRSDisplayNode(RSDisplayNodeConfig& config); + // colorspace, gamut + DMError GetScreenSupportedColorGamuts(std::vector& colorGamuts); + DMError GetScreenColorGamut(ScreenColorGamut& colorGamut); + DMError SetScreenColorGamut(int32_t colorGamutIdx); + DMError GetScreenGamutMap(ScreenGamutMap& gamutMap); + DMError SetScreenGamutMap(ScreenGamutMap gamutMap); + DMError SetScreenColorTransform(); + ScreenId dmsId_; ScreenId rsId_; bool canHasChild_ { false }; diff --git a/dmserver/include/abstract_screen_controller.h b/dmserver/include/abstract_screen_controller.h index ffed2a11..2e1441e8 100644 --- a/dmserver/include/abstract_screen_controller.h +++ b/dmserver/include/abstract_screen_controller.h @@ -63,6 +63,15 @@ public: bool MakeMirror(ScreenId, std::vector screens); void DumpScreenInfo() const; void DumpScreenGroupInfo() const; + + // colorspace, gamut + DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts); + DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut); + DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx); + DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap); + DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap); + DMError SetScreenColorTransform(ScreenId screenId); + private: void OnRsScreenConnectionChange(ScreenId rsScreenId, ScreenEvent screenEvent); void ProcessScreenDisconnected(ScreenId rsScreenId); diff --git a/dmserver/include/display_manager_interface.h b/dmserver/include/display_manager_interface.h index 3988ac27..7f2e1a0d 100644 --- a/dmserver/include/display_manager_interface.h +++ b/dmserver/include/display_manager_interface.h @@ -78,8 +78,8 @@ public: virtual DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts) = 0; virtual DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) = 0; virtual DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) = 0; - virtual DMError GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) = 0; - virtual DMError SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) = 0; + virtual DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) = 0; + virtual DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) = 0; virtual DMError SetScreenColorTransform(ScreenId screenId) = 0; virtual bool RegisterDisplayManagerAgent(const sptr& displayManagerAgent, diff --git a/dmserver/include/display_manager_proxy.h b/dmserver/include/display_manager_proxy.h index 02a9eb7d..d750fce1 100644 --- a/dmserver/include/display_manager_proxy.h +++ b/dmserver/include/display_manager_proxy.h @@ -43,8 +43,8 @@ public: DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts) override; DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override; DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override; - DMError GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; - DMError SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) override; + DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; + DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override; DMError SetScreenColorTransform(ScreenId screenId) override; bool RegisterDisplayManagerAgent(const sptr& displayManagerAgent, diff --git a/dmserver/include/display_manager_service.h b/dmserver/include/display_manager_service.h index 246a6846..a627bc6c 100644 --- a/dmserver/include/display_manager_service.h +++ b/dmserver/include/display_manager_service.h @@ -59,8 +59,8 @@ public: DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector& colorGamuts) override; DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override; DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override; - DMError GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; - DMError SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) override; + DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; + DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override; DMError SetScreenColorTransform(ScreenId screenId) override; bool RegisterDisplayManagerAgent(const sptr& displayManagerAgent, diff --git a/dmserver/src/abstract_screen.cpp b/dmserver/src/abstract_screen.cpp index 7ccdeea3..aaa31a25 100644 --- a/dmserver/src/abstract_screen.cpp +++ b/dmserver/src/abstract_screen.cpp @@ -17,6 +17,7 @@ #include "abstract_screen_controller.h" #include "display_manager_service.h" +#include "dm_common.h" #include "window_manager_hilog.h" namespace OHOS::Rosen { @@ -91,6 +92,78 @@ void AbstractScreen::InitRSDisplayNode(RSDisplayNodeConfig& config) transactionProxy->FlushImplicitTransaction(); } +DMError AbstractScreen::GetScreenSupportedColorGamuts(std::vector& colorGamuts) +{ + auto ret = RSInterfaces::GetInstance().GetScreenSupportedColorGamuts(rsId_, colorGamuts); + if (ret != StatusCode::SUCCESS) { + WLOGE("GetScreenSupportedColorGamuts fail! rsId %{public}" PRIu64"", rsId_); + return DMError::DM_ERROR_RENDER_SERVICE_FAILED; + } + WLOGI("GetScreenSupportedColorGamuts ok! rsId %{public}" PRIu64", size %{public}u", + rsId_, static_cast(colorGamuts.size())); + + return DMError::DM_OK; +} + +DMError AbstractScreen::GetScreenColorGamut(ScreenColorGamut& colorGamut) +{ + auto ret = RSInterfaces::GetInstance().GetScreenColorGamut(rsId_, colorGamut); + if (ret != StatusCode::SUCCESS) { + WLOGE("GetScreenColorGamut fail! rsId %{public}" PRIu64"", rsId_); + return DMError::DM_ERROR_RENDER_SERVICE_FAILED; + } + WLOGI("GetScreenColorGamut ok! rsId %{public}" PRIu64", colorGamut %{public}u", + rsId_, static_cast(colorGamut)); + + return DMError::DM_OK; +} + +DMError AbstractScreen::SetScreenColorGamut(int32_t colorGamutIdx) +{ + auto ret = RSInterfaces::GetInstance().SetScreenColorGamut(rsId_, colorGamutIdx); + if (ret != StatusCode::SUCCESS) { + WLOGE("SetScreenColorGamut fail! rsId %{public}" PRIu64"", rsId_); + return DMError::DM_ERROR_RENDER_SERVICE_FAILED; + } + WLOGI("SetScreenColorGamut ok! rsId %{public}" PRIu64", colorGamutIdx %{public}u", + rsId_, colorGamutIdx); + + return DMError::DM_OK; +} + +DMError AbstractScreen::GetScreenGamutMap(ScreenGamutMap& gamutMap) +{ + auto ret = RSInterfaces::GetInstance().GetScreenGamutMap(rsId_, gamutMap); + if (ret != StatusCode::SUCCESS) { + WLOGE("GetScreenGamutMap fail! rsId %{public}" PRIu64"", rsId_); + return DMError::DM_ERROR_RENDER_SERVICE_FAILED; + } + WLOGI("GetScreenGamutMap ok! rsId %{public}" PRIu64", gamutMap %{public}u", + rsId_, static_cast(gamutMap)); + + return DMError::DM_OK; +} + +DMError AbstractScreen::SetScreenGamutMap(ScreenGamutMap gamutMap) +{ + auto ret = RSInterfaces::GetInstance().SetScreenGamutMap(rsId_, gamutMap); + if (ret != StatusCode::SUCCESS) { + WLOGE("SetScreenGamutMap fail! rsId %{public}" PRIu64"", rsId_); + return DMError::DM_ERROR_RENDER_SERVICE_FAILED; + } + WLOGI("SetScreenGamutMap ok! rsId %{public}" PRIu64", gamutMap %{public}u", + rsId_, static_cast(gamutMap)); + + return DMError::DM_OK; +} + +DMError AbstractScreen::SetScreenColorTransform() +{ + WLOGI("SetScreenColorTransform ok! rsId %{public}" PRIu64"", rsId_); + + return DMError::DM_OK; +} + void AbstractScreen::FillScreenInfo(sptr info) const { info->id_ = dmsId_; @@ -122,7 +195,7 @@ void AbstractScreen::RequestRotation(Rotation rotation) } AbstractScreenGroup::AbstractScreenGroup(ScreenId dmsId, ScreenId rsId, ScreenCombination combination) - : AbstractScreen(dmsId, rsId), combination_(combination) + : AbstractScreen(dmsId, rsId), combination_(combination) { type_ = ScreenType::UNDEFINE; canHasChild_ = true; diff --git a/dmserver/src/abstract_screen_controller.cpp b/dmserver/src/abstract_screen_controller.cpp index e9ce2fed..b75c92ec 100644 --- a/dmserver/src/abstract_screen_controller.cpp +++ b/dmserver/src/abstract_screen_controller.cpp @@ -487,6 +487,61 @@ void AbstractScreenController::OnScreenRotate(ScreenId dmsId, Rotation before, R } } +DMError AbstractScreenController::GetScreenSupportedColorGamuts(ScreenId screenId, + std::vector& colorGamuts) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->GetScreenSupportedColorGamuts(colorGamuts); +} + +DMError AbstractScreenController::GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->GetScreenColorGamut(colorGamut); +} + +DMError AbstractScreenController::SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->SetScreenColorGamut(colorGamutIdx); +} + +DMError AbstractScreenController::GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->GetScreenGamutMap(gamutMap); +} + +DMError AbstractScreenController::SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->SetScreenGamutMap(gamutMap); +} + +DMError AbstractScreenController::SetScreenColorTransform(ScreenId screenId) +{ + sptr screen = GetAbstractScreen(screenId); + if (screen == nullptr) { + return DMError::DM_ERROR_INVALID_PARAM; + } + return screen->SetScreenColorTransform(); +} + bool AbstractScreenController::IsScreenGroup(ScreenId screenId) const { std::lock_guard lock(mutex_); diff --git a/dmserver/src/display_manager_proxy.cpp b/dmserver/src/display_manager_proxy.cpp index ac23b04a..146b93cc 100644 --- a/dmserver/src/display_manager_proxy.cpp +++ b/dmserver/src/display_manager_proxy.cpp @@ -302,11 +302,11 @@ DMError DisplayManagerProxy::SetScreenColorGamut(ScreenId screenId, int32_t colo return ret; } -DMError DisplayManagerProxy::GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) +DMError DisplayManagerProxy::GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) { sptr remote = Remote(); if (remote == nullptr) { - WLOGFW("DisplayManagerProxy::GetScreenGamutsMap: remote is nullptr"); + WLOGFW("DisplayManagerProxy::GetScreenGamutMap: remote is nullptr"); return DMError::DM_ERROR_NULLPTR; } @@ -314,15 +314,15 @@ DMError DisplayManagerProxy::GetScreenGamutsMap(ScreenId screenId, ScreenGamutMa MessageParcel reply; MessageOption option; if (!data.WriteInterfaceToken(GetDescriptor())) { - WLOGFW("DisplayManagerProxy::GetScreenGamutsMap: WriteInterfaceToken failed"); + WLOGFW("DisplayManagerProxy::GetScreenGamutMap: WriteInterfaceToken failed"); return DMError::DM_ERROR_WRITE_INTERFACE_TOKEN_FAILED; } if (!data.WriteUint64(static_cast(screenId))) { - WLOGFW("DisplayManagerProxy::GetScreenGamutsMap: WriteUint64 screenId failed"); + WLOGFW("DisplayManagerProxy::GetScreenGamutMap: WriteUint64 screenId failed"); return DMError::DM_ERROR_IPC_FAILED; } if (remote->SendRequest(TRANS_ID_SCREEN_GET_GAMUT_MAP, data, reply, option) != ERR_NONE) { - WLOGFW("DisplayManagerProxy::GetScreenGamutsMap: SendRequest failed"); + WLOGFW("DisplayManagerProxy::GetScreenGamutMap: SendRequest failed"); return DMError::DM_ERROR_IPC_FAILED; } DMError ret = static_cast(reply.ReadInt32()); @@ -333,11 +333,11 @@ DMError DisplayManagerProxy::GetScreenGamutsMap(ScreenId screenId, ScreenGamutMa return ret; } -DMError DisplayManagerProxy::SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) +DMError DisplayManagerProxy::SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) { sptr remote = Remote(); if (remote == nullptr) { - WLOGFW("DisplayManagerProxy::SetScreenGamutsMap: remote is nullptr"); + WLOGFW("DisplayManagerProxy::SetScreenGamutMap: remote is nullptr"); return DMError::DM_ERROR_NULLPTR; } @@ -345,15 +345,15 @@ DMError DisplayManagerProxy::SetScreenGamutsMap(ScreenId screenId, ScreenGamutMa MessageParcel reply; MessageOption option; if (!data.WriteInterfaceToken(GetDescriptor())) { - WLOGFW("DisplayManagerProxy::SetScreenGamutsMap: WriteInterfaceToken failed"); + WLOGFW("DisplayManagerProxy::SetScreenGamutMap: WriteInterfaceToken failed"); return DMError::DM_ERROR_WRITE_INTERFACE_TOKEN_FAILED; } if (!data.WriteUint64(static_cast(screenId)) || !data.WriteUint32(static_cast(gamutMap))) { - WLOGFW("DisplayManagerProxy::SetScreenGamutsMap: Writ failed"); + WLOGFW("DisplayManagerProxy::SetScreenGamutMap: Writ failed"); return DMError::DM_ERROR_IPC_FAILED; } if (remote->SendRequest(TRANS_ID_SCREEN_SET_GAMUT_MAP, data, reply, option) != ERR_NONE) { - WLOGFW("DisplayManagerProxy::SetScreenGamutsMap: SendRequest failed"); + WLOGFW("DisplayManagerProxy::SetScreenGamutMap: SendRequest failed"); return DMError::DM_ERROR_IPC_FAILED; } DMError ret = static_cast(reply.ReadInt32()); diff --git a/dmserver/src/display_manager_service.cpp b/dmserver/src/display_manager_service.cpp index f1736ebe..c4d635a6 100644 --- a/dmserver/src/display_manager_service.cpp +++ b/dmserver/src/display_manager_service.cpp @@ -174,9 +174,7 @@ DMError DisplayManagerService::GetScreenSupportedColorGamuts(ScreenId screenId, } WM_SCOPED_TRACE("dms:GetScreenSupportedColorGamuts(%" PRIu64")", screenId); - colorGamuts.clear(); - colorGamuts.push_back(COLOR_GAMUT_NATIVE); - return DMError::DM_OK; + return abstractScreenController_->GetScreenSupportedColorGamuts(screenId, colorGamuts); } DMError DisplayManagerService::GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) @@ -188,8 +186,7 @@ DMError DisplayManagerService::GetScreenColorGamut(ScreenId screenId, ScreenColo } WM_SCOPED_TRACE("dms:GetScreenColorGamut(%" PRIu64")", screenId); - colorGamut = COLOR_GAMUT_NATIVE; - return DMError::DM_OK; + return abstractScreenController_->GetScreenColorGamut(screenId, colorGamut); } DMError DisplayManagerService::SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) @@ -201,33 +198,32 @@ DMError DisplayManagerService::SetScreenColorGamut(ScreenId screenId, int32_t co } WM_SCOPED_TRACE("dms:SetScreenColorGamut(%" PRIu64")", screenId); - return DMError::DM_OK; + return abstractScreenController_->SetScreenColorGamut(screenId, colorGamutIdx); } -DMError DisplayManagerService::GetScreenGamutsMap(ScreenId screenId, ScreenGamutMap& gamutMap) +DMError DisplayManagerService::GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) { - WLOGFI("GetScreenGamutsMap::ScreenId: %{public}" PRIu64 "", screenId); + WLOGFI("GetScreenGamutMap::ScreenId: %{public}" PRIu64 "", screenId); if (screenId == SCREEN_ID_INVALID) { WLOGFE("DisplayManagerService: ScreenId is invalid"); return DMError::DM_ERROR_INVALID_PARAM; } - WM_SCOPED_TRACE("dms:GetScreenGamutsMap(%" PRIu64")", screenId); + WM_SCOPED_TRACE("dms:GetScreenGamutMap(%" PRIu64")", screenId); - gamutMap = GAMUT_MAP_CONSTANT; - return DMError::DM_OK; + return abstractScreenController_->GetScreenGamutMap(screenId, gamutMap); } -DMError DisplayManagerService::SetScreenGamutsMap(ScreenId screenId, ScreenGamutMap gamutMap) +DMError DisplayManagerService::SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) { - WLOGFI("SetScreenGamutsMap::ScreenId: %{public}" PRIu64 ", ScreenGamutMap %{public}u", + WLOGFI("SetScreenGamutMap::ScreenId: %{public}" PRIu64 ", ScreenGamutMap %{public}u", screenId, static_cast(gamutMap)); if (screenId == SCREEN_ID_INVALID) { WLOGFE("DisplayManagerService: ScreenId is invalid"); return DMError::DM_ERROR_INVALID_PARAM; } - WM_SCOPED_TRACE("dms:SetScreenGamutsMap(%" PRIu64")", screenId); + WM_SCOPED_TRACE("dms:SetScreenGamutMap(%" PRIu64")", screenId); - return DMError::DM_OK; + return abstractScreenController_->SetScreenGamutMap(screenId, gamutMap); } DMError DisplayManagerService::SetScreenColorTransform(ScreenId screenId) @@ -239,7 +235,7 @@ DMError DisplayManagerService::SetScreenColorTransform(ScreenId screenId) } WM_SCOPED_TRACE("dms:SetScreenColorTransform(%" PRIu64")", screenId); - return DMError::DM_OK; + return abstractScreenController_->SetScreenColorTransform(screenId); } diff --git a/dmserver/src/display_manager_stub.cpp b/dmserver/src/display_manager_stub.cpp index a498641e..659db531 100644 --- a/dmserver/src/display_manager_stub.cpp +++ b/dmserver/src/display_manager_stub.cpp @@ -238,7 +238,7 @@ int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, case TRANS_ID_SCREEN_GET_GAMUT_MAP: { ScreenId screenId = static_cast(data.ReadUint64()); ScreenGamutMap gamutMap; - DMError ret = GetScreenGamutsMap(screenId, gamutMap); + DMError ret = GetScreenGamutMap(screenId, gamutMap); reply.WriteInt32(static_cast(ret)); if (ret != DMError::DM_OK) { break; @@ -249,7 +249,7 @@ int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, case TRANS_ID_SCREEN_SET_GAMUT_MAP: { ScreenId screenId = static_cast(data.ReadUint64()); ScreenGamutMap gamutMap = static_cast(data.ReadUint32()); - DMError ret = SetScreenGamutsMap(screenId, gamutMap); + DMError ret = SetScreenGamutMap(screenId, gamutMap); reply.WriteInt32(static_cast(ret)); break; } diff --git a/interfaces/innerkits/dm/dm_common.h b/interfaces/innerkits/dm/dm_common.h index 38c0b056..0c8e240b 100644 --- a/interfaces/innerkits/dm/dm_common.h +++ b/interfaces/innerkits/dm/dm_common.h @@ -55,6 +55,7 @@ enum class DMError : int32_t { DM_ERROR_DEATH_RECIPIENT = 150, DM_ERROR_INVALID_MODE_ID = 160, DM_ERROR_WRITE_DATA_FAILED = 170, + DM_ERROR_RENDER_SERVICE_FAILED = 180, DM_ERROR_UNKNOWN, }; using DisplayStateCallback = std::function; diff --git a/interfaces/innerkits/dm/screen.h b/interfaces/innerkits/dm/screen.h index 9b4a0761..ec8f3b5b 100644 --- a/interfaces/innerkits/dm/screen.h +++ b/interfaces/innerkits/dm/screen.h @@ -73,8 +73,8 @@ public: DMError GetScreenSupportedColorGamuts(std::vector& colorGamuts) const; DMError GetScreenColorGamut(ScreenColorGamut& colorGamut) const; DMError SetScreenColorGamut(int32_t colorGamutIdx); - DMError GetScreenGamutsMap(ScreenGamutMap& gamutMap) const; - DMError SetScreenGamutsMap(ScreenGamutMap gamutMap); + DMError GetScreenGamutMap(ScreenGamutMap& gamutMap) const; + DMError SetScreenGamutMap(ScreenGamutMap gamutMap); DMError SetScreenColorTransform(); private: