|
|
@ -2,6 +2,7 @@
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <map>
|
|
|
|
#include <map>
|
|
|
|
#include "common/assert.h"
|
|
|
|
#include "common/assert.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
@ -13,8 +14,8 @@ namespace Nvidia {
|
|
|
|
namespace Devices {
|
|
|
|
namespace Devices {
|
|
|
|
|
|
|
|
|
|
|
|
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%llx, output_size=0x%llx",
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
|
|
|
|
command, input.size(), output.size());
|
|
|
|
command.raw, input.size(), output.size());
|
|
|
|
|
|
|
|
|
|
|
|
switch (static_cast<IoctlCommand>(command.raw)) {
|
|
|
|
switch (static_cast<IoctlCommand>(command.raw)) {
|
|
|
|
case IoctlCommand::IocSetNVMAPfdCommand:
|
|
|
|
case IoctlCommand::IocSetNVMAPfdCommand:
|
|
|
@ -74,7 +75,8 @@ u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& out
|
|
|
|
|
|
|
|
|
|
|
|
u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
std::memcpy(&zcull_params, input.data(), input.size());
|
|
|
|
std::memcpy(&zcull_params, input.data(), input.size());
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called, gpu_va=%lx, mode=%x", zcull_params.gpu_va, zcull_params.mode);
|
|
|
|
LOG_DEBUG(Service_NVDRV, "called, gpu_va=%" PRIx64 ", mode=%x", zcull_params.gpu_va,
|
|
|
|
|
|
|
|
zcull_params.mode);
|
|
|
|
std::memcpy(output.data(), &zcull_params, output.size());
|
|
|
|
std::memcpy(output.data(), &zcull_params, output.size());
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -82,8 +84,8 @@ u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output)
|
|
|
|
u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
|
|
|
|
IoctlSetErrorNotifier params{};
|
|
|
|
IoctlSetErrorNotifier params{};
|
|
|
|
std::memcpy(¶ms, input.data(), input.size());
|
|
|
|
std::memcpy(¶ms, input.data(), input.size());
|
|
|
|
LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset=%lx, size=%lx, mem=%x", params.offset,
|
|
|
|
LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset=%" PRIx64 ", size=%" PRIx64 ", mem=%x",
|
|
|
|
params.size, params.mem);
|
|
|
|
params.offset, params.size, params.mem);
|
|
|
|
std::memcpy(output.data(), ¶ms, output.size());
|
|
|
|
std::memcpy(output.data(), ¶ms, output.size());
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -123,7 +125,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
|
|
|
|
UNIMPLEMENTED();
|
|
|
|
UNIMPLEMENTED();
|
|
|
|
IoctlSubmitGpfifo params{};
|
|
|
|
IoctlSubmitGpfifo params{};
|
|
|
|
std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo));
|
|
|
|
std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo));
|
|
|
|
LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo=%lx, num_entries=%x, flags=%x",
|
|
|
|
LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo=%" PRIx64 ", num_entries=%x, flags=%x",
|
|
|
|
params.gpfifo, params.num_entries, params.flags);
|
|
|
|
params.gpfifo, params.num_entries, params.flags);
|
|
|
|
|
|
|
|
|
|
|
|
auto entries = std::vector<IoctlGpfifoEntry>();
|
|
|
|
auto entries = std::vector<IoctlGpfifoEntry>();
|
|
|
|