From f7f31bc590b252fcdf03da1bcabd0b057da36c2d Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Fri, 11 Mar 2011 15:02:23 +0100 Subject: [PATCH] gpu: pvr: pdump: remove unused bridge calls Userspace never calls _PDUMP_DRIVERINFO, _PDUMP_DUMPREADREG, _PDUMP_STARTINITPHASE, or _PDUMP_STOPINITPHASE. So remove the respective handlers and the pdump code. No functional change. Signed-off-by: Luc Verhaegen Signed-off-by: Imre Deak --- pvr/bridged_pvr_bridge.c | 83 ++++------------------------------------ pvr/pdump.c | 71 +++------------------------------- pvr/pdump_km.h | 9 ----- 3 files changed, 12 insertions(+), 151 deletions(-) diff --git a/pvr/bridged_pvr_bridge.c b/pvr/bridged_pvr_bridge.c index 0c24a68..139adb9 100644 --- a/pvr/bridged_pvr_bridge.c +++ b/pvr/bridged_pvr_bridge.c @@ -1187,42 +1187,6 @@ static int PDumpBitmapBW(u32 ui32BridgeID, return 0; } -static int PDumpReadRegBW(u32 ui32BridgeID, - struct PVRSRV_BRIDGE_IN_PDUMP_READREG *psPDumpReadRegIN, - struct PVRSRV_BRIDGE_RETURN *psRetOUT, - struct PVRSRV_PER_PROCESS_DATA *psPerProc) -{ - PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_DUMPREADREG); - PVR_UNREFERENCED_PARAMETER(psPerProc); - - psRetOUT->eError = PDumpReadRegKM(&psPDumpReadRegIN->szFileName[0], - psPDumpReadRegIN->ui32FileOffset, - psPDumpReadRegIN->ui32Address, - psPDumpReadRegIN->ui32Size, - psPDumpReadRegIN->ui32Flags); - - return 0; -} - -static int PDumpDriverInfoBW(u32 ui32BridgeID, - struct PVRSRV_BRIDGE_IN_PDUMP_DRIVERINFO *psPDumpDriverInfoIN, - struct PVRSRV_BRIDGE_RETURN *psRetOUT, - struct PVRSRV_PER_PROCESS_DATA *psPerProc) -{ - u32 ui32PDumpFlags; - - PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_DRIVERINFO); - PVR_UNREFERENCED_PARAMETER(psPerProc); - - ui32PDumpFlags = 0; - if (psPDumpDriverInfoIN->bContinuous) - ui32PDumpFlags |= PDUMP_FLAGS_CONTINUOUS; - psRetOUT->eError = PDumpDriverInfoKM(&psPDumpDriverInfoIN->szString[0], - ui32PDumpFlags); - - return 0; -} - static int PDumpSyncDumpBW(u32 ui32BridgeID, struct PVRSRV_BRIDGE_IN_PDUMP_DUMPSYNC *psPDumpSyncDumpIN, struct PVRSRV_BRIDGE_RETURN *psRetOUT, @@ -1345,34 +1309,6 @@ static int PDumpPDDevPAddrBW(u32 ui32BridgeID, return 0; } -static int PDumpStartInitPhaseBW(u32 ui32BridgeID, void *psBridgeIn, - struct PVRSRV_BRIDGE_RETURN *psRetOUT, - struct PVRSRV_PER_PROCESS_DATA *psPerProc) -{ - PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, - PVRSRV_BRIDGE_PDUMP_STARTINITPHASE); - PVR_UNREFERENCED_PARAMETER(psBridgeIn); - PVR_UNREFERENCED_PARAMETER(psPerProc); - - psRetOUT->eError = PDumpStartInitPhaseKM(); - - return 0; -} - -static int PDumpStopInitPhaseBW(u32 ui32BridgeID, void *psBridgeIn, - struct PVRSRV_BRIDGE_RETURN *psRetOUT, - struct PVRSRV_PER_PROCESS_DATA *psPerProc) -{ - PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, - PVRSRV_BRIDGE_PDUMP_STOPINITPHASE); - PVR_UNREFERENCED_PARAMETER(psBridgeIn); - PVR_UNREFERENCED_PARAMETER(psPerProc); - - psRetOUT->eError = PDumpStopInitPhaseKM(); - - return 0; -} - #endif static int PVRSRVGetMiscInfoBW(u32 ui32BridgeID, @@ -2763,20 +2699,17 @@ enum PVRSRV_ERROR CommonBridgeInit(void) SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_ISCAPTURING, PDumpIsCaptureFrameBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DUMPBITMAP, PDumpBitmapBW); - SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DUMPREADREG, PDumpReadRegBW); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DUMPREADREG, DummyBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_SYNCPOL, PDumpSyncPolBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DUMPSYNC, PDumpSyncDumpBW); - SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DRIVERINFO, - PDumpDriverInfoBW); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DRIVERINFO, DummyBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PDREG, PDumpPDRegBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR, PDumpPDDevPAddrBW); SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ, PDumpCycleCountRegReadBW); - SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STARTINITPHASE, - PDumpStartInitPhaseBW); - SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STOPINITPHASE, - PDumpStopInitPhaseBW); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STARTINITPHASE, DummyBW); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STOPINITPHASE, DummyBW); #endif SetDispatchTableEntry(PVRSRV_BRIDGE_GET_OEMJTABLE, DummyBW); @@ -3042,7 +2975,7 @@ static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out, err = PDumpBitmapBW(cmd, in, out, per_proc); break; case PVRSRV_BRIDGE_PDUMP_DUMPREADREG: - err = PDumpReadRegBW(cmd, in, out, per_proc); + err = DummyBW(cmd, in, out, per_proc); break; case PVRSRV_BRIDGE_PDUMP_SYNCPOL: err = PDumpSyncPolBW(cmd, in, out, per_proc); @@ -3051,7 +2984,7 @@ static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out, err = PDumpSyncDumpBW(cmd, in, out, per_proc); break; case PVRSRV_BRIDGE_PDUMP_DRIVERINFO: - err = PDumpDriverInfoBW(cmd, in, out, per_proc); + err = DummyBW(cmd, in, out, per_proc); break; case PVRSRV_BRIDGE_PDUMP_PDREG: err = PDumpPDRegBW(cmd, in, out, per_proc); @@ -3063,10 +2996,8 @@ static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out, err = PDumpCycleCountRegReadBW(cmd, in, out, per_proc); break; case PVRSRV_BRIDGE_PDUMP_STARTINITPHASE: - err = PDumpStartInitPhaseBW(cmd, in, out, per_proc); - break; case PVRSRV_BRIDGE_PDUMP_STOPINITPHASE: - err = PDumpStopInitPhaseBW(cmd, in, out, per_proc); + err = DummyBW(cmd, in, out, per_proc); break; #endif diff --git a/pvr/pdump.c b/pvr/pdump.c index 0dec52f..733c208 100644 --- a/pvr/pdump.c +++ b/pvr/pdump.c @@ -61,12 +61,10 @@ static struct DBGKM_SERVICE_TABLE *gpfnDbgDrv; #define PDUMP_STREAM_PARAM2 0 #define PDUMP_STREAM_SCRIPT2 1 -#define PDUMP_STREAM_DRIVERINFO 2 -#define PDUMP_NUM_STREAMS 3 +#define PDUMP_NUM_STREAMS 2 static char *pszStreamName[PDUMP_NUM_STREAMS] = { "ParamStream2", - "ScriptStream2", - "DriverInfoStream" + "ScriptStream2" }; #define __PDBG_PDUMP_STATE_GET_MSG_STRING(ERROR) \ @@ -213,33 +211,6 @@ void PDumpDeInit(void) gpfnDbgDrv = NULL; } -enum PVRSRV_ERROR PDumpStartInitPhaseKM(void) -{ - u32 i; - - if (gpfnDbgDrv) { - PDUMPCOMMENT("Start Init Phase"); - for (i = 0; i < PDUMP_NUM_STREAMS; i++) - gpfnDbgDrv->pfnStartInitPhase(gsDBGPdumpState. - psStream[i]); - } - return PVRSRV_OK; -} - -enum PVRSRV_ERROR PDumpStopInitPhaseKM(void) -{ - u32 i; - - if (gpfnDbgDrv) { - PDUMPCOMMENT("Stop Init Phase"); - - for (i = 0; i < PDUMP_NUM_STREAMS; i++) - gpfnDbgDrv->pfnStopInitPhase(gsDBGPdumpState. - psStream[i]); - } - return PVRSRV_OK; -} - void PDumpComment(char *pszFormat, ...) { va_list ap; @@ -907,39 +878,6 @@ enum PVRSRV_ERROR PDumpCommentKM(char *pszComment, u32 ui32Flags) return PVRSRV_OK; } -enum PVRSRV_ERROR PDumpDriverInfoKM(char *pszString, u32 ui32Flags) -{ - u32 ui32Count = 0; - __PDBG_PDUMP_STATE_GET_MSG_STRING(PVRSRV_ERROR_GENERIC); - - snprintf(pszMsg, SZ_MSG_SIZE_MAX, "%s", pszString); - - while ((pszMsg[ui32Count] != 0) && (ui32Count < SZ_MSG_SIZE_MAX)) - ui32Count++; - - if ((pszMsg[ui32Count - 1] != '\n') && (ui32Count < SZ_MSG_SIZE_MAX)) { - pszMsg[ui32Count] = '\n'; - ui32Count++; - pszMsg[ui32Count] = '\0'; - } - if ((pszMsg[ui32Count - 2] != '\r') && (ui32Count < SZ_MSG_SIZE_MAX)) { - pszMsg[ui32Count - 1] = '\r'; - pszMsg[ui32Count] = '\n'; - ui32Count++; - pszMsg[ui32Count] = '\0'; - } - - if (!PDumpWriteILock(gsDBGPdumpState.psStream[PDUMP_STREAM_DRIVERINFO], - (u8 *) pszMsg, ui32Count, ui32Flags)) { - if (ui32Flags & PDUMP_FLAGS_CONTINUOUS) - return PVRSRV_ERROR_GENERIC; - else - return PVRSRV_ERROR_CMD_NOT_PROCESSED; - } - - return PVRSRV_OK; -} - enum PVRSRV_ERROR PDumpBitmapKM(char *pszFileName, u32 ui32FileOffset, u32 ui32Width, u32 ui32Height, u32 ui32StrideInBytes, struct IMG_DEV_VIRTADDR sDevBaseAddr, @@ -962,8 +900,9 @@ enum PVRSRV_ERROR PDumpBitmapKM(char *pszFileName, u32 ui32FileOffset, return PVRSRV_OK; } -enum PVRSRV_ERROR PDumpReadRegKM(char *pszFileName, u32 ui32FileOffset, - u32 ui32Address, u32 ui32Size, u32 ui32PDumpFlags) +static enum PVRSRV_ERROR PDumpReadRegKM(char *pszFileName, u32 ui32FileOffset, + u32 ui32Address, u32 ui32Size, + u32 ui32PDumpFlags) { __PDBG_PDUMP_STATE_GET_SCRIPT_STRING(PVRSRV_ERROR_GENERIC); diff --git a/pvr/pdump_km.h b/pvr/pdump_km.h index 1f2a498..3d9b9a9 100644 --- a/pvr/pdump_km.h +++ b/pvr/pdump_km.h @@ -80,11 +80,8 @@ void PDumpInitCommon(void); void PDumpDeInitCommon(void); void PDumpInit(void); void PDumpDeInit(void); -enum PVRSRV_ERROR PDumpStartInitPhaseKM(void); -enum PVRSRV_ERROR PDumpStopInitPhaseKM(void); enum PVRSRV_ERROR PDumpSetFrameKM(u32 ui32Frame); enum PVRSRV_ERROR PDumpCommentKM(char *pszComment, u32 ui32Flags); -enum PVRSRV_ERROR PDumpDriverInfoKM(char *pszString, u32 ui32Flags); enum PVRSRV_ERROR PDumpRegWithFlagsKM(u32 ui32RegAddr, u32 ui32RegValue, u32 ui32Flags); @@ -96,8 +93,6 @@ enum PVRSRV_ERROR PDumpBitmapKM(char *pszFileName, u32 ui32FileOffset, void PDumpHWPerfCBKM(char *pszFileName, u32 ui32FileOffset, struct IMG_DEV_VIRTADDR sDevBaseAddr, u32 ui32Size, u32 ui32PDumpFlags); -enum PVRSRV_ERROR PDumpReadRegKM(char *pszFileName, u32 ui32FileOffset, - u32 ui32Address, u32 ui32Size, u32 ui32PDumpFlags); void PDUMP_REG_FUNC_NAME(u32 dwReg, u32 dwData); void PDumpMsvdxRegRead(const char *const pRegRegion, const u32 dwRegOffset); @@ -205,13 +200,11 @@ void PDumpResumeKM(void); #define PDUMPPDREGWITHFLAGS PDumpPDRegWithFlags #define PDUMPCBP PDumpCBP #define PDUMPMALLOCPAGESPHYS PDumpMallocPagesPhys -#define PDUMPENDINITPHASE PDumpStopInitPhaseKM #define PDUMPMSVDXREGWRITE PDumpMsvdxRegWrite #define PDUMPMSVDXREGREAD PDumpMsvdxRegRead #define PDUMPMSVDXPOL PDumpMsvdxRegPol #define PDUMPMSVDXWRITEREF PDumpMsvdxWriteRef #define PDUMPBITMAPKM PDumpBitmapKM -#define PDUMPDRIVERINFO PDumpDriverInfoKM #define PDUMPIDLWITHFLAGS PDumpIDLWithFlags #define PDUMPIDL PDumpIDL #define PDUMPSUSPEND PDumpSuspendKM @@ -249,14 +242,12 @@ void PDumpResumeKM(void); #define PDUMPCBP(args...) #define PDUMPCOMMENTWITHFLAGS(args...) #define PDUMPMALLOCPAGESPHYS(args...) -#define PDUMPENDINITPHASE(args...) #define PDUMPMSVDXREG(args...) #define PDUMPMSVDXREGWRITE(args...) #define PDUMPMSVDXREGREAD(args...) #define PDUMPMSVDXPOLEQ(args...) #define PDUMPMSVDXPOL(args...) #define PDUMPBITMAPKM(args...) -#define PDUMPDRIVERINFO(args...) #define PDUMPIDLWITHFLAGS(args...) #define PDUMPIDL(args...) #define PDUMPSUSPEND(args...) -- 2.39.5