NVDRV: Further refactors and eliminate old code.
parent
2931101e6f
commit
920429fde7
@ -1,32 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#include "core/core.h"
|
|
||||||
#include "core/core_timing.h"
|
|
||||||
#include "core/hardware_interrupt_manager.h"
|
|
||||||
#include "core/hle/service/nvdrv/nvdrv_interface.h"
|
|
||||||
#include "core/hle/service/sm/sm.h"
|
|
||||||
|
|
||||||
namespace Core::Hardware {
|
|
||||||
|
|
||||||
InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) {
|
|
||||||
gpu_interrupt_event = Core::Timing::CreateEvent(
|
|
||||||
"GPUInterrupt",
|
|
||||||
[this](std::uintptr_t message, u64 time,
|
|
||||||
std::chrono::nanoseconds) -> std::optional<std::chrono::nanoseconds> {
|
|
||||||
auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv");
|
|
||||||
const u32 syncpt = static_cast<u32>(message >> 32);
|
|
||||||
const u32 value = static_cast<u32>(message);
|
|
||||||
nvdrv->SignalGPUInterruptSyncpt(syncpt, value);
|
|
||||||
return std::nullopt;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
InterruptManager::~InterruptManager() = default;
|
|
||||||
|
|
||||||
void InterruptManager::GPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
|
|
||||||
const u64 msg = (static_cast<u64>(syncpoint_id) << 32ULL) | value;
|
|
||||||
system.CoreTiming().ScheduleEvent(std::chrono::nanoseconds{10}, gpu_interrupt_event, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Core::Hardware
|
|
@ -1,32 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "common/common_types.h"
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
class System;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Core::Timing {
|
|
||||||
struct EventType;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Core::Hardware {
|
|
||||||
|
|
||||||
class InterruptManager {
|
|
||||||
public:
|
|
||||||
explicit InterruptManager(Core::System& system);
|
|
||||||
~InterruptManager();
|
|
||||||
|
|
||||||
void GPUInterruptSyncpt(u32 syncpoint_id, u32 value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Core::System& system;
|
|
||||||
std::shared_ptr<Core::Timing::EventType> gpu_interrupt_event;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Core::Hardware
|
|
@ -1,29 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#include "common/assert.h"
|
|
||||||
#include "video_core/command_classes/host1x.h"
|
|
||||||
#include "video_core/gpu.h"
|
|
||||||
|
|
||||||
Tegra::Host1x::Host1x(GPU& gpu_) : gpu(gpu_) {}
|
|
||||||
|
|
||||||
Tegra::Host1x::~Host1x() = default;
|
|
||||||
|
|
||||||
void Tegra::Host1x::ProcessMethod(Method method, u32 argument) {
|
|
||||||
switch (method) {
|
|
||||||
case Method::LoadSyncptPayload32:
|
|
||||||
syncpoint_value = argument;
|
|
||||||
break;
|
|
||||||
case Method::WaitSyncpt:
|
|
||||||
case Method::WaitSyncpt32:
|
|
||||||
Execute(argument);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
UNIMPLEMENTED_MSG("Host1x method 0x{:X}", static_cast<u32>(method));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Tegra::Host1x::Execute(u32 data) {
|
|
||||||
gpu.WaitFence(data, syncpoint_value);
|
|
||||||
}
|
|
Loading…
Reference in New Issue