mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 12:45:44 +00:00
nvdrv: Get rid of global std::weak_ptr
Rather than use global state, we can simply pass the instance into the NVFlinger instance directly.
This commit is contained in:
parent
78f6dc04ef
commit
e8824d065b
5 changed files with 22 additions and 11 deletions
|
@ -46,6 +46,10 @@ NVFlinger::~NVFlinger() {
|
|||
CoreTiming::UnscheduleEvent(composition_event, 0);
|
||||
}
|
||||
|
||||
void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) {
|
||||
nvdrv = std::move(instance);
|
||||
}
|
||||
|
||||
u64 NVFlinger::OpenDisplay(std::string_view name) {
|
||||
LOG_WARNING(Service, "Opening display {}", name);
|
||||
|
||||
|
@ -141,9 +145,6 @@ void NVFlinger::Compose() {
|
|||
auto& igbp_buffer = buffer->igbp_buffer;
|
||||
|
||||
// Now send the buffer to the GPU for drawing.
|
||||
auto nvdrv = Nvidia::nvdrv.lock();
|
||||
ASSERT(nvdrv);
|
||||
|
||||
// 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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue