mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Renamed gfxproducerBufferInit to gfxproducerTegraBufferInit. Use an enum for the binder 'code' for this. Added comments for the BufferInitData structure.
This commit is contained in:
parent
fbce1e8029
commit
283fdabbf6
@ -6,4 +6,4 @@ Result gfxproducerDequeueBuffer(bool async, u32 width, u32 height, s32 format, u
|
|||||||
Result gfxproducerQueueBuffer(s32 buf, u8 input[0x5c]);
|
Result gfxproducerQueueBuffer(s32 buf, u8 input[0x5c]);
|
||||||
Result gfxproducerQuery(s32 what, s32* value);
|
Result gfxproducerQuery(s32 what, s32* value);
|
||||||
Result gfxproducerConnect(s32 api, bool producerControlledByApp);
|
Result gfxproducerConnect(s32 api, bool producerControlledByApp);
|
||||||
Result gfxproducerBufferInit(s32 buf, u8 input[0x178]);
|
Result gfxproducerTegraBufferInit(s32 buf, u8 input[0x178]);
|
||||||
|
@ -19,6 +19,7 @@ enum {
|
|||||||
DISCONNECT, //0xB
|
DISCONNECT, //0xB
|
||||||
SET_SIDEBAND_STREAM, //0xC
|
SET_SIDEBAND_STREAM, //0xC
|
||||||
ALLOCATE_BUFFERS, //0xD
|
ALLOCATE_BUFFERS, //0xD
|
||||||
|
TEGRA_BUFFER_INIT, //0xE (Custom Switch-specific command - unofficial name)
|
||||||
};
|
};
|
||||||
|
|
||||||
static char _gfxproducer_InterfaceDescriptor[] = "android.gui.IGraphicBufferProducer";
|
static char _gfxproducer_InterfaceDescriptor[] = "android.gui.IGraphicBufferProducer";
|
||||||
@ -152,8 +153,7 @@ Result gfxproducerConnect(s32 api, bool producerControlledByApp) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Unknown what this is.
|
Result gfxproducerTegraBufferInit(s32 buf, u8 input[0x178]) {
|
||||||
Result gfxproducerBufferInit(s32 buf, u8 input[0x178]) {
|
|
||||||
Result rc;
|
Result rc;
|
||||||
parcelContext parcel, parcel_reply;
|
parcelContext parcel, parcel_reply;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ Result gfxproducerBufferInit(s32 buf, u8 input[0x178]) {
|
|||||||
parcelWriteInt32(&parcel, buf);
|
parcelWriteInt32(&parcel, buf);
|
||||||
parcelWriteData(&parcel, input, 0x178);
|
parcelWriteData(&parcel, input, 0x178);
|
||||||
|
|
||||||
rc = parcelTransact(g_gfxproducerBinderSession, 0xE, &parcel, &parcel_reply);
|
rc = parcelTransact(g_gfxproducerBinderSession, TEGRA_BUFFER_INIT, &parcel, &parcel_reply);
|
||||||
if (R_FAILED(rc)) return rc;
|
if (R_FAILED(rc)) return rc;
|
||||||
|
|
||||||
//TODO: parse reply
|
//TODO: parse reply
|
||||||
|
@ -37,6 +37,7 @@ static nvmapobj nvmap_objs[18];
|
|||||||
|
|
||||||
static u64 nvmap_obj6_mapbuffer_xdb_offset;
|
static u64 nvmap_obj6_mapbuffer_xdb_offset;
|
||||||
|
|
||||||
|
//Some of this struct is based on tegra_dc_ext_flip_windowattr.
|
||||||
static u32 g_gfxprod_BufferInitData[0x178>>2] = {
|
static u32 g_gfxprod_BufferInitData[0x178>>2] = {
|
||||||
0x1, 0x16c, 0x0,
|
0x1, 0x16c, 0x0,
|
||||||
0x47424652,
|
0x47424652,
|
||||||
@ -48,7 +49,7 @@ static u32 g_gfxprod_BufferInitData[0x178>>2] = {
|
|||||||
0x0, 0xdaffcaff, 0x2a, 0x0,
|
0x0, 0xdaffcaff, 0x2a, 0x0,
|
||||||
0xb00, 0x1, 0x1, 1280,
|
0xb00, 0x1, 0x1, 1280,
|
||||||
0x3c0000, 0x1, 0x0, 1280,
|
0x3c0000, 0x1, 0x0, 1280,
|
||||||
720, 0x532120, 0x1, 0x3,
|
720, 0x532120, 0x1, 0x3, //0x52* field is flags
|
||||||
0x1400,
|
0x1400,
|
||||||
0x0, //nvmap handle
|
0x0, //nvmap handle
|
||||||
0x0,
|
0x0,
|
||||||
@ -300,7 +301,7 @@ Result nvgfxInitialize(void) {
|
|||||||
g_gfxprod_BufferInitData[0x20] = tmpval;
|
g_gfxprod_BufferInitData[0x20] = tmpval;
|
||||||
g_gfxprod_BufferInitData[0x21] = 0x3c0000*i;
|
g_gfxprod_BufferInitData[0x21] = 0x3c0000*i;
|
||||||
ptr64[0x170>>3] = svcGetSystemTick();
|
ptr64[0x170>>3] = svcGetSystemTick();
|
||||||
rc = gfxproducerBufferInit(i, (u8*)g_gfxprod_BufferInitData);
|
rc = gfxproducerTegraBufferInit(i, (u8*)g_gfxprod_BufferInitData);
|
||||||
if (R_FAILED(rc)) break;
|
if (R_FAILED(rc)) break;
|
||||||
}
|
}
|
||||||
if (R_FAILED(rc)) break;
|
if (R_FAILED(rc)) break;
|
||||||
|
Loading…
Reference in New Issue
Block a user