From 27f5aecea81fda5b6524f80b11fb9d22a72f47bd Mon Sep 17 00:00:00 2001 From: fincs Date: Tue, 28 Aug 2018 13:16:27 +0200 Subject: [PATCH] nvgfx: Strip down to bare minimum - remove unused logic --- nx/source/display/gfx.c | 4 +- nx/source/display/nvgfx.c | 160 +++++++++----------------------------- 2 files changed, 37 insertions(+), 127 deletions(-) diff --git a/nx/source/display/gfx.c b/nx/source/display/gfx.c index c9ff36d8..58662c11 100644 --- a/nx/source/display/gfx.c +++ b/nx/source/display/gfx.c @@ -435,9 +435,9 @@ void gfxConfigureAutoResolutionDefault(bool enable) { gfxConfigureAutoResolution(enable, 1280, 720, 0, 0); } -Result _gfxGraphicBufferInit(s32 buf, u32 nvmap_handle) { +Result _gfxGraphicBufferInit(s32 buf, u32 nvmap_id, u32 nvmap_handle) { g_gfx_BufferInitData.refcount = buf; - g_gfx_BufferInitData.data.nvmap_handle0 = nvmap_handle; + g_gfx_BufferInitData.data.nvmap_handle0 = nvmap_id; g_gfx_BufferInitData.data.nvmap_handle1 = nvmap_handle; g_gfx_BufferInitData.data.buffer_offset = g_gfx_singleframebuf_size*buf; g_gfx_BufferInitData.data.timestamp = svcGetSystemTick(); diff --git a/nx/source/display/nvgfx.c b/nx/source/display/nvgfx.c index 6cdeb1e4..f07d76ff 100644 --- a/nx/source/display/nvgfx.c +++ b/nx/source/display/nvgfx.c @@ -17,28 +17,17 @@ typedef struct { size_t mem_size; } nvmapobj; -static bool g_nvgfxInitialized = 0; -static u32 g_nvgfx_fd_nvhostctrlgpu; -static u32 g_nvgfx_fd_nvhostasgpu; +static bool g_nvgfxInitialized; static u32 g_nvgfx_fd_nvmap; -static u32 g_nvgfx_fd_nvhostgpu; static u32 g_nvgfx_fd_nvhostctrl; -static nvioctl_gpu_characteristics g_nvgfx_gpu_characteristics; -static nvioctl_fence g_nvgfx_nvhost_fence; +u32 g_nvgfx_totalframebufs = 2; -u32 g_nvgfx_totalframebufs = 0; - -static nvmapobj nvmap_objs[18]; - -static u64 nvmap_obj4_mapbuffer_x0_offset; -static u64 nvmap_obj6_mapbuffer_xdb_offset; - -static u64 g_nvgfx_gpfifo_pos = 0; +static nvmapobj nvmap_fb_obj; extern size_t g_gfx_singleframebuf_size; -Result _gfxGraphicBufferInit(s32 buf, u32 nvmap_handle); +Result _gfxGraphicBufferInit(s32 buf, u32 nvmap_id, u32 nvmap_handle); static Result nvmapobjInitialize(nvmapobj *obj, size_t size) { Result rc=0; @@ -71,12 +60,6 @@ static void nvmapobjClose(nvmapobj *obj) { memset(obj, 0, sizeof(nvmapobj)); } -static void nvmapobjCloseAll(void) { - u32 pos=0; - - for(pos=0; pos