This commit is contained in:
plutooo 2018-03-25 17:47:52 +02:00 committed by fincs
parent a3a2e57fc2
commit de93886c56
3 changed files with 8 additions and 6 deletions

View File

@ -9,5 +9,5 @@ typedef struct NvGpu {
NvErrorNotifier error_notifier; NvErrorNotifier error_notifier;
} NvGpu; } NvGpu;
Result nvgpuCreate(NvGpu* g); Result nvGpuCreate(NvGpu* g);
void nvgpuClose(NvGpu* g); void nvGpuClose(NvGpu* g);

View File

@ -1,6 +1,6 @@
#include <switch.h> #include <switch.h>
Result nvgpuCreate(NvGpu* g) Result nvGpuCreate(NvGpu* g)
{ {
Result rc; Result rc;
@ -42,12 +42,12 @@ Result nvgpuCreate(NvGpu* g)
rc = nvZcullContextCreate(&g->zcull_ctx, g); rc = nvZcullContextCreate(&g->zcull_ctx, g);
if (R_FAILED(rc)) if (R_FAILED(rc))
nvgpuClose(g); nvGpuClose(g);
return rc; return rc;
} }
void nvgpuClose(NvGpu* g) void nvGpuClose(NvGpu* g)
{ {
nvBufferExit(); nvBufferExit();
nvInfoExit(); nvInfoExit();

View File

@ -14,10 +14,12 @@ Result nvioctlNvhostCtrl_SyncptRead(u32 fd, u32 id, u32* out)
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
data.syncpt_id = id; data.syncpt_id = id;
Result rc;
rc = nvIoctl(fd, _NV_IOWR(0x00, 0x14, data), &data); rc = nvIoctl(fd, _NV_IOWR(0x00, 0x14, data), &data);
if (R_SUCCEEDED(rc)) { if (R_SUCCEEDED(rc)) {
*out = value; *out = data.value;
} }
return rc; return rc;