Minor fixes, now gets to whitescreen

This commit is contained in:
plutoo 2018-03-10 18:08:02 +01:00
parent 694714994b
commit 1aebc58a32
6 changed files with 16 additions and 11 deletions

View File

@ -250,6 +250,7 @@ typedef struct {
} NvBuffer;
Result nvbufInit(void);
u32 nvbufGetNvmapFd(void);
void nvbufExit(void);
Result nvbufCreate(NvBuffer* m, size_t size, u32 align, NvBufferKind kind);

View File

@ -9,3 +9,4 @@ Result nvchannelCreate(NvChannel* c, const char* dev);
void nvchannelClose(NvChannel* c);
Result nvchannelSetPriority(NvChannel* c, NvChannelPriority prio);
Result nvchannelSetNvmapFd(NvChannel* c);

View File

@ -12,7 +12,7 @@ Result nvasCreate(NvAddressSpace* a)
a->fd = -1;
if (R_SUCCEEDED(rc))
rc = nvioctlNvhostAsGpu_InitializeEx(a->fd, 1, 0x100);
rc = nvioctlNvhostAsGpu_InitializeEx(a->fd, 1, 0x10000);
if (R_FAILED(rc))
nvasClose(a);
@ -47,14 +47,6 @@ Result nvasMapBuffer(NvAddressSpace* a, NvBuffer* buffer, NvBufferKind kind, iov
return nvioctlNvhostAsGpu_MapBufferEx(a->fd, 0, kind, buffer->fd, 0, 0, buffer->size, 0, iova_out);
}
Result nvasBindToChannel(NvAddressSpace* a, NvChannel* channel)
{
Result rc;
rc = nvioctlNvhostAsGpu_BindChannel(a->fd, channel->fd);
if (R_SUCCEEDED(rc))
rc = nvioctlChannel_SetNvmapFd(channel->fd, a->fd);
return rc;
Result nvasBindToChannel(NvAddressSpace* a, NvChannel* channel) {
return nvioctlNvhostAsGpu_BindChannel(a->fd, channel->fd);
}

View File

@ -35,6 +35,10 @@ void nvbufExit(void)
}
}
u32 nvbufGetNvmapFd(void) {
return g_nvmap_fd;
}
static Result _nvbufCreate(NvBuffer* m, size_t size, u32 flags, u32 align, NvBufferKind kind)
{
Result rc;

View File

@ -31,3 +31,7 @@ void nvchannelClose(NvChannel* c)
Result nvchannelSetPriority(NvChannel* c, NvChannelPriority prio) {
return nvioctlChannel_SetPriority(c->fd, prio);
}
Result nvchannelSetNvmapFd(NvChannel* c) {
return nvioctlChannel_SetNvmapFd(c->fd, nvbufGetNvmapFd());
}

View File

@ -21,6 +21,9 @@ Result nvgpuCreate(NvGpu* g)
if (R_SUCCEEDED(rc))
rc = nvasBindToChannel(&g->addr_space, &g->gpu_channel);
if (R_SUCCEEDED(rc))
rc = nvchannelSetNvmapFd(&g->gpu_channel);
if (R_SUCCEEDED(rc))
rc = nvfifoCreate(&g->gpfifo, &g->gpu_channel);