summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_processor.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-02-12 05:44:12 +0100
committerSubv <subv2112@gmail.com>2018-02-12 05:44:12 +0100
commit6cddf9d88e7fc49919fda92bcd4235797c56f07f (patch)
tree3f7da3795b5561b2d325325b72610996e2857742 /src/video_core/command_processor.cpp
parentGPU: Added a command processor to decode the GPU pushbuffers and forward the commands to their respective engines. (diff)
downloadyuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar.gz
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar.bz2
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar.lz
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar.xz
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.tar.zst
yuzu-6cddf9d88e7fc49919fda92bcd4235797c56f07f.zip
Diffstat (limited to 'src/video_core/command_processor.cpp')
-rw-r--r--src/video_core/command_processor.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index e1df875e7..21d672085 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -16,30 +16,18 @@
#include "video_core/engines/fermi_2d.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/maxwell_compute.h"
+#include "video_core/gpu.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
namespace Tegra {
-namespace CommandProcessor {
-
enum class BufferMethods {
BindObject = 0,
CountBufferMethods = 0x100,
};
-enum class EngineID {
- FERMI_TWOD_A = 0x902D, // 2D Engine
- MAXWELL_B = 0xB197, // 3D Engine
- MAXWELL_COMPUTE_B = 0xB1C0,
- KEPLER_INLINE_TO_MEMORY_B = 0xA140,
- MAXWELL_DMA_COPY_A = 0xB0B5,
-};
-
-// Mapping of subchannels to their bound engine ids.
-static std::unordered_map<u32, EngineID> bound_engines;
-
-static void WriteReg(u32 method, u32 subchannel, u32 value) {
+void GPU::WriteReg(u32 method, u32 subchannel, u32 value) {
LOG_WARNING(HW_GPU, "Processing method %08X on subchannel %u value %08X", method, subchannel,
value);
@@ -63,22 +51,25 @@ static void WriteReg(u32 method, u32 subchannel, u32 value) {
switch (engine) {
case EngineID::FERMI_TWOD_A:
- Engines::Fermi2D::WriteReg(method, value);
+ fermi_2d->WriteReg(method, value);
break;
case EngineID::MAXWELL_B:
- Engines::Maxwell3D::WriteReg(method, value);
+ maxwell_3d->WriteReg(method, value);
break;
case EngineID::MAXWELL_COMPUTE_B:
- Engines::MaxwellCompute::WriteReg(method, value);
+ maxwell_compute->WriteReg(method, value);
break;
default:
UNIMPLEMENTED();
}
}
-void ProcessCommandList(VAddr address, u32 size) {
- VAddr current_addr = address;
- while (current_addr < address + size * sizeof(CommandHeader)) {
+void GPU::ProcessCommandList(GPUVAddr address, u32 size) {
+ // TODO(Subv): PhysicalToVirtualAddress is a misnomer, it converts a GPU VAddr into an
+ // application VAddr.
+ const VAddr head_address = memory_manager->PhysicalToVirtualAddress(address);
+ VAddr current_addr = head_address;
+ while (current_addr < head_address + size * sizeof(CommandHeader)) {
const CommandHeader header = {Memory::Read32(current_addr)};
current_addr += sizeof(u32);
@@ -125,6 +116,4 @@ void ProcessCommandList(VAddr address, u32 size) {
}
}
-} // namespace CommandProcessor
-
} // namespace Tegra