mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +02:00
Updated bufferProducerGraphicBuffer struct.
This commit is contained in:
parent
dd4a9bbca6
commit
917036cec6
@ -26,7 +26,20 @@ typedef struct {
|
|||||||
} PACKED bufferProducerQueueBufferOutput;
|
} PACKED bufferProducerQueueBufferOutput;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u32 unk[0x16c>>2];
|
u32 magic;
|
||||||
|
u32 width;
|
||||||
|
u32 height;
|
||||||
|
u32 stride;
|
||||||
|
u32 format;
|
||||||
|
u32 usage;
|
||||||
|
|
||||||
|
u32 pid;
|
||||||
|
u32 refcount;
|
||||||
|
|
||||||
|
u32 numFds;
|
||||||
|
u32 numInts;
|
||||||
|
|
||||||
|
u32 data[0x144>>2];//Actual size is numFds*4 + numInts*4.
|
||||||
} PACKED bufferProducerGraphicBuffer;
|
} PACKED bufferProducerGraphicBuffer;
|
||||||
|
|
||||||
//From Android window.h.
|
//From Android window.h.
|
||||||
|
@ -49,12 +49,21 @@ static u64 g_nvgfx_gpfifo_pos = 0;
|
|||||||
//Some of this struct is based on tegra_dc_ext_flip_windowattr.
|
//Some of this struct is based on tegra_dc_ext_flip_windowattr.
|
||||||
//TODO: How much of this struct do official apps really set? Most of it seems to be used as-is from the bufferProducerRequestBuffer() output.
|
//TODO: How much of this struct do official apps really set? Most of it seems to be used as-is from the bufferProducerRequestBuffer() output.
|
||||||
static bufferProducerGraphicBuffer g_gfxprod_BufferInitData = {
|
static bufferProducerGraphicBuffer g_gfxprod_BufferInitData = {
|
||||||
.unk = {
|
.magic = 0x47424652,//"RFBG"/'GBFR'
|
||||||
0x47424652,
|
.width = 1280,
|
||||||
1280, 720,
|
.height = 720,
|
||||||
1280,
|
.stride = 1280,
|
||||||
0x1, 0xb00, 0x2a, 0x0,
|
.format = 0x1,
|
||||||
0x0, 0x51, 0xffffffff,
|
.usage = 0xb00,
|
||||||
|
|
||||||
|
.pid = 0x2a, //Official sw sets this to the output of "getpid()", which calls a func which is hard-coded for returning 0x2a.
|
||||||
|
.refcount = 0x0, //Official sw sets this to the output of "android_atomic_inc()".
|
||||||
|
|
||||||
|
.numFds = 0x0,
|
||||||
|
.numInts = sizeof(g_gfxprod_BufferInitData.data)>>2,//0x51
|
||||||
|
|
||||||
|
.data = {
|
||||||
|
0xffffffff,
|
||||||
0x0, //nvmap handle
|
0x0, //nvmap handle
|
||||||
0x0, 0xdaffcaff, 0x2a, 0x0,
|
0x0, 0xdaffcaff, 0x2a, 0x0,
|
||||||
0xb00, 0x1, 0x1, 1280,
|
0xb00, 0x1, 0x1, 1280,
|
||||||
@ -134,7 +143,7 @@ Result nvgfxInitialize(void) {
|
|||||||
u32 pos=0, i=0;
|
u32 pos=0, i=0;
|
||||||
s32 tmp=0;
|
s32 tmp=0;
|
||||||
u32 tmpval=0;
|
u32 tmpval=0;
|
||||||
u64 *ptr64 = (u64*)g_gfxprod_BufferInitData.unk;
|
u64 *ptr64 = (u64*)g_gfxprod_BufferInitData.data;
|
||||||
if(g_nvgfxInitialized)return 0;
|
if(g_nvgfxInitialized)return 0;
|
||||||
|
|
||||||
u32 framebuf_nvmap_handle = 0;//Special handle ID for framebuf/windowbuf.
|
u32 framebuf_nvmap_handle = 0;//Special handle ID for framebuf/windowbuf.
|
||||||
@ -313,11 +322,11 @@ Result nvgfxInitialize(void) {
|
|||||||
|
|
||||||
//The above gets a nvmap_handle, but normally it's the same value passed to nvioctlNvmap_GetId().
|
//The above gets a nvmap_handle, but normally it's the same value passed to nvioctlNvmap_GetId().
|
||||||
|
|
||||||
g_gfxprod_BufferInitData.unk[0x7] = i;
|
g_gfxprod_BufferInitData.refcount = i;
|
||||||
g_gfxprod_BufferInitData.unk[0xb] = tmpval;
|
g_gfxprod_BufferInitData.data[0x1] = tmpval;
|
||||||
g_gfxprod_BufferInitData.unk[0x1d] = tmpval;
|
g_gfxprod_BufferInitData.data[0x13] = tmpval;
|
||||||
g_gfxprod_BufferInitData.unk[0x1e] = g_nvgfx_singleframebuf_size*i;
|
g_gfxprod_BufferInitData.data[0x14] = g_nvgfx_singleframebuf_size*i;
|
||||||
ptr64[0x164>>3] = svcGetSystemTick();
|
ptr64[0x13c>>3] = svcGetSystemTick();
|
||||||
rc = bufferProducerGraphicBufferInit(i, &g_gfxprod_BufferInitData);
|
rc = bufferProducerGraphicBufferInit(i, &g_gfxprod_BufferInitData);
|
||||||
if (R_FAILED(rc)) break;
|
if (R_FAILED(rc)) break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user