18 changed files with 12 additions and 242 deletions
-
2src/core/CMakeLists.txt
-
11src/core/core.cpp
-
10src/core/core.h
-
32src/core/hardware_interrupt_manager.cpp
-
32src/core/hardware_interrupt_manager.h
-
26src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
-
2src/core/hle/service/nvdrv/devices/nvhost_ctrl.h
-
7src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
-
21src/core/hle/service/nvdrv/nvdrv.cpp
-
7src/core/hle/service/nvdrv/nvdrv.h
-
4src/core/hle/service/nvdrv/nvdrv_interface.cpp
-
2src/core/hle/service/nvdrv/nvdrv_interface.h
-
29src/video_core/command_classes/host1x.cpp
-
48src/video_core/gpu.cpp
-
9src/video_core/gpu.h
-
4src/video_core/host1x/syncpoint_manager.cpp
-
4src/video_core/renderer_opengl/gl_rasterizer.cpp
-
4src/video_core/renderer_vulkan/vk_rasterizer.cpp
@ -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); |
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue