From 1b2872eebc84ef3b35f8c0456ccb22519059d66a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Feb 2019 17:20:02 -0500 Subject: service/vi: Remove use of a module class This didn't really provide much benefit here, especially since the subsequent change requires that the behavior for each service's GetDisplayService differs in a minor detail. This also arguably makes the services nicer to read, since it gets rid of an indirection in the class hierarchy. --- src/core/hle/service/vi/vi_u.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/vi/vi_u.cpp') diff --git a/src/core/hle/service/vi/vi_u.cpp b/src/core/hle/service/vi/vi_u.cpp index d81e410d6..ef09a5df5 100644 --- a/src/core/hle/service/vi/vi_u.cpp +++ b/src/core/hle/service/vi/vi_u.cpp @@ -2,12 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/log.h" +#include "core/hle/service/vi/vi.h" #include "core/hle/service/vi/vi_u.h" namespace Service::VI { -VI_U::VI_U(std::shared_ptr module, std::shared_ptr nv_flinger) - : Module::Interface(std::move(module), "vi:u", std::move(nv_flinger)) { +VI_U::VI_U(std::shared_ptr nv_flinger) + : ServiceFramework{"vi:u"}, nv_flinger{std::move(nv_flinger)} { static const FunctionInfo functions[] = { {0, &VI_U::GetDisplayService, "GetDisplayService"}, }; @@ -16,4 +18,10 @@ VI_U::VI_U(std::shared_ptr module, std::shared_ptr VI_U::~VI_U() = default; +void VI_U::GetDisplayService(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_VI, "(STUBBED) called"); + + detail::GetDisplayServiceImpl(ctx, nv_flinger); +} + } // namespace Service::VI -- cgit v1.2.3 From 92ea1c32d608cd258c3fc077f5aaf953536d7f45 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Feb 2019 17:49:32 -0500 Subject: service/vi: Unstub GetDisplayService This function is also supposed to check its given policy type with the permission of the service itself. This implements the necessary machinery to unstub these functions. Policy::User seems to just be basic access (which is probably why vi:u is restricted to that policy), while the other policy seems to be for extended abilities regarding which displays can be managed and queried, so this is assumed to be for a background compositor (which I've named, appropriately, Policy::Compositor). --- src/core/hle/service/vi/vi_u.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/vi/vi_u.cpp') diff --git a/src/core/hle/service/vi/vi_u.cpp b/src/core/hle/service/vi/vi_u.cpp index ef09a5df5..9d5ceb608 100644 --- a/src/core/hle/service/vi/vi_u.cpp +++ b/src/core/hle/service/vi/vi_u.cpp @@ -19,9 +19,9 @@ VI_U::VI_U(std::shared_ptr nv_flinger) VI_U::~VI_U() = default; void VI_U::GetDisplayService(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_VI, "(STUBBED) called"); + LOG_DEBUG(Service_VI, "called"); - detail::GetDisplayServiceImpl(ctx, nv_flinger); + detail::GetDisplayServiceImpl(ctx, nv_flinger, Permission::User); } } // namespace Service::VI -- cgit v1.2.3