diff options
author | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-08-06 22:27:40 +0100 |
---|---|---|
committer | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-08-06 22:27:40 +0100 |
commit | 499cc60e728ff7225fd7cac158ff772435c27b62 (patch) | |
tree | 4e8eccb84007d8013e4e16607fe9c8338f9b565a /src/pprint.c | |
parent | b77021daaa375b0553ac78b0d8f46eca05ccf415 (diff) |
drv: Attempt to add mapping support
Map allocated buffers so we can clear them and then write copied
dumps from proprietary driver to them. Currently memory allocations
fail with `MAP_FAILED` in mmap.
Diffstat (limited to 'src/pprint.c')
-rw-r--r-- | src/pprint.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/pprint.c b/src/pprint.c index 1a72fb4..8043ddc 100644 --- a/src/pprint.c +++ b/src/pprint.c @@ -371,7 +371,8 @@ static void pprint_PVRSRV_SGX_MISCINFO_FEATURES(FILE *fp, PVRSRV_SGX_MISCINFO_FE } static void pprint_PVRSRV_HEAP_INFO(FILE *fp, PVRSRV_HEAP_INFO *data) { - fprintf(fp, "{\n.ui32HeapID = 0x%x,\n.hDevMemHeap = %p,\n.sDevVAddrBase = 0x%x,\n.ui32HeapByteSize = 0x%x,\n.ui32Attribs = 0x%x,\n.ui32XTileStride = 0x%x\n}", + fprintf(fp, "{\n.ui32HeapID = 0x%x,\n.hDevMemHeap = %p,\n.sDevVAddrBase = 0x%x,\n.ui32HeapByteSize = 0x%x,\n" + ".ui32Attribs = 0x%x,\n.ui32XTileStride = 0x%x\n}", data->ui32HeapID, data->hDevMemHeap, data->sDevVAddrBase.uiAddr, data->ui32HeapByteSize, data->ui32Attribs, data->ui32XTileStride); } @@ -383,7 +384,7 @@ static void pprint_PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT(FILE *fp, PVRSRV_BRIDG PPRINT(fp, &data->sHeapInfo[i], PVRSRV_HEAP_INFO); fprintf(fp, ",\n"); } - fprintf(fp, "}"); + fprintf(fp, "}\n"); } static void pprint_mem_alloc_flags(FILE *fp, uint32_t ui32Attribs) { @@ -450,3 +451,37 @@ static void pprint_SGXMKIF_COMMAND(FILE *fp, SGXMKIF_COMMAND *in) { static void pprint_PVRSRV_EVENTOBJECT(FILE *fp, PVRSRV_EVENTOBJECT *in) { fprintf(fp, "{\n.szName = \"%s\",\n.hOSEventKM = %p\n}\n", in->szName, in->hOSEventKM); } + +static void pprint_PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO(FILE *fp, PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO *out) { + fprintf(fp, "{\n.sSGXInternalDevInfo = {\n" + "\t.hHostCtlKernelMemInfoHandle = %p,\n" + "\t.bForcePTOff = %d,\n" + "},\n" + ".eError = %s,\n" + "}\n", + out->sSGXInternalDevInfo.hHostCtlKernelMemInfoHandle, + out->sSGXInternalDevInfo.bForcePTOff, + PPRINT(fp, out->eError, PVRSRV_ERROR)); +} + +static void pprint_PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA(FILE *fp, PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA *out) { + fprintf(fp, "{\n.eError = %s,\n" + ".uiMMapOffset = 0x%x,\n" + ".uiByteOffset = 0x%x,\n" + ".uiRealByteSize = 0x%x,\n" + ".uiUserVAddr = 0x%x\n" + "}\n", + PPRINT(fp, out->eError, PVRSRV_ERROR), + out->uiMMapOffset, + out->uiByteOffset, + out->uiRealByteSize, + out->uiUserVAddr); +} + +static void pprint_PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA(FILE *fp, PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA *out) { + fprintf(fp, "{\n.ui32BridgeFlags = 0x%x,\n" + ".hMHandle = %p,\n" + "}\n", + out->ui32BridgeFlags, + out->hMHandle); +} |