Now About Social Code
summaryrefslogtreecommitdiff
path: root/src/pprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pprint.c')
-rw-r--r--src/pprint.c58
1 files changed, 51 insertions, 7 deletions
diff --git a/src/pprint.c b/src/pprint.c
index 17c3ece..1a72fb4 100644
--- a/src/pprint.c
+++ b/src/pprint.c
@@ -364,23 +364,18 @@ static void pprint_PVRSRV_BRIDGE_OUT_ACQUIRE_DEVICEINFO(FILE *fp, PVRSRV_BRIDGE_
PPRINT(fp, data->eError, PVRSRV_ERROR), data->hDevCookie);
}
-#if 0
static void pprint_PVRSRV_SGX_MISCINFO_FEATURES(FILE *fp, PVRSRV_SGX_MISCINFO_FEATURES *data) {
fprintf(fp, "{\n.ui32CoreRev = 0x%x,\n.ui32CoreID = 0x%x,\n.ui32DDKVersion = 0%x,\n.ui32DDBBuild = 0x%x\n.ui32CoreIdSW = 0x%x,\n.uiCoreRevSW = 0x%x,\n.ui32BuildOptions = 0x%x,\n}",
data->ui32CoreRev, data->ui32CoreID, data->ui32DDKVersion, data->ui32DDKBuild, data->ui32CoreIdSW,
data->ui32CoreRevSW, data->ui32BuildOptions);
}
-#endif
-#if 0
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}",
data->ui32HeapID, data->hDevMemHeap, data->sDevVAddrBase.uiAddr, data->ui32HeapByteSize,
data->ui32Attribs, data->ui32XTileStride);
}
-#endif
-#if 0
static void pprint_PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT(FILE *fp, PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT *data) {
fprintf(fp, "{\n.eError = %s,\n.hDevMemContext = %p,\n.ui32ClientHeapCount = %d,\n.sHeapInfo = {\n",
PPRINT(fp, data->eError, PVRSRV_ERROR), data->hDevMemContext, data->ui32ClientHeapCount);
@@ -390,10 +385,55 @@ static void pprint_PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT(FILE *fp, PVRSRV_BRIDG
}
fprintf(fp, "}");
}
-#endif
+
+static void pprint_mem_alloc_flags(FILE *fp, uint32_t ui32Attribs) {
+#define PRINTBIT(value, bit) if ((value) & (bit)) { \
+ fprintf(fp, "%s", #bit); \
+ (value) &= ~(bit); \
+ if((value) != 0) \
+ fprintf(fp, "%s", " | "); \
+ }
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_READ);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_WRITE);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_CACHE_CONSISTENT);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_NO_SYNCOBJ);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_INTERLEAVED);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_DUMMY);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_EDM_PROTECT);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_ZERO);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_USER_SUPPLIED_DEVVADDR);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_RAM_BACKED_ALLOCATION);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_NO_RESMAN);
+ PRINTBIT(ui32Attribs, PVRSRV_MEM_EXPORTED);
+
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_CACHED);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_UNCACHED);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_WRITECOMBINE);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_KERNEL_ONLY);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_SINGLE_PROCESS);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_MULTI_PROCESS);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_FROM_EXISTING_PROCESS);
+ PRINTBIT(ui32Attribs, PVRSRV_HAP_NO_CPU_VIRTUAL);
+
+ assert(ui32Attribs == 0);
+}
+
+static void pprint_PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM(FILE *fp, PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM*in) {
+ fprintf(fp, "{\n.ui32BridgeFlags = 0x%x,\n.hDevCookie = 0x%x,\n.hDevMemHeap = 0x%x,\n.ui32Attribs = ",
+ (uint32_t)in->ui32BridgeFlags, (uint32_t)in->hDevCookie, (uint32_t)in->hDevMemHeap);
+ pprint_mem_alloc_flags(fp, in->ui32Attribs);
+
+ fprintf(fp, ",\n.uSize = 0x%x,\n.uAlignment = 0x%x,\n.pvPrivData = %p,\n.ui32PrivDataLength = 0x%x,\n"
+ ".ui32ChunkSize = 0x%x,\n.ui32NumVirtChunks = 0x%x,\n.ui32NumPhysChunks = 0x%x,\n"
+ ".pabMapChunk = %p\n}\n",
+ (uint32_t)in->uSize, (uint32_t)in->uAlignment, in->pvPrivData,
+ in->ui32PrivDataLength, in->ui32ChunkSize, in->ui32NumVirtChunks, in->ui32NumPhysChunks,
+ in->pabMapChunk);
+}
static void pprint_drmVersion(FILE *fp, drmVersion *drm) {
- fprintf(fp, "{\n.version_major = %d,\n.version_minor = %d,\n.version_patchlevel = %d\n.name_len = %d,\n.name = \"%s\",\n.date_len = %d,\n.date = \"%s\",\n.desc_len = %d,\n.desc = \"%s\"\n}",
+ fprintf(fp, "{\n.version_major = %d,\n.version_minor = %d,\n.version_patchlevel = %d\n.name_len = %d,\n"
+ ".name = \"%s\",\n.date_len = %d,\n.date = \"%s\",\n.desc_len = %d,\n.desc = \"%s\"\n}\n",
(int)drm->version_major, (int)drm->version_minor, (int)drm->version_patchlevel,
(int)drm->name_len, drm->name,
(int)drm->date_len, drm->date,
@@ -406,3 +446,7 @@ static void pprint_SGXMKIF_COMMAND(FILE *fp, SGXMKIF_COMMAND *in) {
in->ui32Data[0], in->ui32Data[1], in->ui32Data[2], in->ui32Data[3],
in->ui32Data[4], in->ui32Data[5]);
}
+
+static void pprint_PVRSRV_EVENTOBJECT(FILE *fp, PVRSRV_EVENTOBJECT *in) {
+ fprintf(fp, "{\n.szName = \"%s\",\n.hOSEventKM = %p\n}\n", in->szName, in->hOSEventKM);
+}