[rpcsx-os] implement fw simulation

implement impi messages
This commit is contained in:
DH 2023-12-27 20:07:30 +03:00
parent 2278a298ac
commit 6ba0ad0832
8 changed files with 516 additions and 153 deletions

View file

@ -1,6 +1,5 @@
#pragma once
#include "orbis/utils/SharedMutex.hpp"
#include <atomic>
#include <cstdint>
#include <cstring>
@ -8,6 +7,8 @@
#include <orbis/utils/SharedCV.hpp>
namespace amdgpu::bridge {
extern std::uint32_t expGpuPid;
struct PadState {
std::uint64_t timestamp;
std::uint32_t unk;
@ -149,21 +150,21 @@ struct BridgePusher {
void sendMemoryProtect(std::uint32_t pid, std::uint64_t address,
std::uint64_t size, std::uint32_t prot) {
if (pid == 50001) {
if (pid == expGpuPid) {
sendCommand(CommandId::ProtectMemory, {pid, address, size, prot});
}
}
void sendCommandBuffer(std::uint32_t pid, std::uint64_t queue,
std::uint64_t address, std::uint64_t size) {
if (pid == 50001) {
if (pid == expGpuPid) {
sendCommand(CommandId::CommandBuffer, {pid, queue, address, size});
}
}
void sendFlip(std::uint32_t pid, std::uint32_t bufferIndex,
std::uint64_t arg) {
if (pid == 50001) {
if (pid == expGpuPid) {
sendCommand(CommandId::Flip, {pid, bufferIndex, arg});
}
}

View file

@ -8,6 +8,8 @@
static int gShmFd = -1;
static constexpr std::size_t kShmSize = sizeof(amdgpu::bridge::BridgeHeader) +
(sizeof(std::uint64_t) * (1024 * 1024));
std::uint32_t amdgpu::bridge::expGpuPid = 0;
amdgpu::bridge::BridgeHeader *
amdgpu::bridge::createShmCommandBuffer(const char *name) {
if (gShmFd != -1) {