service/gsp: Migrate gsp_lcd to ServiceFramework

This commit is contained in:
NarcolepticK 2018-06-27 10:40:37 -04:00
parent 438751075f
commit 188979b3e2
5 changed files with 22 additions and 23 deletions

View File

@ -11,6 +11,7 @@ namespace Service {
namespace GSP { namespace GSP {
static std::weak_ptr<GSP_GPU> gsp_gpu; static std::weak_ptr<GSP_GPU> gsp_gpu;
static std::weak_ptr<GSP_LCD> gsp_lcd;
FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) { FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
auto gpu = gsp_gpu.lock(); auto gpu = gsp_gpu.lock();
@ -27,8 +28,11 @@ void SignalInterrupt(InterruptId interrupt_id) {
void InstallInterfaces(SM::ServiceManager& service_manager) { void InstallInterfaces(SM::ServiceManager& service_manager) {
auto gpu = std::make_shared<GSP_GPU>(); auto gpu = std::make_shared<GSP_GPU>();
gpu->InstallAsService(service_manager); gpu->InstallAsService(service_manager);
gsp_gpu = gpu; gsp_gpu = gpu;
auto lcd = std::make_shared<GSP_LCD>();
lcd->InstallAsService(service_manager);
gsp_lcd = lcd;
} }
} // namespace GSP } // namespace GSP

View File

@ -9,6 +9,7 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/gsp/gsp_gpu.h" #include "core/hle/service/gsp/gsp_gpu.h"
#include "core/hle/service/gsp/gsp_lcd.h"
namespace Service { namespace Service {
namespace GSP { namespace GSP {

View File

@ -2,13 +2,14 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/gsp/gsp_lcd.h" #include "core/hle/service/gsp/gsp_lcd.h"
namespace Service { namespace Service {
namespace GSP { namespace GSP {
const Interface::FunctionInfo FunctionTable[] = { GSP_LCD::GSP_LCD() : ServiceFramework("gsp::Lcd") {
// clang-format off static const FunctionInfo functions[] = {
{0x000A0080, nullptr, "SetBrightnessRaw"}, {0x000A0080, nullptr, "SetBrightnessRaw"},
{0x000B0080, nullptr, "SetBrightness"}, {0x000B0080, nullptr, "SetBrightness"},
{0x000F0000, nullptr, "PowerOnAllBacklights"}, {0x000F0000, nullptr, "PowerOnAllBacklights"},
@ -18,12 +19,9 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x00130040, nullptr, "SetLedForceOff"}, {0x00130040, nullptr, "SetLedForceOff"},
{0x00140000, nullptr, "GetVendor"}, {0x00140000, nullptr, "GetVendor"},
{0x00150040, nullptr, "GetBrightness"}, {0x00150040, nullptr, "GetBrightness"},
// clang-format on
}; };
RegisterHandlers(functions);
GSP_LCD::GSP_LCD() { };
Register(FunctionTable);
}
} // namespace GSP } // namespace GSP
} // namespace Service } // namespace Service

View File

@ -9,13 +9,10 @@
namespace Service { namespace Service {
namespace GSP { namespace GSP {
class GSP_LCD final : public Interface { class GSP_LCD final : public ServiceFramework<GSP_LCD> {
public: public:
GSP_LCD(); GSP_LCD();
~GSP_LCD() = default;
std::string GetPortName() const override {
return "gsp::Lcd";
}
}; };
} // namespace GSP } // namespace GSP

View File

@ -258,7 +258,6 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
AddService(new CSND::CSND_SND); AddService(new CSND::CSND_SND);
AddService(new DSP_DSP::Interface); AddService(new DSP_DSP::Interface);
AddService(new GSP::GSP_LCD);
AddService(new HTTP::HTTP_C); AddService(new HTTP::HTTP_C);
AddService(new PM::PM_APP); AddService(new PM::PM_APP);
AddService(new SOC::SOC_U); AddService(new SOC::SOC_U);