diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-05 01:44:11 +0100 |
|---|---|---|
| committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:51 +0200 |
| commit | af35dbcf633d35450b333eb33334b3dd1bc050a1 (patch) | |
| tree | 94e721b8a23f9659d616f70157574d6826263070 /src/core/hle/service/nvflinger/nvflinger.cpp | |
| parent | de0e8eff429b4374c18e3325ad3747db55bddddd (diff) | |
NVDRV: Fix Open/Close and make sure each device is correctly created.
Diffstat (limited to 'src/core/hle/service/nvflinger/nvflinger.cpp')
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 4246e5e25..8c3013f83 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -105,10 +105,15 @@ NVFlinger::~NVFlinger() { display.GetLayer(layer).Core().NotifyShutdown(); } } + + if (nvdrv) { + nvdrv->Close(disp_fd); + } } void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) { nvdrv = std::move(instance); + disp_fd = nvdrv->Open("/dev/nvdisp_disp0"); } std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) { @@ -276,7 +281,7 @@ void NVFlinger::Compose() { // Now send the buffer to the GPU for drawing. // TODO(Subv): Support more than just disp0. The display device selection is probably based // on which display we're drawing (Default, Internal, External, etc) - auto nvdisp = nvdrv->GetDevice<Nvidia::Devices::nvdisp_disp0>("/dev/nvdisp_disp0"); + auto nvdisp = nvdrv->GetDevice<Nvidia::Devices::nvdisp_disp0>(disp_fd); ASSERT(nvdisp); Common::Rectangle<int> crop_rect{ |
