mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Rename NvInfo to NvGpu
This commit is contained in:
parent
c5f8275978
commit
412c84d5f9
@ -89,12 +89,12 @@ extern "C" {
|
|||||||
#include "switch/display/native_window.h"
|
#include "switch/display/native_window.h"
|
||||||
|
|
||||||
#include "switch/nvidia/ioctl.h"
|
#include "switch/nvidia/ioctl.h"
|
||||||
#include "switch/nvidia/map.h"
|
|
||||||
#include "switch/nvidia/graphic_buffer.h"
|
#include "switch/nvidia/graphic_buffer.h"
|
||||||
|
#include "switch/nvidia/fence.h"
|
||||||
|
#include "switch/nvidia/map.h"
|
||||||
#include "switch/nvidia/address_space.h"
|
#include "switch/nvidia/address_space.h"
|
||||||
#include "switch/nvidia/channel.h"
|
#include "switch/nvidia/channel.h"
|
||||||
#include "switch/nvidia/info.h"
|
#include "switch/nvidia/gpu.h"
|
||||||
#include "switch/nvidia/fence.h"
|
|
||||||
#include "switch/nvidia/gpu_channel.h"
|
#include "switch/nvidia/gpu_channel.h"
|
||||||
|
|
||||||
#include "switch/audio/driver.h"
|
#include "switch/audio/driver.h"
|
||||||
|
9
nx/include/switch/nvidia/gpu.h
Normal file
9
nx/include/switch/nvidia/gpu.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "types.h"
|
||||||
|
#include "ioctl.h"
|
||||||
|
|
||||||
|
Result nvGpuInit(void);
|
||||||
|
void nvGpuExit(void);
|
||||||
|
|
||||||
|
const nvioctl_gpu_characteristics* nvGpuGetCharacteristics(void);
|
||||||
|
u32 nvGpuGetZcullCtxSize(void);
|
@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "types.h"
|
|
||||||
#include "ioctl.h"
|
|
||||||
|
|
||||||
Result nvInfoInit(void);
|
|
||||||
void nvInfoExit(void);
|
|
||||||
|
|
||||||
const nvioctl_gpu_characteristics* nvInfoGetGpuCharacteristics(void);
|
|
||||||
u32 nvInfoGetZcullCtxSize(void);
|
|
@ -5,7 +5,7 @@
|
|||||||
#include "kernel/svc.h"
|
#include "kernel/svc.h"
|
||||||
#include "services/nv.h"
|
#include "services/nv.h"
|
||||||
#include "nvidia/ioctl.h"
|
#include "nvidia/ioctl.h"
|
||||||
#include "nvidia/info.h"
|
#include "nvidia/gpu.h"
|
||||||
|
|
||||||
static u32 g_ctrlgpu_fd = -1;
|
static u32 g_ctrlgpu_fd = -1;
|
||||||
static u64 g_refCnt;
|
static u64 g_refCnt;
|
||||||
@ -13,7 +13,7 @@ static u64 g_refCnt;
|
|||||||
static nvioctl_gpu_characteristics g_gpu_characteristics;
|
static nvioctl_gpu_characteristics g_gpu_characteristics;
|
||||||
static u32 g_zcull_ctx_size;
|
static u32 g_zcull_ctx_size;
|
||||||
|
|
||||||
Result nvInfoInit(void)
|
Result nvGpuInit(void)
|
||||||
{
|
{
|
||||||
Result rc;
|
Result rc;
|
||||||
|
|
||||||
@ -32,15 +32,14 @@ Result nvInfoInit(void)
|
|||||||
rc = nvioctlNvhostCtrlGpu_ZCullGetCtxSize(g_ctrlgpu_fd, &g_zcull_ctx_size);
|
rc = nvioctlNvhostCtrlGpu_ZCullGetCtxSize(g_ctrlgpu_fd, &g_zcull_ctx_size);
|
||||||
|
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
nvInfoExit();
|
nvGpuExit();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nvInfoExit(void)
|
void nvGpuExit(void)
|
||||||
{
|
{
|
||||||
if (atomicDecrement64(&g_refCnt) == 0)
|
if (atomicDecrement64(&g_refCnt) == 0) {
|
||||||
{
|
|
||||||
if (g_ctrlgpu_fd != -1)
|
if (g_ctrlgpu_fd != -1)
|
||||||
nvClose(g_ctrlgpu_fd);
|
nvClose(g_ctrlgpu_fd);
|
||||||
|
|
||||||
@ -48,10 +47,12 @@ void nvInfoExit(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const nvioctl_gpu_characteristics* nvInfoGetGpuCharacteristics(void) {
|
const nvioctl_gpu_characteristics* nvGpuGetCharacteristics(void)
|
||||||
|
{
|
||||||
return &g_gpu_characteristics;
|
return &g_gpu_characteristics;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvInfoGetZcullCtxSize(void) {
|
u32 nvGpuGetZcullCtxSize(void)
|
||||||
|
{
|
||||||
return g_zcull_ctx_size;
|
return g_zcull_ctx_size;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user