summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Strachan <alistair.strachan@imgtec.com>2016-05-10 11:27:46 -0700
committerAlistair Strachan <alistair.strachan@imgtec.com>2016-05-11 11:57:40 -0700
commitbfa0879306a02b4326d2009c4bb7a3259d90a385 (patch)
tree6044fdf78027f98a3157a392fb741924244a5606
parentf68f7a4bc9f0e580045b939f17fdee183a85f1e2 (diff)
downloadx86_64-android-x86_64-fugu-3.10-n-preview-4.tar.gz
Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com> Change-Id: I1e63392d0b5deb8079da37fdf5c5e6de75d68adf
-rw-r--r--drivers/staging/imgtec/intel/pvr_drm_ext.c33
-rw-r--r--drivers/staging/imgtec/intel/pvr_drm_shared.h5
-rw-r--r--drivers/staging/imgtec/intel/sysconfig.c3
-rw-r--r--drivers/staging/imgtec/pvr_sync.c12
-rw-r--r--drivers/staging/imgtec/pvrversion.h6
-rw-r--r--drivers/staging/imgtec/rogue/Makefile18
-rw-r--r--drivers/staging/imgtec/rogue/dc_server.c14
-rw-r--r--drivers/staging/imgtec/rogue/devicemem.c3
-rw-r--r--drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dcachegeneric_bridge/client_cachegeneric_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dhtbuffer_bridge/client_htbuffer_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dmm_bridge/client_mm_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dpvrtl_bridge/client_pvrtl_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/drgxinit_bridge/client_rgxinit_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dri_bridge/client_ri_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_bridge.h5
-rw-r--r--drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_direct_bridge.c (renamed from drivers/staging/imgtec/rogue/generated/dsync_bridge/client_sync_bridge.c)0
-rw-r--r--drivers/staging/imgtec/rogue/hwdefs/km/cores/rgxcore_km_8.46.2.39.h77
-rw-r--r--drivers/staging/imgtec/rogue/mmu_common.c36
-rw-r--r--drivers/staging/imgtec/rogue/mmu_common.h11
-rw-r--r--drivers/staging/imgtec/rogue/osfunc.c9
-rw-r--r--drivers/staging/imgtec/rogue/physmem.c11
-rw-r--r--drivers/staging/imgtec/rogue/power.c2
-rw-r--r--drivers/staging/imgtec/rogue/pvr_debug.c64
-rw-r--r--drivers/staging/imgtec/rogue/pvr_notifier.h (renamed from drivers/staging/imgtec/rogue/pvr_bridge_client.h)77
-rw-r--r--drivers/staging/imgtec/rogue/pvrsrv.c50
-rw-r--r--drivers/staging/imgtec/rogue/pvrsrv.h47
-rw-r--r--drivers/staging/imgtec/rogue/rgxccb.c51
-rw-r--r--drivers/staging/imgtec/rogue/rgxccb.h7
-rw-r--r--drivers/staging/imgtec/rogue/rgxcompute.c5
-rw-r--r--drivers/staging/imgtec/rogue/rgxcompute.h3
-rw-r--r--drivers/staging/imgtec/rogue/rgxdebug.c483
-rw-r--r--drivers/staging/imgtec/rogue/rgxdebug.h25
-rw-r--r--drivers/staging/imgtec/rogue/rgxfwutils.c15
-rw-r--r--drivers/staging/imgtec/rogue/rgxfwutils.h3
-rw-r--r--drivers/staging/imgtec/rogue/rgxinit.c11
-rw-r--r--drivers/staging/imgtec/rogue/rgxmem.c18
-rw-r--r--drivers/staging/imgtec/rogue/rgxmem.h6
-rw-r--r--drivers/staging/imgtec/rogue/rgxta3d.c23
-rw-r--r--drivers/staging/imgtec/rogue/rgxta3d.h3
-rw-r--r--drivers/staging/imgtec/rogue/rgxtransfer.c7
-rw-r--r--drivers/staging/imgtec/rogue/rgxtransfer.h3
-rw-r--r--drivers/staging/imgtec/rogue/rgxutils.c21
-rw-r--r--drivers/staging/imgtec/rogue/rgxutils.h11
-rw-r--r--drivers/staging/imgtec/rogue/scp.c56
-rw-r--r--drivers/staging/imgtec/rogue/scp.h6
-rw-r--r--drivers/staging/imgtec/rogue/srvcore.c4
-rw-r--r--drivers/staging/imgtec/rogue/sync_server.c64
-rw-r--r--drivers/staging/imgtec/rogue/syscommon.h2
-rw-r--r--drivers/staging/imgtec/services_kernel_client.h7
59 files changed, 682 insertions, 675 deletions
diff --git a/drivers/staging/imgtec/intel/pvr_drm_ext.c b/drivers/staging/imgtec/intel/pvr_drm_ext.c
index 5dbf61b3f32a..91633587406f 100644
--- a/drivers/staging/imgtec/intel/pvr_drm_ext.c
+++ b/drivers/staging/imgtec/intel/pvr_drm_ext.c
@@ -61,24 +61,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <linux/module.h>
#include "pvrmodule.h"
-#define PVR_DRM_SRVKM_CMD DRM_PVR_RESERVED1
-#define PVR_DRM_IS_MASTER_CMD DRM_PVR_RESERVED4
-#define PVR_DRM_DBGDRV_CMD DRM_PVR_RESERVED6
-
-#if (PVR_DRM_SRVKM_CMD != DRM_PVR_SRVKM_CMD) || \
- (PVR_DRM_DBGDRV_CMD != DRM_PVR_DBGDRV_CMD)
+#if (DRM_PVR_RESERVED1 != DRM_PVR_SRVKM_CMD) || \
+ (DRM_PVR_RESERVED4 != DRM_PVR_IS_MASTER_CMD) || \
+ (DRM_PVR_RESERVED6 != DRM_PVR_DBGDRV_CMD)
#error Mismatch in IOCTL numbers
#endif
-#define PVR_DRM_SRVKM_IOCTL \
- DRM_IOW(DRM_COMMAND_BASE + PVR_DRM_SRVKM_CMD, PVRSRV_BRIDGE_PACKAGE)
+#define DRM_IOCTL_PVR_SRVKM_CMD \
+ DRM_IOW(DRM_COMMAND_BASE + DRM_PVR_SRVKM_CMD, PVRSRV_BRIDGE_PACKAGE)
-#define PVR_DRM_IS_MASTER_IOCTL \
- DRM_IO(DRM_COMMAND_BASE + PVR_DRM_IS_MASTER_CMD)
+#define DRM_IOCTL_PVR_IS_MASTER_CMD \
+ DRM_IO(DRM_COMMAND_BASE + DRM_PVR_IS_MASTER_CMD)
#if defined(PDUMP)
-#define PVR_DRM_DBGDRV_IOCTL \
- DRM_IOW(DRM_COMMAND_BASE + PVR_DRM_DBGDRV_CMD, IOCTL_PACKAGE)
+#define DRM_IOCTL_PVR_DBGDRV_CMD \
+ DRM_IOW(DRM_COMMAND_BASE + DRM_PVR_DBGDRV_CMD, IOCTL_PACKAGE)
#endif
static int
@@ -89,18 +86,18 @@ PVRDRMIsMaster(struct drm_device *dev, void *arg, struct drm_file *pFile)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
static struct drm_ioctl_desc pvr_ioctls[] = {
- {PVR_DRM_SRVKM_IOCTL, DRM_UNLOCKED, PVRSRV_BridgeDispatchKM},
- {PVR_DRM_IS_MASTER_IOCTL, DRM_MASTER, PVRDRMIsMaster},
+ {DRM_IOCTL_PVR_SRVKM_CMD, DRM_UNLOCKED, PVRSRV_BridgeDispatchKM},
+ {DRM_IOCTL_PVR_IS_MASTER_CMD, DRM_MASTER, PVRDRMIsMaster},
#if defined(PDUMP)
- {PVR_DRM_DBGDRV_IOCTL, 0, dbgdrv_ioctl}
+ {DRM_IOCTL_PVR_DBGDRV_CMD, 0, dbgdrv_ioctl}
#endif
};
#else
static struct drm_ioctl_desc pvr_ioctls[] = {
- {PVR_DRM_SRVKM_IOCTL, DRM_UNLOCKED, PVRSRV_BridgeDispatchKM, PVR_DRM_SRVKM_IOCTL},
- {PVR_DRM_IS_MASTER_IOCTL, DRM_MASTER, PVRDRMIsMaster, PVR_DRM_IS_MASTER_IOCTL},
+ {DRM_IOCTL_PVR_SRVKM_CMD, DRM_UNLOCKED, PVRSRV_BridgeDispatchKM, DRM_IOCTL_PVR_SRVKM_CMD},
+ {DRM_IOCTL_PVR_IS_MASTER_CMD, DRM_MASTER, PVRDRMIsMaster, DRM_IOCTL_PVR_IS_MASTER_CMD},
#if defined(PDUMP)
- {PVR_DRM_DBGDRV_IOCTL, 0, dbgdrv_ioctl, PVR_DRM_DBGDRV_IOCTL}
+ {DRM_IOCTL_PVR_DBGDRV_CMD, 0, dbgdrv_ioctl, DRM_IOCTL_PVR_DBGDRV_CMD}
#endif
};
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) */
diff --git a/drivers/staging/imgtec/intel/pvr_drm_shared.h b/drivers/staging/imgtec/intel/pvr_drm_shared.h
index 8ea602dca83a..69cd4b9faca8 100644
--- a/drivers/staging/imgtec/intel/pvr_drm_shared.h
+++ b/drivers/staging/imgtec/intel/pvr_drm_shared.h
@@ -50,8 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* DRM command numbers, relative to DRM_COMMAND_BASE.
* These defines must be prefixed with "DRM_".
*/
-#define DRM_PVR_SRVKM_CMD 0x12 /* Used for PVR Services ioctls */
-#define DRM_PVR_DBGDRV_CMD 0x1E /* Debug driver (PDUMP) ioctls */
+#define DRM_PVR_SRVKM_CMD 0x12 /* Used for PVR Services ioctls */
+#define DRM_PVR_IS_MASTER_CMD 0x15 /* Used to check for master */
+#define DRM_PVR_DBGDRV_CMD 0x1E /* Debug driver (PDUMP) ioctls */
#endif /* defined(SUPPORT_DRM) */
#endif /* defined(__PVR_DRM_SHARED_H__) */
diff --git a/drivers/staging/imgtec/intel/sysconfig.c b/drivers/staging/imgtec/intel/sysconfig.c
index fc87042b0bc1..2ed7b76ba20a 100644
--- a/drivers/staging/imgtec/intel/sysconfig.c
+++ b/drivers/staging/imgtec/intel/sysconfig.c
@@ -222,10 +222,11 @@ void SysDestroyConfigData(PVRSRV_SYSTEM_CONFIG *psSysConfig)
#endif
}
-PVRSRV_ERROR SysDebugInfo(PVRSRV_SYSTEM_CONFIG *psSysConfig, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+PVRSRV_ERROR SysDebugInfo(PVRSRV_SYSTEM_CONFIG *psSysConfig, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile)
{
PVR_UNREFERENCED_PARAMETER(psSysConfig);
PVR_UNREFERENCED_PARAMETER(pfnDumpDebugPrintf);
+ PVR_UNREFERENCED_PARAMETER(pvDumpDebugFile);
return PVRSRV_OK;
}
diff --git a/drivers/staging/imgtec/pvr_sync.c b/drivers/staging/imgtec/pvr_sync.c
index e0f5a525d452..90da910208f3 100644
--- a/drivers/staging/imgtec/pvr_sync.c
+++ b/drivers/staging/imgtec/pvr_sync.c
@@ -112,10 +112,10 @@ static inline int sync_pt_get_status(struct sync_pt *pt)
#define DPF(fmt, ...) do {} while (0)
#endif
-#define PVR_DUMPDEBUG_LOG(pfnDumpDebugPrintf, fmt, ...) \
+#define PVR_DUMPDEBUG_LOG(pfnDumpDebugPrintf, pvDumpDebugFile, fmt, ...) \
do { \
if (pfnDumpDebugPrintf) { \
- pfnDumpDebugPrintf(fmt, __VA_ARGS__); \
+ pfnDumpDebugPrintf(pvDumpDebugFile, fmt, __VA_ARGS__); \
} else { \
pr_info("pvr_sync: " fmt, __VA_ARGS__); \
} \
@@ -558,7 +558,9 @@ static void sync_pool_clear(void)
}
static void pvr_sync_debug_request(void *hDebugRequestHandle,
- u32 ui32VerbLevel)
+ u32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
struct pvr_sync_native_sync_prim *sync;
@@ -570,7 +572,7 @@ static void pvr_sync_debug_request(void *hDebugRequestHandle,
if (ui32VerbLevel == DEBUG_REQUEST_VERBOSITY_HIGH) {
mutex_lock(&sync_pool_mutex);
- PVR_DUMPDEBUG_LOG(g_pfnDumpDebugPrintf,
+ PVR_DUMPDEBUG_LOG(pfnDumpDebugPrintf, pvDumpDebugFile,
"Dumping all pending android native syncs (Pool usage: %d%% - %d %d)",
sync_pool_reused ?
(10000 /
@@ -584,7 +586,7 @@ static void pvr_sync_debug_request(void *hDebugRequestHandle,
BUG_ON(sync->type >= ARRAY_SIZE(type_names));
- PVR_DUMPDEBUG_LOG(g_pfnDumpDebugPrintf,
+ PVR_DUMPDEBUG_LOG(pfnDumpDebugPrintf, pvDumpDebugFile,
"\tID = %d, FWAddr = 0x%08x: Current = 0x%08x, Next = 0x%08x, %s (%s)",
sync->id, sync->vaddr,
get_sync_value(sync),
diff --git a/drivers/staging/imgtec/pvrversion.h b/drivers/staging/imgtec/pvrversion.h
index edc00ec00eb7..fabfcba8d961 100644
--- a/drivers/staging/imgtec/pvrversion.h
+++ b/drivers/staging/imgtec/pvrversion.h
@@ -53,7 +53,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PVRVERSION_FAMILY "rogueddk"
#define PVRVERSION_BRANCHNAME "1.6"
-#define PVRVERSION_BUILD 4015611
+#define PVRVERSION_BUILD 4050431
#define PVRVERSION_BSCONTROL "Rogue_DDK_Android"
#define PVRVERSION_STRING "Rogue_DDK_Android rogueddk 1.6@" PVR_STR2(PVRVERSION_BUILD)
@@ -61,8 +61,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
-#define PVRVERSION_BUILD_HI 401
-#define PVRVERSION_BUILD_LO 5611
+#define PVRVERSION_BUILD_HI 405
+#define PVRVERSION_BUILD_LO 431
#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
#define PVRVERSION_PACK(MAJ,MIN) ((((MAJ)&0xFFFF) << 16) | (((MIN)&0xFFFF) << 0))
diff --git a/drivers/staging/imgtec/rogue/Makefile b/drivers/staging/imgtec/rogue/Makefile
index 2dd70606b6e0..361a42dc5b60 100644
--- a/drivers/staging/imgtec/rogue/Makefile
+++ b/drivers/staging/imgtec/rogue/Makefile
@@ -93,7 +93,7 @@ pvrsrvkm-y += srvinit_km.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/dpdump_bridge/client_pdump_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/dpdumpctrl_bridge/client_pdumpctrl_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/drgxpdump_bridge/client_rgxpdump_bridge.o
-pvrsrvkm-y += generated/drgxinit_bridge/client_rgxinit_bridge.o
+pvrsrvkm-y += generated/rgxinit_bridge/client_rgxinit_direct_bridge.o
pvrsrvkm-y += drm_pci_module.o
@@ -141,7 +141,7 @@ pvrsrvkm-$(CONFIG_SYNC) += ../pvr_sync.o
# Generated bridge code
pvrsrvkm-y += generated/mm_bridge/server_mm_bridge.o
-pvrsrvkm-y += generated/dmm_bridge/client_mm_bridge.o
+pvrsrvkm-y += generated/mm_bridge/client_mm_direct_bridge.o
pvrsrvkm-y += generated/cmm_bridge/server_cmm_bridge.o
pvrsrvkm-y += generated/rgxtq_bridge/server_rgxtq_bridge.o
pvrsrvkm-y += generated/rgxinit_bridge/server_rgxinit_bridge.o
@@ -149,25 +149,25 @@ pvrsrvkm-y += generated/rgxta3d_bridge/server_rgxta3d_bridge.o
pvrsrvkm-y += generated/rgxcmp_bridge/server_rgxcmp_bridge.o
pvrsrvkm-y += generated/srvcore_bridge/server_srvcore_bridge.o
pvrsrvkm-y += generated/sync_bridge/server_sync_bridge.o
-pvrsrvkm-y += generated/dsync_bridge/client_sync_bridge.o
+pvrsrvkm-y += generated/sync_bridge/client_sync_direct_bridge.o
pvrsrvkm-y += generated/cachegeneric_bridge/server_cachegeneric_bridge.o
-pvrsrvkm-y += generated/dcachegeneric_bridge/client_cachegeneric_bridge.o
+pvrsrvkm-y += generated/cachegeneric_bridge/client_cachegeneric_direct_bridge.o
pvrsrvkm-y += generated/breakpoint_bridge/server_breakpoint_bridge.o
pvrsrvkm-y += generated/debugmisc_bridge/server_debugmisc_bridge.o
pvrsrvkm-y += generated/pvrtl_bridge/server_pvrtl_bridge.o
-pvrsrvkm-y += generated/dpvrtl_bridge/client_pvrtl_bridge.o
+pvrsrvkm-y += generated/pvrtl_bridge/client_pvrtl_direct_bridge.o
pvrsrvkm-y += generated/rgxhwperf_bridge/server_rgxhwperf_bridge.o
pvrsrvkm-y += generated/regconfig_bridge/server_regconfig_bridge.o
pvrsrvkm-y += generated/timerquery_bridge/server_timerquery_bridge.o
pvrsrvkm-y += generated/htbuffer_bridge/server_htbuffer_bridge.o
-pvrsrvkm-y += generated/dhtbuffer_bridge/client_htbuffer_bridge.o
+pvrsrvkm-y += generated/htbuffer_bridge/client_htbuffer_direct_bridge.o
pvrsrvkm-y += generated/rgxkicksync_bridge/server_rgxkicksync_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_RESOURCE_INFO) += generated/ri_bridge/server_ri_bridge.o
-pvrsrvkm-$(CONFIG_POWERVR_ROGUE_RESOURCE_INFO) += generated/dri_bridge/client_ri_bridge.o
+pvrsrvkm-$(CONFIG_POWERVR_ROGUE_RESOURCE_INFO) += generated/ri_bridge/client_ri_direct_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_DEVICEMEM_HISTORY) += generated/devicememhistory_bridge/server_devicememhistory_bridge.o
-pvrsrvkm-$(CONFIG_POWERVR_ROGUE_DEVICEMEM_HISTORY) += generated/ddevicememhistory_bridge/client_devicememhistory_bridge.o
+pvrsrvkm-$(CONFIG_POWERVR_ROGUE_DEVICEMEM_HISTORY) += generated/devicememhistory_bridge/client_devicememhistory_direct_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/pdumpmm_bridge/server_pdumpmm_bridge.o
-pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/dpdumpmm_bridge/client_pdumpmm_bridge.o
+pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/pdumpmm_bridge/client_pdumpmm_direct_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/pdump_bridge/server_pdump_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/pdumpctrl_bridge/server_pdumpctrl_bridge.o
pvrsrvkm-$(CONFIG_POWERVR_ROGUE_PDUMP) += generated/rgxpdump_bridge/server_rgxpdump_bridge.o
diff --git a/drivers/staging/imgtec/rogue/dc_server.c b/drivers/staging/imgtec/rogue/dc_server.c
index 43f7cea2fdf4..de198579594f 100644
--- a/drivers/staging/imgtec/rogue/dc_server.c
+++ b/drivers/staging/imgtec/rogue/dc_server.c
@@ -849,22 +849,22 @@ static void _DCDisplayContextNotify(PVRSRV_CMDCOMP_HANDLE hCmdCompHandle)
_DCDisplayContextRun(psDisplayContext);
}
-static void _DCDebugRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel)
+static void _DCDebugRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle,
+ IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
DC_DISPLAY_CONTEXT *psDisplayContext = (DC_DISPLAY_CONTEXT*) hDebugRequestHandle;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
-
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
switch(ui32VerbLevel)
{
case DEBUG_REQUEST_VERBOSITY_LOW:
- PVR_DUMPDEBUG_LOG(("Configs in-flight = %d", psDisplayContext->ui32ConfigsInFlight));
+ PVR_DUMPDEBUG_LOG("Configs in-flight = %d", psDisplayContext->ui32ConfigsInFlight);
break;
case DEBUG_REQUEST_VERBOSITY_MEDIUM:
- PVR_DUMPDEBUG_LOG(("------[ Display context SCP status ]------"));
- SCPDumpStatus(psDisplayContext->psSCPContext);
+ PVR_DUMPDEBUG_LOG("------[ Display context SCP status ]------");
+ SCPDumpStatus(psDisplayContext->psSCPContext, pfnDumpDebugPrintf, pvDumpDebugFile);
break;
default:
diff --git a/drivers/staging/imgtec/rogue/devicemem.c b/drivers/staging/imgtec/rogue/devicemem.c
index f1eca5cae3f5..40444cdb45c9 100644
--- a/drivers/staging/imgtec/rogue/devicemem.c
+++ b/drivers/staging/imgtec/rogue/devicemem.c
@@ -556,12 +556,13 @@ DevmemCreateContext(SHARED_DEV_CONNECTION hDevConnection,
if (eError == PVRSRV_ERROR_BRIDGE_CALL_FAILED)
{
- psCtx->ui32CPUCacheLineSize = 0;
+ psCtx->ui32CPUCacheLineSize = 0;
eError = BridgeDevmemIntCtxCreate(psCtx->hDevConnection,
bHeapCfgMetaId,
&hDevMemServerContext,
&hPrivData);
}
+
if (eError != PVRSRV_OK)
{
goto e1;
diff --git a/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_bridge.h b/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_bridge.h
index 5e704bddc054..839a17aad1f1 100644
--- a/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_CACHEGENERIC_BRIDGE_H
#define CLIENT_CACHEGENERIC_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_cachegeneric_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dcachegeneric_bridge/client_cachegeneric_bridge.c b/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_direct_bridge.c
index d0cdf5ac6350..d0cdf5ac6350 100644
--- a/drivers/staging/imgtec/rogue/generated/dcachegeneric_bridge/client_cachegeneric_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/cachegeneric_bridge/client_cachegeneric_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_bridge.h b/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_bridge.h
index c5ae4f754f6d..1ed68b1576a1 100644
--- a/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_DEVICEMEMHISTORY_BRIDGE_H
#define CLIENT_DEVICEMEMHISTORY_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_devicememhistory_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c b/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_direct_bridge.c
index 21225f7bc61d..21225f7bc61d 100644
--- a/drivers/staging/imgtec/rogue/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/devicememhistory_bridge/client_devicememhistory_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_bridge.h b/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_bridge.h
index b19a8f0c64b2..e9d7f596685e 100644
--- a/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_HTBUFFER_BRIDGE_H
#define CLIENT_HTBUFFER_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_htbuffer_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dhtbuffer_bridge/client_htbuffer_bridge.c b/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_direct_bridge.c
index 3a44682bdef5..3a44682bdef5 100644
--- a/drivers/staging/imgtec/rogue/generated/dhtbuffer_bridge/client_htbuffer_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/htbuffer_bridge/client_htbuffer_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_bridge.h b/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_bridge.h
index ad00321acf52..eec0210e7adf 100644
--- a/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_MM_BRIDGE_H
#define CLIENT_MM_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_mm_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dmm_bridge/client_mm_bridge.c b/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_direct_bridge.c
index 0182976f257d..0182976f257d 100644
--- a/drivers/staging/imgtec/rogue/generated/dmm_bridge/client_mm_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/mm_bridge/client_mm_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h b/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h
index ce5f7a3d815a..6d06374c47d7 100644
--- a/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_PDUMPMM_BRIDGE_H
#define CLIENT_PDUMPMM_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_pdumpmm_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c b/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_direct_bridge.c
index 89999e282cf0..89999e282cf0 100644
--- a/drivers/staging/imgtec/rogue/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/pdumpmm_bridge/client_pdumpmm_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h b/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h
index e9107b8f0330..124a2611e25d 100644
--- a/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_PVRTL_BRIDGE_H
#define CLIENT_PVRTL_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_pvrtl_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dpvrtl_bridge/client_pvrtl_bridge.c b/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_direct_bridge.c
index d671ffaffbe6..d671ffaffbe6 100644
--- a/drivers/staging/imgtec/rogue/generated/dpvrtl_bridge/client_pvrtl_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/pvrtl_bridge/client_pvrtl_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_bridge.h b/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_bridge.h
index 3527c525428c..2e7bdd580006 100644
--- a/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_RGXINIT_BRIDGE_H
#define CLIENT_RGXINIT_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_rgxinit_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/drgxinit_bridge/client_rgxinit_bridge.c b/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_direct_bridge.c
index 9add8ee17638..9add8ee17638 100644
--- a/drivers/staging/imgtec/rogue/generated/drgxinit_bridge/client_rgxinit_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/rgxinit_bridge/client_rgxinit_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_bridge.h b/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_bridge.h
index c9ea7bf7a5c5..66517c233596 100644
--- a/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_RI_BRIDGE_H
#define CLIENT_RI_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_ri_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dri_bridge/client_ri_bridge.c b/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_direct_bridge.c
index 1578a684e03b..1578a684e03b 100644
--- a/drivers/staging/imgtec/rogue/generated/dri_bridge/client_ri_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/ri_bridge/client_ri_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_bridge.h b/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_bridge.h
index a25c34ccfe9e..612ad0586a16 100644
--- a/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_bridge.h
+++ b/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_bridge.h
@@ -44,8 +44,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef CLIENT_SYNC_BRIDGE_H
#define CLIENT_SYNC_BRIDGE_H
+#include "img_defs.h"
+#include "pvrsrv_error.h"
+
+#if defined(PVR_INDIRECT_BRIDGE_CLIENTS)
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
+#endif
#include "common_sync_bridge.h"
diff --git a/drivers/staging/imgtec/rogue/generated/dsync_bridge/client_sync_bridge.c b/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_direct_bridge.c
index edb4d51fb315..edb4d51fb315 100644
--- a/drivers/staging/imgtec/rogue/generated/dsync_bridge/client_sync_bridge.c
+++ b/drivers/staging/imgtec/rogue/generated/sync_bridge/client_sync_direct_bridge.c
diff --git a/drivers/staging/imgtec/rogue/hwdefs/km/cores/rgxcore_km_8.46.2.39.h b/drivers/staging/imgtec/rogue/hwdefs/km/cores/rgxcore_km_8.46.2.39.h
deleted file mode 100644
index e67078b2409a..000000000000
--- a/drivers/staging/imgtec/rogue/hwdefs/km/cores/rgxcore_km_8.46.2.39.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************/ /*!
-@Title RGX Core BVNC 8.46.2.39
-@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
-@License Dual MIT/GPLv2
-
-The contents of this file are subject to the MIT license as set out below.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-Alternatively, the contents of this file may be used under the terms of
-the GNU General Public License Version 2 ("GPL") in which case the provisions
-of GPL are applicable instead of those above.
-
-If you wish to allow use of your version of this file only under the terms of
-GPL, and not to allow others to use your version of this file under the terms
-of the MIT license, indicate your decision by deleting the provisions above
-and replace them with the notice and other provisions required by GPL as set
-out in the file called "GPL-COPYING" included in this distribution. If you do
-not delete the provisions above, a recipient may use your version of this file
-under the terms of either the MIT license or GPL.
-
-This License is also included in this distribution in the file called
-"MIT-COPYING".
-
-EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
-PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
-BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/ /**************************************************************************/
-
-#ifndef _RGXCORE_KM_8_46_2_39_H_
-#define _RGXCORE_KM_8_46_2_39_H_
-
-/***** Automatically generated file (10/08/2015 09:27:06): Do not edit manually ********************/
-/***** Timestamp: (10/08/2015 09:27:06)************************************************************/
-/***** CS: @3662942 ******************************************************************/
-
-
-/******************************************************************************
- * BVNC = 8.46.2.39
- *****************************************************************************/
-#define RGX_BVNC_KM_B 8
-#define RGX_BVNC_KM_V 46
-#define RGX_BVNC_KM_N 2
-#define RGX_BVNC_KM_C 39
-
-/******************************************************************************
- * Errata
- *****************************************************************************/
-
-
-
-
-/******************************************************************************
- * Enhancements
- *****************************************************************************/
-#define HW_ERN_36400
-#define HW_ERN_42290
-#define HW_ERN_42606
-#define HW_ERN_45914
-#define HW_ERN_46066
-#define HW_ERN_47025
-
-
-
-#endif /* _RGXCORE_KM_8_46_2_39_H_ */
diff --git a/drivers/staging/imgtec/rogue/mmu_common.c b/drivers/staging/imgtec/rogue/mmu_common.c
index 5b1f56384f77..e7bc25abfdbd 100644
--- a/drivers/staging/imgtec/rogue/mmu_common.c
+++ b/drivers/staging/imgtec/rogue/mmu_common.c
@@ -3330,7 +3330,10 @@ void MMU_GetOSids(MMU_CONTEXT *psMMUContext, IMG_UINT32 *pui32OSid, IMG_UINT32 *
/*
MMU_CheckFaultAddress
*/
-void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAddr)
+void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext,
+ IMG_DEV_VIRTADDR *psDevVAddr,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
MMU_DEVICEATTRIBS *psDevAttrs = psMMUContext->psDevAttrs;
const MMU_PxE_CONFIG *psConfig;
@@ -3345,7 +3348,6 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
IMG_UINT32 ui32PDIndex;
IMG_UINT32 ui32PTIndex;
IMG_UINT32 ui32Log2PageSize;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
OSLockAcquire(psMMUContext->hLock);
@@ -3378,7 +3380,7 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
if (ui32PCIndex >= psLevel->ui32NumOfEntries)
{
- PVR_DUMPDEBUG_LOG(("PC index (%d) out of bounds (%d)", ui32PCIndex, psLevel->ui32NumOfEntries));
+ PVR_DUMPDEBUG_LOG("PC index (%d) out of bounds (%d)", ui32PCIndex, psLevel->ui32NumOfEntries);
break;
}
@@ -3386,19 +3388,19 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
{
IMG_UINT32 *pui32Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PCE for index %d = 0x%08x and %s be valid",
+ PVR_DUMPDEBUG_LOG("PCE for index %d = 0x%08x and %s be valid",
ui32PCIndex,
pui32Ptr[ui32PCIndex],
- psLevel->apsNextLevel[ui32PCIndex]?"should":"should not"));
+ psLevel->apsNextLevel[ui32PCIndex]?"should":"should not");
}
else
{
IMG_UINT64 *pui64Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PCE for index %d = 0x%016llx and %s be valid",
+ PVR_DUMPDEBUG_LOG("PCE for index %d = 0x%016llx and %s be valid",
ui32PCIndex,
pui64Ptr[ui32PCIndex],
- psLevel->apsNextLevel[ui32PCIndex]?"should":"should not"));
+ psLevel->apsNextLevel[ui32PCIndex]?"should":"should not");
}
psLevel = psLevel->apsNextLevel[ui32PCIndex];
@@ -3418,7 +3420,7 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
if (ui32PDIndex >= psLevel->ui32NumOfEntries)
{
- PVR_DUMPDEBUG_LOG(("PD index (%d) out of bounds (%d)", ui32PDIndex, psLevel->ui32NumOfEntries));
+ PVR_DUMPDEBUG_LOG("PD index (%d) out of bounds (%d)", ui32PDIndex, psLevel->ui32NumOfEntries);
break;
}
@@ -3426,10 +3428,10 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
{
IMG_UINT32 *pui32Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PDE for index %d = 0x%08x and %s be valid",
+ PVR_DUMPDEBUG_LOG("PDE for index %d = 0x%08x and %s be valid",
ui32PDIndex,
pui32Ptr[ui32PDIndex],
- psLevel->apsNextLevel[ui32PDIndex]?"should":"should not"));
+ psLevel->apsNextLevel[ui32PDIndex]?"should":"should not");
if (psDevAttrs->pfnGetPageSizeFromPDE4(pui32Ptr[ui32PDIndex], &ui32Log2PageSize) != PVRSRV_OK)
{
@@ -3440,10 +3442,10 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
{
IMG_UINT64 *pui64Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PDE for index %d = 0x%016llx and %s be valid",
+ PVR_DUMPDEBUG_LOG("PDE for index %d = 0x%016llx and %s be valid",
ui32PDIndex,
pui64Ptr[ui32PDIndex],
- psLevel->apsNextLevel[ui32PDIndex]?"should":"should not"));
+ psLevel->apsNextLevel[ui32PDIndex]?"should":"should not");
if (psDevAttrs->pfnGetPageSizeFromPDE8(pui64Ptr[ui32PDIndex], &ui32Log2PageSize) != PVRSRV_OK)
{
@@ -3491,7 +3493,7 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
if (ui32PTIndex >= psLevel->ui32NumOfEntries)
{
- PVR_DUMPDEBUG_LOG(("PT index (%d) out of bounds (%d)", ui32PTIndex, psLevel->ui32NumOfEntries));
+ PVR_DUMPDEBUG_LOG("PT index (%d) out of bounds (%d)", ui32PTIndex, psLevel->ui32NumOfEntries);
break;
}
@@ -3499,17 +3501,17 @@ void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAd
{
IMG_UINT32 *pui32Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PTE for index %d = 0x%08x",
+ PVR_DUMPDEBUG_LOG("PTE for index %d = 0x%08x",
ui32PTIndex,
- pui32Ptr[ui32PTIndex]));
+ pui32Ptr[ui32PTIndex]);
}
else
{
IMG_UINT64 *pui64Ptr = psLevel->sMemDesc.pvCpuVAddr;
- PVR_DUMPDEBUG_LOG(("PTE for index %d = 0x%016llx",
+ PVR_DUMPDEBUG_LOG("PTE for index %d = 0x%016llx",
ui32PTIndex,
- pui64Ptr[ui32PTIndex]));
+ pui64Ptr[ui32PTIndex]);
}
break;
diff --git a/drivers/staging/imgtec/rogue/mmu_common.h b/drivers/staging/imgtec/rogue/mmu_common.h
index c2bbc3b11f71..84e481fd5b49 100644
--- a/drivers/staging/imgtec/rogue/mmu_common.h
+++ b/drivers/staging/imgtec/rogue/mmu_common.h
@@ -83,6 +83,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* include/ */
#include "img_types.h"
+#include "pvr_notifier.h"
#include "pvrsrv_error.h"
#include "servicesext.h"
@@ -593,10 +594,18 @@ void MMU_SetDeviceData(MMU_CONTEXT *psMMUContext, IMG_HANDLE hDevData);
@Input psDevVAddr Address to check
+@Input pfnDumpDebugPrintf Debug print function
+
+@Input pvDumpDebugFile Optional file identifier to be passed
+ to the debug print function if required
+
@Return None
*/
/*****************************************************************************/
-void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext, IMG_DEV_VIRTADDR *psDevVAddr);
+void MMU_CheckFaultAddress(MMU_CONTEXT *psMMUContext,
+ IMG_DEV_VIRTADDR *psDevVAddr,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/*************************************************************************/ /*!
@Function MMUI_IsVDevAddrValid
diff --git a/drivers/staging/imgtec/rogue/osfunc.c b/drivers/staging/imgtec/rogue/osfunc.c
index 0167e963ff53..94188d18754c 100644
--- a/drivers/staging/imgtec/rogue/osfunc.c
+++ b/drivers/staging/imgtec/rogue/osfunc.c
@@ -124,15 +124,6 @@ PVRSRV_ERROR OSPhyContigPagesAlloc(PVRSRV_DEVICE_NODE *psDevNode, size_t uiSize,
/*Get the order to be used with the allocation */
ui32Order = get_order(uiSize);
- if (ui32Order > PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER_NUM)
- {
- PVR_DPF((PVR_DBG_ERROR,
- "Trying to allocate page order %u, max allowed %u",
- ui32Order,
- PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER_NUM));
- return PVRSRV_ERROR_INVALID_PARAMS;
- }
-
/*allocate the pages */
psPage = alloc_pages(GFP_KERNEL, ui32Order);
if (psPage == NULL)
diff --git a/drivers/staging/imgtec/rogue/physmem.c b/drivers/staging/imgtec/rogue/physmem.c
index 6645202f1e31..33f4219d6356 100644
--- a/drivers/staging/imgtec/rogue/physmem.c
+++ b/drivers/staging/imgtec/rogue/physmem.c
@@ -122,6 +122,17 @@ PVRSRV_ERROR DevPhysMemAlloc(PVRSRV_DEVICE_NODE *psDevNode,
/*Fill the memory with given content */
OSMemSet(pvCpuVAddr, u8Value, ui32MemSize);
+ /*Map the page to the CPU VA space */
+ eError = psDevNode->pfnDevPxClean(psMemHandle,
+ 0,
+ ui32MemSize);
+ if(PVRSRV_OK != eError)
+ {
+ PVR_DPF((PVR_DBG_ERROR,"Unable to clean the allocated page"));
+ psDevNode->pfnDevPxUnMap(psDevNode, psMemHandle, pvCpuVAddr);
+ psDevNode->pfnDevPxFree(psDevNode, psMemHandle);
+ return eError;
+ }
#if defined(PDUMP)
/*P-Dumping of the page contents can be done in two ways
diff --git a/drivers/staging/imgtec/rogue/power.c b/drivers/staging/imgtec/rogue/power.c
index ca6c9bd2dc11..9aeb322b9a3d 100644
--- a/drivers/staging/imgtec/rogue/power.c
+++ b/drivers/staging/imgtec/rogue/power.c
@@ -862,7 +862,7 @@ ErrorExit:
"PVRSRVSetPowerStateKM: Transition from %d to %d FAILED (%s) at stage %d, forced: %d. Dumping debug info.",
psPVRSRVData->eCurrentPowerState, eNewSysPowerState, PVRSRVGetErrorStringKM(eError), uiStage, bForced));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
return eError;
}
diff --git a/drivers/staging/imgtec/rogue/pvr_debug.c b/drivers/staging/imgtec/rogue/pvr_debug.c
index c74e696b986a..85de04d65113 100644
--- a/drivers/staging/imgtec/rogue/pvr_debug.c
+++ b/drivers/staging/imgtec/rogue/pvr_debug.c
@@ -947,20 +947,17 @@ static void *_DebugDumpDebugSeqNext(struct seq_file *psSeqFile,
*puiPosition);
}
-static struct seq_file *gpsDumpDebugPrintfSeqFile = NULL;
-
-static void _DumpDebugSeqPrintf(const IMG_CHAR *pszFormat, ...)
+static void _DumpDebugSeqPrintf(void *pvDumpDebugFile,
+ const IMG_CHAR *pszFormat, ...)
{
- if (gpsDumpDebugPrintfSeqFile)
- {
- IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESSAGE_LEN];
- va_list ArgList;
-
- va_start(ArgList, pszFormat);
- vsnprintf(szBuffer, PVR_MAX_DEBUG_MESSAGE_LEN, pszFormat, ArgList);
- seq_printf(gpsDumpDebugPrintfSeqFile, "%s\n", szBuffer);
- va_end(ArgList);
- }
+ struct seq_file *psSeqFile = (struct seq_file *)pvDumpDebugFile;
+ IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESSAGE_LEN];
+ va_list ArgList;
+
+ va_start(ArgList, pszFormat);
+ vsnprintf(szBuffer, PVR_MAX_DEBUG_MESSAGE_LEN, pszFormat, ArgList);
+ va_end(ArgList);
+ seq_printf(psSeqFile, "%s\n", szBuffer);
}
static int _DebugDumpDebugSeqShow(struct seq_file *psSeqFile, void *pvData)
@@ -968,20 +965,18 @@ static int _DebugDumpDebugSeqShow(struct seq_file *psSeqFile, void *pvData)
if (pvData != NULL && pvData != SEQ_START_TOKEN)
{
PVRSRV_DEVICE_NODE *psDeviceNode = (PVRSRV_DEVICE_NODE *)pvData;
-
+
if (psDeviceNode->pvDevice != NULL)
{
- gpsDumpDebugPrintfSeqFile = psSeqFile;
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, _DumpDebugSeqPrintf);
- gpsDumpDebugPrintfSeqFile = NULL;
-
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX,
+ _DumpDebugSeqPrintf, psSeqFile);
}
}
return 0;
}
-static struct seq_operations gsDumpDebugReadOps =
+static struct seq_operations gsDumpDebugReadOps =
{
.start = _DebugDumpDebugSeqStart,
.stop = _DebugDumpDebugSeqStop,
@@ -1042,20 +1037,17 @@ static void *_DebugFWTraceSeqNext(struct seq_file *psSeqFile,
*puiPosition);
}
-static struct seq_file *gpsFWTracePrintfSeqFile = NULL;
-
-static void _FWTraceSeqPrintf(const IMG_CHAR *pszFormat, ...)
+static void _FWTraceSeqPrintf(void *pvDumpDebugFile,
+ const IMG_CHAR *pszFormat, ...)
{
- if (gpsFWTracePrintfSeqFile)
- {
- IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESSAGE_LEN];
- va_list ArgList;
-
- va_start(ArgList, pszFormat);
- vsnprintf(szBuffer, PVR_MAX_DEBUG_MESSAGE_LEN, pszFormat, ArgList);
- seq_printf(gpsFWTracePrintfSeqFile, "%s\n", szBuffer);
- va_end(ArgList);
- }
+ struct seq_file *psSeqFile = (struct seq_file *)pvDumpDebugFile;
+ IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESSAGE_LEN];
+ va_list ArgList;
+
+ va_start(ArgList, pszFormat);
+ vsnprintf(szBuffer, PVR_MAX_DEBUG_MESSAGE_LEN, pszFormat, ArgList);
+ va_end(ArgList);
+ seq_printf(psSeqFile, "%s\n", szBuffer);
}
static int _DebugFWTraceSeqShow(struct seq_file *psSeqFile, void *pvData)
@@ -1063,21 +1055,19 @@ static int _DebugFWTraceSeqShow(struct seq_file *psSeqFile, void *pvData)
if (pvData != NULL && pvData != SEQ_START_TOKEN)
{
PVRSRV_DEVICE_NODE *psDeviceNode = (PVRSRV_DEVICE_NODE *)pvData;
-
+
if (psDeviceNode->pvDevice != NULL)
{
PVRSRV_RGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
- gpsFWTracePrintfSeqFile = psSeqFile;
- RGXDumpFirmwareTrace(_FWTraceSeqPrintf, psDevInfo);
- gpsFWTracePrintfSeqFile = NULL;
+ RGXDumpFirmwareTrace(_FWTraceSeqPrintf, psSeqFile, psDevInfo);
}
}
return 0;
}
-static struct seq_operations gsFWTraceReadOps =
+static struct seq_operations gsFWTraceReadOps =
{
.start = _DebugFWTraceSeqStart,
.stop = _DebugFWTraceSeqStop,
diff --git a/drivers/staging/imgtec/rogue/pvr_bridge_client.h b/drivers/staging/imgtec/rogue/pvr_notifier.h
index 2868d011b884..132bd6c07938 100644
--- a/drivers/staging/imgtec/rogue/pvr_bridge_client.h
+++ b/drivers/staging/imgtec/rogue/pvr_notifier.h
@@ -1,8 +1,7 @@
-/*************************************************************************/ /*!
+/**************************************************************************/ /*!
@File
-@Title PVR Bridge Functionality
+@Title PowerVR notifier interface
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
-@Description Header for the PVR Bridge code
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
@@ -39,48 +38,36 @@ PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/ /**************************************************************************/
+*/ /***************************************************************************/
-#ifndef __PVR_BRIDGE_U_H__
-#define __PVR_BRIDGE_U_H__
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
+#if !defined(__PVR_NOTIFIER_H__)
+#define __PVR_NOTIFIER_H__
#include "img_types.h"
-#include "pvrsrv_error.h"
-
-
-/******************************************************************************
- * Function prototypes
- *****************************************************************************/
-#if(__SIZEOF_POINTER__ == 4)
-IMG_EXPORT IMG_BOOL PVRSRVIsKernel64Bit(void);
-#endif
-
-PVRSRV_ERROR OpenServices(IMG_HANDLE *phServices,
- IMG_OS_CONNECTION hOSConnection,
- IMG_UINT32 ui32SrvFlags);
-PVRSRV_ERROR CloseServices(IMG_HANDLE hServices);
-PVRSRV_ERROR PVRSRVBridgeCall(IMG_HANDLE hServices,
- IMG_UINT8 ui8BridgeGroup,
- IMG_UINT32 ui32FunctionID,
- void *pvParamIn,
- IMG_UINT32 ui32InBufferSize,
- void *pvParamOut,
- IMG_UINT32 ui32OutBufferSize);
-
-IMG_OS_CONNECTION GetOSConnection(IMG_HANDLE hServices);
-
-
-#if defined (__cplusplus)
-}
-#endif
-#endif /* __PVR_BRIDGE_U_H__ */
-
-/******************************************************************************
- End of file (pvr_bridge_u.h)
-******************************************************************************/
-
-
+#include "pvr_debug.h"
+
+/*
+ * Macro used within debug dump functions to send output either to PVR_LOG or
+ * a custom function. The custom function should be stored as a function pointer
+ * in a local variable called 'pfnDumpDebugPrintf'. 'pvDumpDebugFile' is also
+ * required as a local variable to serve as a file identifier for the printf
+ * function if required.
+ */
+#define PVR_DUMPDEBUG_LOG(...) \
+ do \
+ { \
+ if (pfnDumpDebugPrintf) \
+ pfnDumpDebugPrintf(pvDumpDebugFile, __VA_ARGS__); \
+ else \
+ PVR_LOG((__VA_ARGS__)); \
+ } while(0)
+
+typedef IMG_HANDLE PVRSRV_DBGREQ_HANDLE;
+typedef void (DUMPDEBUG_PRINTF_FUNC)(void *pvDumpDebugFile,
+ const IMG_CHAR *pszFormat, ...);
+typedef void (*PFN_DBGREQ_NOTIFY)(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle,
+ IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
+
+#endif /* !defined(__PVR_NOTIFIER_H__) */
diff --git a/drivers/staging/imgtec/rogue/pvrsrv.c b/drivers/staging/imgtec/rogue/pvrsrv.c
index 5b826d924b9e..605e09daafba 100644
--- a/drivers/staging/imgtec/rogue/pvrsrv.c
+++ b/drivers/staging/imgtec/rogue/pvrsrv.c
@@ -144,7 +144,8 @@ static PVRSRV_ERROR IMG_CALLCONV PVRSRVUnregisterDevice(PVRSRV_DEVICE_NODE *psDe
static PVRSRV_ERROR PVRSRVRegisterDbgTable(IMG_UINT32 *paui32Table, IMG_UINT32 ui32Length, void **phTable);
static void PVRSRVUnregisterDbgTable(void *hTable);
-static void _SysDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel);
+static void _SysDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile);
IMG_UINT32 g_ui32InitFlags;
@@ -171,8 +172,6 @@ static IMG_UINT32 g_aui32DebugOrderTable[] = {
DEBUG_REQUEST_LINUXFENCE
};
-DUMPDEBUG_PRINTF_FUNC *g_pfnDumpDebugPrintf = NULL;
-
/*!
******************************************************************************
@@ -700,7 +699,7 @@ static void DevicesWatchdogThread(void *pvData)
if (!(psDevInfo->ui32DeviceFlags & RGXKM_DEVICE_STATE_DISABLE_DW_LOGGING_EN))
{
PVR_DPF((PVR_DBG_ERROR, "DevicesWatchdogThread: Device not responding!!!"));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
}
}
}
@@ -1937,7 +1936,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful, IMG_UIN
if (eError != PVRSRV_OK)
{
PVRSRVPowerUnlock();
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
return eError;
}
@@ -2212,7 +2211,7 @@ static PVRSRV_ERROR IMG_CALLCONV PVRSRVUnregisterDevice(PVRSRV_DEVICE_NODE *psDe
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVUnregisterDevice: Failed PVRSRVSetDevicePowerStateKM call (%s). Dump debug.", PVRSRVGetErrorStringKM(eError)));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
/* If the driver is okay then return the error, otherwise we can ignore this error. */
if (PVRSRVGetPVRSRVData()->eServicesState == PVRSRV_SERVICES_STATE_OK)
@@ -2521,9 +2520,10 @@ const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError)
/*
PVRSRVSystemDebugInfo
*/
-PVRSRV_ERROR PVRSRVSystemDebugInfo( DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+PVRSRV_ERROR PVRSRVSystemDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
- return SysDebugInfo(gpsSysConfig, pfnDumpDebugPrintf);
+ return SysDebugInfo(gpsSysConfig, pfnDumpDebugPrintf, pvDumpDebugFile);
}
/*
@@ -2651,39 +2651,38 @@ PVRSRV_ERROR PVRSRVUnregisterCmdCompleteNotify(IMG_HANDLE hNotify)
}
-static void _SysDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel)
+static void _SysDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile)
{
PVRSRV_DATA *psPVRSRVData = (PVRSRV_DATA*) hDebugRequestHandle;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
/* only dump info on the lowest verbosity level */
if (ui32VerbLevel != DEBUG_REQUEST_VERBOSITY_LOW)
{
return;
}
- PVR_DUMPDEBUG_LOG(("DDK info: %s (%s) %s", PVRVERSION_STRING, PVR_BUILD_TYPE, PVR_BUILD_DIR));
- PVR_DUMPDEBUG_LOG(("Time now: %015llu", OSClockus64()));
+ PVR_DUMPDEBUG_LOG("DDK info: %s (%s) %s", PVRVERSION_STRING, PVR_BUILD_TYPE, PVR_BUILD_DIR);
+ PVR_DUMPDEBUG_LOG("Time now: %015llu", OSClockus64());
/* Services state */
switch (psPVRSRVData->eServicesState)
{
case PVRSRV_SERVICES_STATE_OK:
{
- PVR_DUMPDEBUG_LOG(("Services State: OK"));
+ PVR_DUMPDEBUG_LOG("Services State: OK");
break;
}
case PVRSRV_SERVICES_STATE_BAD:
{
- PVR_DUMPDEBUG_LOG(("Services State: BAD"));
+ PVR_DUMPDEBUG_LOG("Services State: BAD");
break;
}
default:
{
- PVR_DUMPDEBUG_LOG(("Services State: UNKNOWN (%d)", psPVRSRVData->eServicesState));
+ PVR_DUMPDEBUG_LOG("Services State: UNKNOWN (%d)", psPVRSRVData->eServicesState);
break;
}
}
@@ -2693,35 +2692,34 @@ static void _SysDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG
{
case PVRSRV_SYS_POWER_STATE_OFF:
{
- PVR_DUMPDEBUG_LOG(("System Power State: OFF"));
+ PVR_DUMPDEBUG_LOG("System Power State: OFF");
break;
}
case PVRSRV_SYS_POWER_STATE_ON:
{
- PVR_DUMPDEBUG_LOG(("System Power State: ON"));
+ PVR_DUMPDEBUG_LOG("System Power State: ON");
break;
}
default:
{
- PVR_DUMPDEBUG_LOG(("System Power State: UNKNOWN (%d)", psPVRSRVData->eCurrentPowerState));
+ PVR_DUMPDEBUG_LOG("System Power State: UNKNOWN (%d)", psPVRSRVData->eCurrentPowerState);
break;
}
}
/* Dump system specific debug info */
- PVRSRVSystemDebugInfo(pfnDumpDebugPrintf);
+ PVRSRVSystemDebugInfo(pfnDumpDebugPrintf, pvDumpDebugFile);
}
/*
PVRSRVDebugRequest
*/
-void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile)
{
IMG_UINT32 i,j;
- g_pfnDumpDebugPrintf = pfnDumpDebugPrintf;
- if (pfnDumpDebugPrintf == NULL)
+ if (pvDumpDebugFile == NULL)
{
/* Only dump the call stack to the kernel log if the debug text is going there. */
OSDumpStack();
@@ -2731,7 +2729,7 @@ void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_
/* Lock the lists */
OSWRLockAcquireRead(g_hDbgNotifyLock);
- PVR_DUMPDEBUG_LOG(("------------[ PVR DBG: START ]------------"));
+ PVR_DUMPDEBUG_LOG("------------[ PVR DBG: START ]------------");
/* For each verbosity level */
for (j=0;j<(ui32VerbLevel+1);j++)
@@ -2744,11 +2742,11 @@ void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_
{
PVRSRV_DBGREQ_NOTIFY *psNotify =
IMG_CONTAINER_OF(psNode, PVRSRV_DBGREQ_NOTIFY, sListNode);
- psNotify->pfnDbgRequestNotify(psNotify->hDbgRequestHandle, j);
+ psNotify->pfnDbgRequestNotify(psNotify->hDbgRequestHandle, j, pfnDumpDebugPrintf, pvDumpDebugFile);
}
}
}
- PVR_DUMPDEBUG_LOG(("------------[ PVR DBG: END ]------------"));
+ PVR_DUMPDEBUG_LOG("------------[ PVR DBG: END ]------------");
/* Unlock the lists */
OSWRLockReleaseRead(g_hDbgNotifyLock);
diff --git a/drivers/staging/imgtec/rogue/pvrsrv.h b/drivers/staging/imgtec/rogue/pvrsrv.h
index 9a5f28332988..83e478761c3c 100644
--- a/drivers/staging/imgtec/rogue/pvrsrv.h
+++ b/drivers/staging/imgtec/rogue/pvrsrv.h
@@ -53,6 +53,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "power.h"
#include "sysinfo.h"
#include "physheap.h"
+#include "pvr_notifier.h"
#include "connection_server.h"
@@ -147,9 +148,6 @@ typedef struct PVRSRV_CMDCOMP_NOTIFY_TAG
#define DEBUG_REQUEST_VERBOSITY_MAX (DEBUG_REQUEST_VERBOSITY_HIGH)
-typedef IMG_HANDLE PVRSRV_DBGREQ_HANDLE;
-typedef void (*PFN_DBGREQ_NOTIFY) (PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel);
-
typedef struct PVRSRV_DBGREQ_NOTIFY_TAG
{
PVRSRV_DBGREQ_HANDLE hDbgRequestHandle;
@@ -159,46 +157,12 @@ typedef struct PVRSRV_DBGREQ_NOTIFY_TAG
DLLIST_NODE sListNode;
} PVRSRV_DBGREQ_NOTIFY;
-/*!
-*******************************************************************************
-
- @Description
-
- Macro used within debug dump functions to send output either to PVR_LOG or
- a custom function.
-
-******************************************************************************/
-#define PVR_DUMPDEBUG_LOG(x) \
- do \
- { \
- if (pfnDumpDebugPrintf) \
- { \
- pfnDumpDebugPrintf x; \
- } \
- else \
- { \
- PVR_LOG(x); \
- } \
- } while(0)
-
#define PVR_DUMP_DRIVER_INFO(x, y) \
- PVR_DUMPDEBUG_LOG(("%s info: BuildOptions: 0x%08x BuildVersion: %d.%d BuildRevision: %8d BuildType: %s", (x), \
+ PVR_DUMPDEBUG_LOG("%s info: BuildOptions: 0x%08x BuildVersion: %d.%d BuildRevision: %8d BuildType: %s", (x), \
(y).ui32BuildOptions, \
PVRVERSION_UNPACK_MAJ((y).ui32BuildVersion), PVRVERSION_UNPACK_MIN((y).ui32BuildVersion), \
(y).ui32BuildRevision, \
- (BUILD_TYPE_DEBUG == (y).ui32BuildType)?"debug":"release"))
-/*!
-*******************************************************************************
-
- @Description
-
- Typedef for custom debug dump output functions.
-
-******************************************************************************/
-typedef void (DUMPDEBUG_PRINTF_FUNC)(const IMG_CHAR *pszFormat, ...);
-
-extern DUMPDEBUG_PRINTF_FUNC *g_pfnDumpDebugPrintf;
-
+ (BUILD_TYPE_DEBUG == (y).ui32BuildType)?"debug":"release")
/*!
******************************************************************************
@@ -315,7 +279,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWaitForValueKMAndHoldBridgeLockKM(volatile IMG_U
be used as the default printing function.
*****************************************************************************/
-PVRSRV_ERROR PVRSRVSystemDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+PVRSRV_ERROR PVRSRVSystemDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/*!
*****************************************************************************
@@ -442,7 +407,7 @@ PVRSRV_ERROR PVRSRVUnregisterCmdCompleteNotify(IMG_HANDLE hNotify);
be used as the default printing function.
*****************************************************************************/
-void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+void IMG_CALLCONV PVRSRVDebugRequest(IMG_UINT32 ui32VerbLevel, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile);
/*!
*****************************************************************************
diff --git a/drivers/staging/imgtec/rogue/rgxccb.c b/drivers/staging/imgtec/rogue/rgxccb.c
index b4ee50118a47..720157e19816 100644
--- a/drivers/staging/imgtec/rogue/rgxccb.c
+++ b/drivers/staging/imgtec/rogue/rgxccb.c
@@ -1571,8 +1571,8 @@ PVRSRV_ERROR CheckForStalledCCB(RGX_CLIENT_CCB *psCurrentClientCCB)
void DumpCCB(
PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
RGX_CLIENT_CCB *psCurrentClientCCB,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf
-)
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
volatile RGXFWIF_CCCB_CTL *psClientCCBCtrl = psCurrentClientCCB->psClientCCBCtrl;
IMG_UINT8 *pui8ClientCCBBuff = psCurrentClientCCB->pui8ClientCCB;
@@ -1582,11 +1582,11 @@ void DumpCCB(
IMG_UINT32 ui32WrapMask = psClientCCBCtrl->ui32WrapMask;
IMG_CHAR * pszState = "Ready";
- PVR_DUMPDEBUG_LOG(("FWCtx 0x%08X (%s)", sFWCommonContext.ui32Addr,
- (IMG_PCHAR)&psCurrentClientCCB->szName));
+ PVR_DUMPDEBUG_LOG("FWCtx 0x%08X (%s)", sFWCommonContext.ui32Addr,
+ (IMG_PCHAR)&psCurrentClientCCB->szName);
if (ui32Offset == ui32EndOffset)
{
- PVR_DUMPDEBUG_LOG((" `--<Empty>"));
+ PVR_DUMPDEBUG_LOG(" `--<Empty>");
}
while (ui32Offset != ui32EndOffset)
@@ -1609,11 +1609,11 @@ void DumpCCB(
pszState = "Waiting";
}
- PVR_DUMPDEBUG_LOG((" %s--%s %s @ %u Int=%u Ext=%u",
+ PVR_DUMPDEBUG_LOG(" %s--%s %s @ %u Int=%u Ext=%u",
bLastCommand? "`": "|",
pszState, _CCBCmdTypename(psCmdHeader->eCmdType),
ui32Offset, psCmdHeader->ui32IntJobRef, psCmdHeader->ui32ExtJobRef
- ));
+ );
/* switch on type and write checks and updates */
switch (psCmdHeader->eCmdType)
@@ -1629,12 +1629,12 @@ void DumpCCB(
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
SyncRecordLookup(psUFOPtr->puiAddrUFO.ui32Addr, pszSyncInfo, CCB_SYNC_INFO_LEN);
#endif
- PVR_DUMPDEBUG_LOG((" %s %s--Addr:0x%08x Val=0x%08x %s",
+ PVR_DUMPDEBUG_LOG(" %s %s--Addr:0x%08x Val=0x%08x %s",
bLastCommand? " ": "|",
bLastUFO? "`": "|",
psUFOPtr->puiAddrUFO.ui32Addr, psUFOPtr->ui32Value,
pszSyncInfo
- ));
+ );
}
break;
}
@@ -1648,12 +1648,12 @@ void DumpCCB(
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
SyncRecordLookup(psUFOPtr->puiAddrUFO.ui32Addr, pszSyncInfo, CCB_SYNC_INFO_LEN);
#endif
- PVR_DUMPDEBUG_LOG((" %s %s--Addr:0x%08x Val++ %s",
+ PVR_DUMPDEBUG_LOG(" %s %s--Addr:0x%08x Val++ %s",
bLastCommand? " ": "|",
bLastUFO? "`": "|",
psUFOPtr->puiAddrUFO.ui32Addr,
pszSyncInfo
- ));
+ );
}
break;
}
@@ -1668,8 +1668,9 @@ void DumpCCB(
#endif /* defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING) || defined(PVRSRV_ENABLE_FULL_CCB_DUMP) */
void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
- RGX_CLIENT_CCB *psCurrentClientCCB,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+ RGX_CLIENT_CCB *psCurrentClientCCB,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
volatile RGXFWIF_CCCB_CTL *psClientCCBCtrl = psCurrentClientCCB->psClientCCBCtrl;
IMG_UINT8 *pui8ClientCCBBuff = psCurrentClientCCB->pui8ClientCCB;
@@ -1694,20 +1695,20 @@ void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
IMG_UINT32 jj;
/* Display details of the fence object on which the context is pending */
- PVR_DUMPDEBUG_LOG(("FWCtx 0x%08X @ %d (%s) pending on %s:",
+ PVR_DUMPDEBUG_LOG("FWCtx 0x%08X @ %d (%s) pending on %s:",
sFWCommonContext.ui32Addr,
ui32SampledRdOff,
(IMG_PCHAR)&psCurrentClientCCB->szName,
- _CCBCmdTypename(eCommandType)));
+ _CCBCmdTypename(eCommandType));
for (jj=0; jj<psCommandHeader->ui32CmdSize/sizeof(RGXFWIF_UFO); jj++)
{
#if !defined(SUPPORT_EXTRA_METASP_DEBUG)
- PVR_DUMPDEBUG_LOG((" Addr:0x%08x Value=0x%08x",psUFOPtr[jj].puiAddrUFO.ui32Addr, psUFOPtr[jj].ui32Value));
+ PVR_DUMPDEBUG_LOG(" Addr:0x%08x Value=0x%08x",psUFOPtr[jj].puiAddrUFO.ui32Addr, psUFOPtr[jj].ui32Value);
#else
- PVR_DUMPDEBUG_LOG((" Addr:0x%08x Value(Host)=0x%08x Value(FW)=0x%08x",
+ PVR_DUMPDEBUG_LOG(" Addr:0x%08x Value(Host)=0x%08x Value(FW)=0x%08x",
psUFOPtr[jj].puiAddrUFO.ui32Addr,
psUFOPtr[jj].ui32Value,
- RGXReadWithSP(psUFOPtr[jj].puiAddrUFO.ui32Addr)));
+ RGXReadWithSP(psUFOPtr[jj].puiAddrUFO.ui32Addr));
#endif
}
@@ -1716,7 +1717,7 @@ void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
psCommandHeader = (RGXFWIF_CCB_CMD_HEADER *)pui8Ptr;
if( (uintptr_t)psCommandHeader != ((uintptr_t)pui8ClientCCBBuff + ui32SampledWrOff))
{
- PVR_DUMPDEBUG_LOG((" FWCtx 0x%08X fenced command is of type %s",sFWCommonContext.ui32Addr, _CCBCmdTypename(psCommandHeader->eCmdType)));
+ PVR_DUMPDEBUG_LOG(" FWCtx 0x%08X fenced command is of type %s",sFWCommonContext.ui32Addr, _CCBCmdTypename(psCommandHeader->eCmdType));
/* Advance psCommandHeader past the TA/3D to the next command header (this will possibly be an UPDATE) */
pui8Ptr += sizeof(*psCommandHeader) + psCommandHeader->ui32CmdSize;
psCommandHeader = (RGXFWIF_CCB_CMD_HEADER *)pui8Ptr;
@@ -1728,28 +1729,28 @@ void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
if (eCommandType == RGXFWIF_CCB_CMD_TYPE_UPDATE)
{
psUFOPtr = (RGXFWIF_UFO *)((IMG_UINT8 *)psCommandHeader + sizeof(*psCommandHeader));
- PVR_DUMPDEBUG_LOG((" preventing %s:",_CCBCmdTypename(eCommandType)));
+ PVR_DUMPDEBUG_LOG(" preventing %s:",_CCBCmdTypename(eCommandType));
for (jj=0; jj<psCommandHeader->ui32CmdSize/sizeof(RGXFWIF_UFO); jj++)
{
#if !defined(SUPPORT_EXTRA_METASP_DEBUG)
- PVR_DUMPDEBUG_LOG((" Addr:0x%08x Value=0x%08x",psUFOPtr[jj].puiAddrUFO.ui32Addr, psUFOPtr[jj].ui32Value));
+ PVR_DUMPDEBUG_LOG(" Addr:0x%08x Value=0x%08x",psUFOPtr[jj].puiAddrUFO.ui32Addr, psUFOPtr[jj].ui32Value);
#else
- PVR_DUMPDEBUG_LOG((" Addr:0x%08x Value(Host)=0x%08x Value(FW)=0x%08x",
+ PVR_DUMPDEBUG_LOG(" Addr:0x%08x Value(Host)=0x%08x Value(FW)=0x%08x",
psUFOPtr[jj].puiAddrUFO.ui32Addr,
psUFOPtr[jj].ui32Value,
- RGXReadWithSP(psUFOPtr[jj].puiAddrUFO.ui32Addr)));
+ RGXReadWithSP(psUFOPtr[jj].puiAddrUFO.ui32Addr));
#endif
}
}
}
else
{
- PVR_DUMPDEBUG_LOG((" FWCtx 0x%08X has no further commands",sFWCommonContext.ui32Addr));
+ PVR_DUMPDEBUG_LOG(" FWCtx 0x%08X has no further commands",sFWCommonContext.ui32Addr);
}
}
else
{
- PVR_DUMPDEBUG_LOG((" FWCtx 0x%08X has no further commands",sFWCommonContext.ui32Addr));
+ PVR_DUMPDEBUG_LOG(" FWCtx 0x%08X has no further commands",sFWCommonContext.ui32Addr);
}
}
}
diff --git a/drivers/staging/imgtec/rogue/rgxccb.h b/drivers/staging/imgtec/rogue/rgxccb.h
index 8fdd31eafd36..3f06058f8bd0 100644
--- a/drivers/staging/imgtec/rogue/rgxccb.h
+++ b/drivers/staging/imgtec/rogue/rgxccb.h
@@ -223,9 +223,12 @@ void RGXCmdHelperReleaseCmdCCB(IMG_UINT32 ui32CmdCount,
IMG_UINT32 RGXCmdHelperGetCommandSize(IMG_UINT32 ui32CmdCount,
RGX_CCB_CMD_HELPER_DATA *asCmdHelperData);
-void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext, RGX_CLIENT_CCB *psCurrentClientCCB, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+void DumpStalledCCBCommand(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext,
+ RGX_CLIENT_CCB *psCurrentClientCCB,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING) || defined(PVRSRV_ENABLE_FULL_CCB_DUMP)
-void DumpCCB(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext, RGX_CLIENT_CCB *psCurrentClientCCB, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+void DumpCCB(PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext, RGX_CLIENT_CCB *psCurrentClientCCB, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile);
#endif
PVRSRV_ERROR CheckForStalledCCB(RGX_CLIENT_CCB *psCurrentClientCCB);
diff --git a/drivers/staging/imgtec/rogue/rgxcompute.c b/drivers/staging/imgtec/rogue/rgxcompute.c
index d4ca47e06b5b..c45faf383f4c 100644
--- a/drivers/staging/imgtec/rogue/rgxcompute.c
+++ b/drivers/staging/imgtec/rogue/rgxcompute.c
@@ -516,7 +516,8 @@ PVRSRV_ERROR PVRSRVRGXGetLastComputeContextResetReasonKM(RGX_SERVER_COMPUTE_CONT
}
void CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
DLLIST_NODE *psNode, *psNext;
OSWRLockAcquireRead(psDevInfo->hComputeCtxListLock);
@@ -525,7 +526,7 @@ void CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
RGX_SERVER_COMPUTE_CONTEXT *psCurrentServerComputeCtx =
IMG_CONTAINER_OF(psNode, RGX_SERVER_COMPUTE_CONTEXT, sListNode);
DumpStalledFWCommonContext(psCurrentServerComputeCtx->psServerCommonContext,
- pfnDumpDebugPrintf);
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
OSWRLockReleaseRead(psDevInfo->hComputeCtxListLock);
}
diff --git a/drivers/staging/imgtec/rogue/rgxcompute.h b/drivers/staging/imgtec/rogue/rgxcompute.h
index d5deeac27061..28a9ae59b068 100644
--- a/drivers/staging/imgtec/rogue/rgxcompute.h
+++ b/drivers/staging/imgtec/rogue/rgxcompute.h
@@ -153,7 +153,8 @@ PVRSRV_ERROR PVRSRVRGXGetLastComputeContextResetReasonKM(RGX_SERVER_COMPUTE_CONT
/* Debug - check if compute context is waiting on a fence */
void CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/* Debug/Watchdog - check if client compute contexts are stalled */
IMG_BOOL CheckForStalledClientComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
diff --git a/drivers/staging/imgtec/rogue/rgxdebug.c b/drivers/staging/imgtec/rogue/rgxdebug.c
index 2f56cbd5ccbb..c34e03194f22 100644
--- a/drivers/staging/imgtec/rogue/rgxdebug.c
+++ b/drivers/staging/imgtec/rogue/rgxdebug.c
@@ -1419,23 +1419,26 @@ typedef enum _DEVICEMEM_HISTORY_QUERY_INDEX_
Print details of a single result from a DevicememHistory query
@Input pfnDumpDebugPrintf - Debug printf function
- @Input psResult - The DevicememHistory result to be printed
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
@Input psFaultProcessInfo - The process info derived from the page fault
+ @Input psResult - The DevicememHistory result to be printed
@Input ui32Index - The index of the result
@Return void
******************************************************************************/
static void _PrintDevicememHistoryQueryResult(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- RGXMEM_PROCESS_INFO *psFaultProcessInfo,
- DEVICEMEM_HISTORY_QUERY_OUT_RESULT *psResult,
- IMG_UINT32 ui32Index)
+ void *pvDumpDebugFile,
+ RGXMEM_PROCESS_INFO *psFaultProcessInfo,
+ DEVICEMEM_HISTORY_QUERY_OUT_RESULT *psResult,
+ IMG_UINT32 ui32Index)
{
IMG_UINT32 ui32Remainder;
if(psFaultProcessInfo->uiPID != RGXMEM_SERVER_PID_FIRMWARE)
{
- PVR_DUMPDEBUG_LOG((" [%u] Name: %s Base address: " IMG_DEV_VIRTADDR_FMTSPEC
+ PVR_DUMPDEBUG_LOG(" [%u] Name: %s Base address: " IMG_DEV_VIRTADDR_FMTSPEC
" Size: " IMG_DEVMEM_SIZE_FMTSPEC
" Allocated: %c Modified %llu us ago (abs time %llu us)",
ui32Index,
@@ -1444,11 +1447,11 @@ static void _PrintDevicememHistoryQueryResult(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebu
(unsigned long long) psResult->uiSize,
psResult->bAllocated ? 'Y' : 'N',
(unsigned long long) OSDivide64r64(psResult->ui64Age, 1000, &ui32Remainder),
- (unsigned long long) OSDivide64r64(psResult->ui64When, 1000, &ui32Remainder)));
+ (unsigned long long) OSDivide64r64(psResult->ui64When, 1000, &ui32Remainder));
}
else
{
- PVR_DUMPDEBUG_LOG((" [%u] Name: %s Base address: " IMG_DEV_VIRTADDR_FMTSPEC
+ PVR_DUMPDEBUG_LOG(" [%u] Name: %s Base address: " IMG_DEV_VIRTADDR_FMTSPEC
" Size: " IMG_DEVMEM_SIZE_FMTSPEC
" Allocated: %c Modified %llu us ago (abs time %llu us) PID: %u (%s)",
ui32Index,
@@ -1459,7 +1462,7 @@ static void _PrintDevicememHistoryQueryResult(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebu
(unsigned long long) OSDivide64r64(psResult->ui64Age, 1000, &ui32Remainder),
(unsigned long long) OSDivide64r64(psResult->ui64When, 1000, &ui32Remainder),
(unsigned int) psResult->sProcessInfo.uiPID,
- psResult->sProcessInfo.szProcessName));
+ psResult->sProcessInfo.szProcessName);
}
}
@@ -1473,26 +1476,30 @@ static void _PrintDevicememHistoryQueryResult(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebu
Print details of all the results from a DevicememHistory query
@Input pfnDumpDebugPrintf - Debug printf function
- @Input psResult - The DevicememHistory result to be printed
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psFaultProcessInfo - The process info derived from the page fault
+ @Input psQueryOut - Storage for the query results
@Return void
******************************************************************************/
static void _PrintDevicememHistoryQueryOut(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- RGXMEM_PROCESS_INFO *psFaultProcessInfo,
- DEVICEMEM_HISTORY_QUERY_OUT *psQueryOut)
+ void *pvDumpDebugFile,
+ RGXMEM_PROCESS_INFO *psFaultProcessInfo,
+ DEVICEMEM_HISTORY_QUERY_OUT *psQueryOut)
{
IMG_UINT32 i;
if(psQueryOut->ui32NumResults == 0)
{
- PVR_DUMPDEBUG_LOG((" No results"));
+ PVR_DUMPDEBUG_LOG(" No results");
}
else
{
for(i = 0; i < psQueryOut->ui32NumResults; i++)
{
- _PrintDevicememHistoryQueryResult(pfnDumpDebugPrintf,
+ _PrintDevicememHistoryQueryResult(pfnDumpDebugPrintf, pvDumpDebugFile,
psFaultProcessInfo,
&psQueryOut->sResults[i],
i);
@@ -1653,6 +1660,8 @@ static FAULT_INFO_LOG gsFaultInfoLog = { 0 };
object (FAULT_INFO *), otherwise returns NULL.
@Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
@Input sFaultDevVAddr - The faulting device virtual address
@Input ui64CRTimer - The CR timer value recorded by the FW at the time of the fault
@@ -1660,8 +1669,9 @@ static FAULT_INFO_LOG gsFaultInfoLog = { 0 };
******************************************************************************/
static FAULT_INFO *_QueryFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- IMG_DEV_VIRTADDR sFaultDevVAddr,
- IMG_UINT64 ui64CRTimer)
+ void *pvDumpDebugFile,
+ IMG_DEV_VIRTADDR sFaultDevVAddr,
+ IMG_UINT64 ui64CRTimer)
{
IMG_UINT32 i;
@@ -1775,6 +1785,8 @@ static void _CommitFaultInfo(PVRSRV_RGXDEV_INFO *psDevInfo,
Print all the details of a page fault from a FAULT_INFO structure
@Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
@Input psInfo - The page fault occurrence to print
@Input pui32Index - (optional) index value to include in the print output
@@ -1782,8 +1794,9 @@ static void _CommitFaultInfo(PVRSRV_RGXDEV_INFO *psDevInfo,
******************************************************************************/
static void _PrintFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- FAULT_INFO *psInfo,
- const IMG_UINT32 *pui32Index)
+ void *pvDumpDebugFile,
+ FAULT_INFO *psInfo,
+ const IMG_UINT32 *pui32Index)
{
IMG_UINT32 i;
@@ -1793,7 +1806,7 @@ static void _PrintFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if(pui32Index)
{
- PVR_DUMPDEBUG_LOG(("(%u) Device memory history for page fault address 0x%010llX, CRTimer: 0x%016llX, "
+ PVR_DUMPDEBUG_LOG("(%u) Device memory history for page fault address 0x%010llX, CRTimer: 0x%016llX, "
"PID: %u (%s, unregistered: %u) Abs Time: %llu us",
*pui32Index,
(unsigned long long) psInfo->sFaultDevVAddr.uiAddr,
@@ -1801,16 +1814,16 @@ static void _PrintFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
(unsigned int) uiPID,
psInfo->sProcessInfo.szProcessName,
psInfo->sProcessInfo.bUnregistered,
- (unsigned long long) psInfo->ui64When));
+ (unsigned long long) psInfo->ui64When);
}
else
{
- PVR_DUMPDEBUG_LOG(("Device memory history for page fault address 0x%010llX, PID: %u (%s, unregistered: %u) Abs Time: %llu us",
+ PVR_DUMPDEBUG_LOG("Device memory history for page fault address 0x%010llX, PID: %u (%s, unregistered: %u) Abs Time: %llu us",
(unsigned long long) psInfo->sFaultDevVAddr.uiAddr,
(unsigned int) uiPID,
psInfo->sProcessInfo.szProcessName,
psInfo->sProcessInfo.bUnregistered,
- (unsigned long long) psInfo->ui64When));
+ (unsigned long long) psInfo->ui64When);
}
for(i = DEVICEMEM_HISTORY_QUERY_INDEX_PRECEDING; i < DEVICEMEM_HISTORY_QUERY_INDEX_COUNT; i++)
@@ -1830,8 +1843,8 @@ static void _PrintFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
break;
}
- PVR_DUMPDEBUG_LOG(("%s:", pszWhich));
- _PrintDevicememHistoryQueryOut(pfnDumpDebugPrintf,
+ PVR_DUMPDEBUG_LOG("%s:", pszWhich);
+ _PrintDevicememHistoryQueryOut(pfnDumpDebugPrintf, pvDumpDebugFile,
&psInfo->sProcessInfo,
&psInfo->asQueryOut[i]);
}
@@ -1851,32 +1864,36 @@ static void _PrintFaultInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
Dump BIF Bank state in human readable form.
- @Input psDevInfo - RGX device info
- @Input eBankID - BIF identifier
- @Input ui64MMUStatus - MMU Status register value
- @Input ui64ReqStatus - BIF request Status register value
- @Input ui64PCAddress - Page catalogue base address of faulting access
- @Input ui64CRTimer - RGX CR timer value at time of page fault
- @Input bSummary - Flag to check whether the function is called
- as a part of the debug dump summary or
- as a part of a HWR log
+ @Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
+ @Input eBankID - BIF identifier
+ @Input ui64MMUStatus - MMU Status register value
+ @Input ui64ReqStatus - BIF request Status register value
+ @Input ui64PCAddress - Page catalogue base address of faulting access
+ @Input ui64CRTimer - RGX CR timer value at time of page fault
+ @Input bSummary - Flag to check whether the function is called
+ as a part of the debug dump summary or
+ as a part of a HWR log
@Return void
******************************************************************************/
static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo,
- RGXDBG_BIF_ID eBankID,
- IMG_UINT64 ui64MMUStatus,
- IMG_UINT64 ui64ReqStatus,
- IMG_UINT64 ui64PCAddress,
- IMG_UINT64 ui64CRTimer,
- IMG_BOOL bSummary)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo,
+ RGXDBG_BIF_ID eBankID,
+ IMG_UINT64 ui64MMUStatus,
+ IMG_UINT64 ui64ReqStatus,
+ IMG_UINT64 ui64PCAddress,
+ IMG_UINT64 ui64CRTimer,
+ IMG_BOOL bSummary)
{
IMG_CHAR *pszIndent = (bSummary ? "" : " ");
if (ui64MMUStatus == 0x0)
{
- PVR_DUMPDEBUG_LOG(("%s - OK", pszBIFNames[eBankID]));
+ PVR_DUMPDEBUG_LOG("%s - OK", pszBIFNames[eBankID]);
}
else
{
@@ -1889,9 +1906,9 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
FAULT_INFO *psInfo;
#endif
/* Bank 0 & 1 share the same fields */
- PVR_DUMPDEBUG_LOG(("%s%s - FAULT:",
+ PVR_DUMPDEBUG_LOG("%s%s - FAULT:",
pszIndent,
- pszBIFNames[eBankID]));
+ pszBIFNames[eBankID]);
/* MMU Status */
{
@@ -1914,7 +1931,7 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
ui32PageSizeBytes = _PageSizeHWToBytes(ui32PageSize);
#endif
- PVR_DUMPDEBUG_LOG(("%s * MMU status (0x%016llX): PC = %d%s, Page Size = %d, MMU data type = %d%s%s.",
+ PVR_DUMPDEBUG_LOG("%s * MMU status (0x%016llX): PC = %d%s, Page Size = %d, MMU data type = %d%s%s.",
pszIndent,
ui64MMUStatus,
ui32PC,
@@ -1922,7 +1939,7 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
ui32PageSize,
ui32MMUDataType,
(bROFault)?", Read Only fault":"",
- (bProtFault)?", PM/META protection fault":""));
+ (bProtFault)?", PM/META protection fault":"");
}
/* Req Status */
@@ -1951,13 +1968,13 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
#endif
_RGXDecodeBIFReqTags(eBankID, ui32TagID, ui32TagSB, &pszTagID, &pszTagSB, &aszScratch[0], RGX_DEBUG_STR_SIZE);
- PVR_DUMPDEBUG_LOG(("%s * Request (0x%016llX): %s (%s), %s 0x%010llX.",
+ PVR_DUMPDEBUG_LOG("%s * Request (0x%016llX): %s (%s), %s 0x%010llX.",
pszIndent,
ui64ReqStatus,
pszTagID,
pszTagSB,
(bRead)?"Reading from":"Writing to",
- ui64Addr));
+ ui64Addr);
}
/* Check if the host thinks this fault is valid */
@@ -1974,7 +1991,7 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (ui32PC < 8)
{
sPCDevPAddr.uiAddr = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_CAT_BASEN(ui32PC));
- PVR_DUMPDEBUG_LOG(("%sAcquired live PC address: 0x%016llX", pszIndent, sPCDevPAddr.uiAddr));
+ PVR_DUMPDEBUG_LOG("%sAcquired live PC address: 0x%016llX", pszIndent, sPCDevPAddr.uiAddr);
}
else
{
@@ -1983,14 +2000,15 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
}
else
{
- PVR_DUMPDEBUG_LOG(("%sFW logged fault using PC Address: 0x%016llX", pszIndent, ui64PCAddress));
+ PVR_DUMPDEBUG_LOG("%sFW logged fault using PC Address: 0x%016llX", pszIndent, ui64PCAddress);
sPCDevPAddr.uiAddr = ui64PCAddress;
}
if (bSummary)
{
- PVR_DUMPDEBUG_LOG(("%sChecking faulting address 0x%010llX", pszIndent, sFaultDevVAddr.uiAddr));
- RGXCheckFaultAddress(psDevInfo, &sFaultDevVAddr, &sPCDevPAddr);
+ PVR_DUMPDEBUG_LOG("%sChecking faulting address 0x%010llX", pszIndent, sFaultDevVAddr.uiAddr);
+ RGXCheckFaultAddress(psDevInfo, &sFaultDevVAddr, &sPCDevPAddr,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
#if defined(SUPPORT_PAGE_FAULT_DEBUG)
@@ -1999,7 +2017,7 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
* if so then use the previously acquired information.
*/
OSLockAcquire(psDevInfo->hDebugFaultInfoLock);
- psInfo = _QueryFaultInfo(pfnDumpDebugPrintf, sFaultDevVAddr, ui64CRTimer);
+ psInfo = _QueryFaultInfo(pfnDumpDebugPrintf, pvDumpDebugFile, sFaultDevVAddr, ui64CRTimer);
if(psInfo == NULL)
{
@@ -2031,24 +2049,24 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
else
{
/* no hits, so no data to present */
- PVR_DUMPDEBUG_LOG(("%sNo matching Devmem History for fault address", pszIndent));
+ PVR_DUMPDEBUG_LOG("%sNo matching Devmem History for fault address", pszIndent);
psInfo = NULL;
}
}
else
{
- PVR_DUMPDEBUG_LOG(("%sCould not find PID for PC 0x%016llX", pszIndent, sPCDevPAddr.uiAddr));
+ PVR_DUMPDEBUG_LOG("%sCould not find PID for PC 0x%016llX", pszIndent, sPCDevPAddr.uiAddr);
}
}
else
{
- PVR_DUMPDEBUG_LOG(("%sPage fault not applicable to Devmem History", pszIndent));
+ PVR_DUMPDEBUG_LOG("%sPage fault not applicable to Devmem History", pszIndent);
}
}
if(psInfo != NULL)
{
- _PrintFaultInfo(pfnDumpDebugPrintf, psInfo, NULL);
+ _PrintFaultInfo(pfnDumpDebugPrintf, pvDumpDebugFile, psInfo, NULL);
}
OSLockRelease(psDevInfo->hDebugFaultInfoLock);
@@ -2070,29 +2088,35 @@ static void _RGXDumpRGXBIFBank(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
Dump MMU Fault status in human readable form.
- @Input psDevInfo - RGX device info
- @Input ui64MMUStatus - MMU Status register value
- @Input bIsMetaMMUStatus - Is the status from MMU_FAULT_STATUS or MMU_FAULT_STATUS_META.
- @Input bSummary - Flag to check whether the function is called
- as a part of the debug dump summary or
- as a part of a HWR log
+ @Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
+ @Input ui64MMUStatus - MMU Status register value
+ @Input ui64PCAddress - Page catalogue base address of faulting access
+ @Input ui64CRTimer - RGX CR timer value at time of page fault
+ @Input bIsMetaMMUStatus - Is the status from MMU_FAULT_STATUS or MMU_FAULT_STATUS_META.
+ @Input bSummary - Flag to check whether the function is called
+ as a part of the debug dump summary or
+ as a part of a HWR log
@Return void
******************************************************************************/
static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo,
- IMG_UINT64 ui64MMUStatus,
- IMG_UINT64 ui64PCAddress,
- IMG_UINT64 ui64CRTimer,
- IMG_BOOL bIsMetaMMUStatus,
- IMG_BOOL bSummary)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo,
+ IMG_UINT64 ui64MMUStatus,
+ IMG_UINT64 ui64PCAddress,
+ IMG_UINT64 ui64CRTimer,
+ IMG_BOOL bIsMetaMMUStatus,
+ IMG_BOOL bSummary)
{
IMG_CHAR *pszMetaOrCore = (bIsMetaMMUStatus ? "Meta" : "Core");
IMG_CHAR *pszIndent = (bSummary ? "" : " ");
if (ui64MMUStatus == 0x0)
{
- PVR_DUMPDEBUG_LOG(("%sMMU (%s) - OK", pszIndent, pszMetaOrCore));
+ PVR_DUMPDEBUG_LOG("%sMMU (%s) - OK", pszIndent, pszMetaOrCore);
}
else
{
@@ -2126,8 +2150,8 @@ static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
_RGXDecodeMMUReqTags(ui32Requester, ui32SideBand, bRead, &pszTagID, &pszTagSB, aszScratch, RGX_DEBUG_STR_SIZE);
- PVR_DUMPDEBUG_LOG(("%sMMU (%s) - FAULT:", pszIndent, pszMetaOrCore));
- PVR_DUMPDEBUG_LOG(("%s * MMU status (0x%016llX): PC = %d, %s 0x%010llX, %s (%s)%s%s%s%s.",
+ PVR_DUMPDEBUG_LOG("%sMMU (%s) - FAULT:", pszIndent, pszMetaOrCore);
+ PVR_DUMPDEBUG_LOG("%s * MMU status (0x%016llX): PC = %d, %s 0x%010llX, %s (%s)%s%s%s%s.",
pszIndent,
ui64MMUStatus,
ui32PC,
@@ -2138,7 +2162,7 @@ static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
(bFault)?", Fault":"",
(bROFault)?", Read Only fault":"",
(bProtFault)?", PM/META protection fault":"",
- _RGXDecodeMMULevel(ui32MMULevel)));
+ _RGXDecodeMMULevel(ui32MMULevel));
/* Check if the host thinks this fault is valid */
sFaultDevVAddr.uiAddr = ui64Addr;
@@ -2150,16 +2174,17 @@ static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
}
else
{
- PVR_DUMPDEBUG_LOG(("%sFW logged fault using PC Address: 0x%016llX",
- pszIndent, ui64PCAddress));
+ PVR_DUMPDEBUG_LOG("%sFW logged fault using PC Address: 0x%016llX",
+ pszIndent, ui64PCAddress);
sPCDevPAddr.uiAddr = ui64PCAddress;
}
if (bSummary)
{
- PVR_DUMPDEBUG_LOG(("%sChecking faulting address 0x%010llX",
- pszIndent, sFaultDevVAddr.uiAddr));
- RGXCheckFaultAddress(psDevInfo, &sFaultDevVAddr, &sPCDevPAddr);
+ PVR_DUMPDEBUG_LOG("%sChecking faulting address 0x%010llX",
+ pszIndent, sFaultDevVAddr.uiAddr);
+ RGXCheckFaultAddress(psDevInfo, &sFaultDevVAddr, &sPCDevPAddr,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
#if defined(SUPPORT_PAGE_FAULT_DEBUG)
@@ -2167,7 +2192,7 @@ static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
* if so then use the previously acquired information.
*/
OSLockAcquire(psDevInfo->hDebugFaultInfoLock);
- psInfo = _QueryFaultInfo(pfnDumpDebugPrintf, sFaultDevVAddr, ui64CRTimer);
+ psInfo = _QueryFaultInfo(pfnDumpDebugPrintf, pvDumpDebugFile, sFaultDevVAddr, ui64CRTimer);
if(psInfo == NULL)
{
@@ -2204,20 +2229,20 @@ static void _RGXDumpRGXMMUFaultStatus(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
}
else
{
- PVR_DUMPDEBUG_LOG(("%sCould not find PID for PC 0x%016llX",
- pszIndent, sPCDevPAddr.uiAddr));
+ PVR_DUMPDEBUG_LOG("%sCould not find PID for PC 0x%016llX",
+ pszIndent, sPCDevPAddr.uiAddr);
}
}
else
{
- PVR_DUMPDEBUG_LOG(("%sPage fault not applicable to Devmem History",
- pszIndent));
+ PVR_DUMPDEBUG_LOG("%sPage fault not applicable to Devmem History",
+ pszIndent);
}
}
if(psInfo != NULL)
{
- _PrintFaultInfo(pfnDumpDebugPrintf, psInfo, NULL);
+ _PrintFaultInfo(pfnDumpDebugPrintf, pvDumpDebugFile, psInfo, NULL);
}
OSLockRelease(psDevInfo->hDebugFaultInfoLock);
@@ -2387,13 +2412,17 @@ map_error_fail:
Dump FW assert strings when a thread asserts.
- @Input psRGXFWIfTraceBufCtl - RGX FW trace buffer
+ @Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psRGXFWIfTraceBufCtl - RGX FW trace buffer
@Return void
******************************************************************************/
static void _RGXDumpFWAssert(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl)
+ void *pvDumpDebugFile,
+ RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl)
{
IMG_CHAR *pszTraceAssertPath;
IMG_CHAR *pszTraceAssertInfo;
@@ -2409,32 +2438,34 @@ static void _RGXDumpFWAssert(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
/* print non null assert strings */
if (*pszTraceAssertInfo)
{
- PVR_DUMPDEBUG_LOG(("FW-T%d Assert: %s (%s:%d)",
- i, pszTraceAssertInfo, pszTraceAssertPath, ui32TraceAssertLine));
+ PVR_DUMPDEBUG_LOG("FW-T%d Assert: %s (%s:%d)",
+ i, pszTraceAssertInfo, pszTraceAssertPath, ui32TraceAssertLine);
}
}
}
static void _RGXDumpFWPoll(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl)
+ void *pvDumpDebugFile,
+ RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl)
{
IMG_UINT32 i;
for (i = 0; i < RGXFW_THREAD_NUM; i++)
{
if (psRGXFWIfTraceBufCtl->aui32CrPollAddr[i])
{
- PVR_DUMPDEBUG_LOG(("T%u polling %s (reg:0x%08X mask:0x%08X)",
+ PVR_DUMPDEBUG_LOG("T%u polling %s (reg:0x%08X mask:0x%08X)",
i,
- ((psRGXFWIfTraceBufCtl->aui32CrPollAddr[i] & RGXFW_POLL_TYPE_SET)?("set"):("unset")),
- psRGXFWIfTraceBufCtl->aui32CrPollAddr[i] & ~RGXFW_POLL_TYPE_SET,
- psRGXFWIfTraceBufCtl->aui32CrPollMask[i]));
+ ((psRGXFWIfTraceBufCtl->aui32CrPollAddr[i] & RGXFW_POLL_TYPE_SET)?("set"):("unset")),
+ psRGXFWIfTraceBufCtl->aui32CrPollAddr[i] & ~RGXFW_POLL_TYPE_SET,
+ psRGXFWIfTraceBufCtl->aui32CrPollMask[i]);
}
}
}
static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl, PVRSRV_RGXDEV_INFO *psDevInfo)
+ void *pvDumpDebugFile,
+ RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl, PVRSRV_RGXDEV_INFO *psDevInfo)
{
IMG_BOOL bAnyLocked = IMG_FALSE;
IMG_UINT32 dm, i;
@@ -2512,7 +2543,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
psRGXFWIfTraceBufCtl->aui16HwrDmFalseDetectCount[dm]);
}
- PVR_DUMPDEBUG_LOG((pszLine));
+ PVR_DUMPDEBUG_LOG(pszLine);
OSFreeMem(pszLine);
@@ -2521,11 +2552,11 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
{
if (dm == RGXFWIF_DM_GP)
{
- PVR_DUMPDEBUG_LOG(("DM %d (GP)", dm));
+ PVR_DUMPDEBUG_LOG("DM %d (GP)", dm);
}
else
{
- PVR_DUMPDEBUG_LOG(("DM %d (HWRflags 0x%08x)", dm, psRGXFWIfTraceBufCtl->aui32HWRRecoveryFlags[dm]));
+ PVR_DUMPDEBUG_LOG("DM %d (HWRflags 0x%08x)", dm, psRGXFWIfTraceBufCtl->aui32HWRRecoveryFlags[dm]);
}
ui32ReadIndex = 0;
@@ -2548,7 +2579,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
else if (ui32HWRRecoveryFlags & RGXFWIF_DM_STATE_GUILTY_OVERRUNING) { pszLockupType = ", Guilty Overrun"; }
else if (ui32HWRRecoveryFlags & RGXFWIF_DM_STATE_GUILTY_LOCKUP) { pszLockupType = ", Innocent Overrun"; }
- PVR_DUMPDEBUG_LOG((" Recovery %d: PID = %d, frame = %d, HWRTData = 0x%08X,"
+ PVR_DUMPDEBUG_LOG(" Recovery %d: PID = %d, frame = %d, HWRTData = 0x%08X,"
" EventStatus = 0x%08X, CRTimer = 0x%012llX, OSTimer = %llu.%09llu%s",
psHWRInfo->ui32HWRNumber,
psHWRInfo->ui32PID,
@@ -2558,7 +2589,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
psHWRInfo->ui64CRTimer,
ui64Seconds,
ui64Nanoseconds,
- pszLockupType));
+ pszLockupType);
switch(psHWRInfo->eHWRType)
{
@@ -2566,7 +2597,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
case RGX_HWRTYPE_BIF0FAULT:
case RGX_HWRTYPE_BIF1FAULT:
{
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXFWIF_HWRTYPE_BIF_BANK_GET(psHWRInfo->eHWRType),
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXFWIF_HWRTYPE_BIF_BANK_GET(psHWRInfo->eHWRType),
psHWRInfo->uHWRData.sBIFInfo.ui64BIFMMUStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64BIFReqStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64PCAddress,
@@ -2577,7 +2608,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
#if defined(RGX_FEATURE_CLUSTER_GROUPING)
case RGX_HWRTYPE_TEXASBIF0FAULT:
{
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_TEXAS_BIF,
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_TEXAS_BIF,
psHWRInfo->uHWRData.sBIFInfo.ui64BIFMMUStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64BIFReqStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64PCAddress,
@@ -2589,7 +2620,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
#if defined(RGX_FEATURE_RAY_TRACING)
case RGX_HWRTYPE_DPXMMUFAULT:
{
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_DPX_BIF,
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_DPX_BIF,
psHWRInfo->uHWRData.sBIFInfo.ui64BIFMMUStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64BIFReqStatus,
psHWRInfo->uHWRData.sBIFInfo.ui64PCAddress,
@@ -2601,7 +2632,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
#else
case RGX_HWRTYPE_MMUFAULT:
{
- _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, psDevInfo,
+ _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo,
psHWRInfo->uHWRData.sMMUInfo.ui64MMUStatus,
psHWRInfo->uHWRData.sMMUInfo.ui64PCAddress,
psHWRInfo->ui64CRTimer,
@@ -2612,7 +2643,7 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
case RGX_HWRTYPE_MMUMETAFAULT:
{
- _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, psDevInfo,
+ _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo,
psHWRInfo->uHWRData.sMMUInfo.ui64MMUStatus,
psHWRInfo->uHWRData.sMMUInfo.ui64PCAddress,
psHWRInfo->ui64CRTimer,
@@ -2624,11 +2655,11 @@ static void _RGXDumpFWHWRInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
case RGX_HWRTYPE_POLLFAILURE:
{
- PVR_DUMPDEBUG_LOG((" T%u polling %s (reg:0x%08X mask:0x%08X)",
+ PVR_DUMPDEBUG_LOG(" T%u polling %s (reg:0x%08X mask:0x%08X)",
psHWRInfo->uHWRData.sPollInfo.ui32ThreadNum,
((psHWRInfo->uHWRData.sPollInfo.ui32CrPollAddr & RGXFW_POLL_TYPE_SET)?("set"):("unset")),
psHWRInfo->uHWRData.sPollInfo.ui32CrPollAddr & ~RGXFW_POLL_TYPE_SET,
- psHWRInfo->uHWRData.sPollInfo.ui32CrPollMask));
+ psHWRInfo->uHWRData.sPollInfo.ui32CrPollMask);
}
break;
@@ -2732,13 +2763,19 @@ static void _GetPendingPageInfo(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_VIRTADDR
Dump a summary in human readable form with the RGX state
- @Input psDevInfo - RGX device info
+ @Input pfnDumpDebugPrintf - The debug printf function
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
+ @Input bRGXPoweredON - IMG_TRUE if RGX device is on
@Return void
******************************************************************************/
static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo, IMG_BOOL bRGXPoweredON)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo,
+ IMG_BOOL bRGXPoweredON)
{
IMG_CHAR *pszState, *pszReason;
RGXFWIF_TRACEBUF *psRGXFWIfTraceBuf = psDevInfo->psRGXFWIfTraceBuf;
@@ -2752,23 +2789,23 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
IMG_UINT64 ui64RegValMMUStatus;
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_MMU_FAULT_STATUS);
- _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, psDevInfo, ui64RegValMMUStatus, 0, 0, IMG_FALSE, IMG_TRUE);
+ _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, ui64RegValMMUStatus, 0, 0, IMG_FALSE, IMG_TRUE);
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_MMU_FAULT_STATUS_META);
- _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, psDevInfo, ui64RegValMMUStatus, 0, 0, IMG_TRUE, IMG_TRUE);
+ _RGXDumpRGXMMUFaultStatus(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, ui64RegValMMUStatus, 0, 0, IMG_TRUE, IMG_TRUE);
#else
IMG_UINT64 ui64RegValMMUStatus, ui64RegValREQStatus;
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_FAULT_BANK0_MMU_STATUS);
ui64RegValREQStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_FAULT_BANK0_REQ_STATUS);
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_BIF0, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_BIF0, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
#if !defined(RGX_FEATURE_SINGLE_BIF)
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_FAULT_BANK1_MMU_STATUS);
ui64RegValREQStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_FAULT_BANK1_REQ_STATUS);
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_BIF1, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_BIF1, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
#endif
#if defined(RGX_FEATURE_CLUSTER_GROUPING)
@@ -2784,14 +2821,14 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS);
ui64RegValREQStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS);
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_TEXAS_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_TEXAS_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
}
}
#else
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS);
ui64RegValREQStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS);
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_TEXAS_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_TEXAS_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
#endif
#endif
#endif
@@ -2800,7 +2837,7 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
ui64RegValMMUStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, DPX_CR_BIF_FAULT_BANK_MMU_STATUS);
ui64RegValREQStatus = OSReadHWReg64(psDevInfo->pvRegsBaseKM, DPX_CR_BIF_FAULT_BANK_REQ_STATUS);
- _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, psDevInfo, RGXDBG_DPX_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
+ _RGXDumpRGXBIFBank(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, RGXDBG_DPX_BIF, ui64RegValMMUStatus, ui64RegValREQStatus, 0, 0, IMG_TRUE);
#endif
if(_CheckForPendingPage(psDevInfo))
@@ -2809,13 +2846,13 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
IMG_UINT32 ui32DataType;
IMG_DEV_VIRTADDR sDevVAddr;
- PVR_DUMPDEBUG_LOG(("MMU Pending page: Yes"));
+ PVR_DUMPDEBUG_LOG("MMU Pending page: Yes");
_GetPendingPageInfo(psDevInfo, &sDevVAddr, &ui32CatBase, &ui32DataType);
if(ui32CatBase >= 8)
{
- PVR_DUMPDEBUG_LOG(("Cannot check address on PM cat base %u", ui32CatBase));
+ PVR_DUMPDEBUG_LOG("Cannot check address on PM cat base %u", ui32CatBase);
}
else
{
@@ -2823,12 +2860,13 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
sPCDevPAddr.uiAddr = OSReadHWReg64(psDevInfo->pvRegsBaseKM, RGX_CR_BIF_CAT_BASEN(ui32CatBase));
- PVR_DUMPDEBUG_LOG(("Checking device virtual address " IMG_DEV_VIRTADDR_FMTSPEC
+ PVR_DUMPDEBUG_LOG("Checking device virtual address " IMG_DEV_VIRTADDR_FMTSPEC
" on cat base %u. PC Addr = 0x%llX",
(unsigned long long) sDevVAddr.uiAddr,
ui32CatBase,
- (unsigned long long) sPCDevPAddr.uiAddr));
- RGXCheckFaultAddress(psDevInfo, &sDevVAddr, &sPCDevPAddr);
+ (unsigned long long) sPCDevPAddr.uiAddr);
+ RGXCheckFaultAddress(psDevInfo, &sDevVAddr, &sPCDevPAddr,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
}
}
@@ -2856,32 +2894,33 @@ static void _RGXDumpRGXDebugSummary(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (psRGXFWIfTraceBuf == NULL)
{
- PVR_DUMPDEBUG_LOG(("RGX FW State: %s%s", pszState, pszReason));
+ PVR_DUMPDEBUG_LOG("RGX FW State: %s%s", pszState, pszReason);
/* can't dump any more information */
return;
}
- PVR_DUMPDEBUG_LOG(("RGX FW State: %s%s (HWRState 0x%08x)", pszState, pszReason, psRGXFWIfTraceBuf->ui32HWRStateFlags));
- PVR_DUMPDEBUG_LOG(("RGX FW Power State: %s (APM %s: %d ok, %d denied, %d other, %d total)",
+ PVR_DUMPDEBUG_LOG("RGX FW State: %s%s (HWRState 0x%08x)", pszState, pszReason, psRGXFWIfTraceBuf->ui32HWRStateFlags);
+ PVR_DUMPDEBUG_LOG("RGX FW Power State: %s (APM %s: %d ok, %d denied, %d other, %d total)",
pszPowStateName[psRGXFWIfTraceBuf->ePowState],
(psDevInfo->pvAPMISRData)?"enabled":"disabled",
psDevInfo->ui32ActivePMReqOk,
psDevInfo->ui32ActivePMReqDenied,
psDevInfo->ui32ActivePMReqTotal - psDevInfo->ui32ActivePMReqOk - psDevInfo->ui32ActivePMReqDenied,
- psDevInfo->ui32ActivePMReqTotal));
+ psDevInfo->ui32ActivePMReqTotal);
- _RGXDumpFWAssert(pfnDumpDebugPrintf, psRGXFWIfTraceBuf);
+ _RGXDumpFWAssert(pfnDumpDebugPrintf, pvDumpDebugFile, psRGXFWIfTraceBuf);
- _RGXDumpFWPoll(pfnDumpDebugPrintf, psRGXFWIfTraceBuf);
+ _RGXDumpFWPoll(pfnDumpDebugPrintf, pvDumpDebugFile, psRGXFWIfTraceBuf);
- _RGXDumpFWHWRInfo(pfnDumpDebugPrintf, psRGXFWIfTraceBuf, psDevInfo);
+ _RGXDumpFWHWRInfo(pfnDumpDebugPrintf, pvDumpDebugFile, psRGXFWIfTraceBuf, psDevInfo);
}
#if defined (RGX_FEATURE_META)
static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo)
{
/* List of extra META Slave Port debug registers */
#define RGX_META_SP_EXTRA_DEBUG \
@@ -2906,10 +2945,10 @@ static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrin
RGX_META_SP_EXTRA_DEBUG
#undef X
};
-
+
const IMG_UINT32 aui32Debug2RegAddr [] = {0xA28, 0x0A30, 0x0A38};
- PVR_DUMPDEBUG_LOG(("META Slave Port extra debug:"));
+ PVR_DUMPDEBUG_LOG("META Slave Port extra debug:");
/* dump first set of Slave Port debug registers */
for (ui32Idx = 0; ui32Idx < sizeof(aui32DebugRegAddr)/sizeof(IMG_UINT32); ui32Idx++)
@@ -2918,7 +2957,7 @@ static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrin
ui32RegAddr = aui32DebugRegAddr[ui32Idx];
ui32RegVal = OSReadHWReg32(psDevInfo->pvRegsBaseKM, ui32RegAddr);
- PVR_DUMPDEBUG_LOG((" * %s: 0x%8.8X", pszRegName, ui32RegVal));
+ PVR_DUMPDEBUG_LOG(" * %s: 0x%8.8X", pszRegName, ui32RegVal);
}
/* dump second set of Slave Port debug registers */
@@ -2926,7 +2965,7 @@ static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrin
{
OSWriteHWReg32(psDevInfo->pvRegsBaseKM, 0xA20, ui32Idx);
ui32RegVal = OSReadHWReg32(psDevInfo->pvRegsBaseKM, 0xA20);
- PVR_DUMPDEBUG_LOG((" * 0xA20[%d]: 0x%8.8X", ui32Idx, ui32RegVal));
+ PVR_DUMPDEBUG_LOG(" * 0xA20[%d]: 0x%8.8X", ui32Idx, ui32RegVal);
}
@@ -2937,7 +2976,7 @@ static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrin
{
OSWriteHWReg32(psDevInfo->pvRegsBaseKM, ui32RegAddr, ui32Idx);
ui32RegVal = OSReadHWReg32(psDevInfo->pvRegsBaseKM, ui32RegAddr);
- PVR_DUMPDEBUG_LOG((" * 0x%X[%d]: 0x%8.8X", ui32RegAddr, ui32Idx, ui32RegVal));
+ PVR_DUMPDEBUG_LOG(" * 0x%X[%d]: 0x%8.8X", ui32RegAddr, ui32Idx, ui32RegVal);
}
}
@@ -2949,17 +2988,20 @@ static void _RGXDumpMetaSPExtraDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrin
RGXDumpDebugInfo
*/
void RGXDumpDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo)
{
#if defined(PVRSRV_GPUVIRT_GUESTDRV)
PVR_UNREFERENCED_PARAMETER(psDevInfo);
PVR_UNREFERENCED_PARAMETER(pfnDumpDebugPrintf);
+ PVR_UNREFERENCED_PARAMETER(pvDumpDebugFile);
#else
IMG_UINT32 i;
for(i=0;i<=DEBUG_REQUEST_VERBOSITY_MAX;i++)
{
- RGXDebugRequestProcess(pfnDumpDebugPrintf, psDevInfo, i);
+ RGXDebugRequestProcess(pfnDumpDebugPrintf, pvDumpDebugFile,
+ psDevInfo, i);
}
#endif
}
@@ -2984,7 +3026,8 @@ TRACEBUF_LOG aLogDefinitions[] = {
};
#define NARGS_MASK ~(0xF<<16)
-static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
TRACEBUF_LOG *psLogDef = &aLogDefinitions[0];
IMG_BOOL bIntegrityOk = IMG_TRUE;
@@ -3005,7 +3048,7 @@ static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebug
*/
pszString = psLogDef->pszFmt;
ui32Count = 0;
-
+
while (*pszString != '\0')
{
if (*pszString++ == '%')
@@ -3014,8 +3057,8 @@ static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebug
if (*pszString == 's')
{
bIntegrityOk = IMG_FALSE;
- PVR_DUMPDEBUG_LOG(("Integrity Check FAIL: %s has an unsupported type not recognized (fmt: %%%c). Please fix.",
- psLogDef->pszName, *pszString));
+ PVR_DUMPDEBUG_LOG("Integrity Check FAIL: %s has an unsupported type not recognized (fmt: %%%c). Please fix.",
+ psLogDef->pszName, *pszString);
}
else if (*pszString == '%')
{
@@ -3024,20 +3067,20 @@ static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebug
}
}
}
-
+
if (ui32Count != psLogDef->ui32ArgNum)
{
bIntegrityOk = IMG_FALSE;
- PVR_DUMPDEBUG_LOG(("Integrity Check FAIL: %s has %d arguments but only %d are specified. Please fix.",
- psLogDef->pszName, ui32Count, psLogDef->ui32ArgNum));
+ PVR_DUMPDEBUG_LOG("Integrity Check FAIL: %s has %d arguments but only %d are specified. Please fix.",
+ psLogDef->pszName, ui32Count, psLogDef->ui32ArgNum);
}
/* RGXDumpFirmwareTrace() has a hardcoded limit of supporting up to 20 arguments... */
if (ui32Count > 20)
{
bIntegrityOk = IMG_FALSE;
- PVR_DUMPDEBUG_LOG(("Integrity Check FAIL: %s has %d arguments but a maximum of 20 are supported. Please fix.",
- psLogDef->pszName, ui32Count));
+ PVR_DUMPDEBUG_LOG("Integrity Check FAIL: %s has %d arguments but a maximum of 20 are supported. Please fix.",
+ psLogDef->pszName, ui32Count);
}
/* Check the id number is unique (don't take into account the number of arguments) */
@@ -3056,8 +3099,8 @@ static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebug
if (ui32Count != 1)
{
bIntegrityOk = IMG_FALSE;
- PVR_DUMPDEBUG_LOG(("Integrity Check FAIL: %s id %x is not unique, there are %d more. Please fix.",
- psLogDef->pszName, psLogDef->eSFId, ui32Count - 1));
+ PVR_DUMPDEBUG_LOG("Integrity Check FAIL: %s id %x is not unique, there are %d more. Please fix.",
+ psLogDef->pszName, psLogDef->eSFId, ui32Count - 1);
}
/* Move to the next log ID... */
@@ -3068,7 +3111,8 @@ static IMG_BOOL _FirmwareTraceIntegrityCheck(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebug
}
void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo)
{
RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl = psDevInfo->psRGXFWIfTraceBuf;
static IMG_BOOL bIntegrityCheckPassed = IMG_FALSE;
@@ -3076,7 +3120,7 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
/* Check that the firmware trace is correctly defined... */
if (!bIntegrityCheckPassed)
{
- bIntegrityCheckPassed = _FirmwareTraceIntegrityCheck(pfnDumpDebugPrintf);
+ bIntegrityCheckPassed = _FirmwareTraceIntegrityCheck(pfnDumpDebugPrintf, pvDumpDebugFile);
if (!bIntegrityCheckPassed)
{
return;
@@ -3088,22 +3132,22 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
{
IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESSAGE_LEN];
IMG_UINT32 tid;
-
+
/* Print the log type settings... */
if (psRGXFWIfTraceBufCtl->ui32LogType & RGXFWIF_LOG_TYPE_GROUP_MASK)
{
- PVR_DUMPDEBUG_LOG(("Debug log type: %s ( " RGXFWIF_LOG_ENABLED_GROUPS_LIST_PFSPEC ")",
+ PVR_DUMPDEBUG_LOG("Debug log type: %s ( " RGXFWIF_LOG_ENABLED_GROUPS_LIST_PFSPEC ")",
((psRGXFWIfTraceBufCtl->ui32LogType & RGXFWIF_LOG_TYPE_TRACE)?("trace"):("tbi")),
RGXFWIF_LOG_ENABLED_GROUPS_LIST(psRGXFWIfTraceBufCtl->ui32LogType)
- ));
+ );
}
else
{
- PVR_DUMPDEBUG_LOG(("Debug log type: none"));
+ PVR_DUMPDEBUG_LOG("Debug log type: none");
}
/* Print the decoded log for each thread... */
- for (tid = 0; tid < RGXFW_THREAD_NUM; tid++)
+ for (tid = 0; tid < RGXFW_THREAD_NUM; tid++)
{
IMG_UINT32 *pui32TraceBuf = psRGXFWIfTraceBufCtl->sTraceBuf[tid].pui32TraceBuffer;
IMG_UINT32 ui32TracePtr = psRGXFWIfTraceBufCtl->sTraceBuf[tid].ui32TracePointer;
@@ -3114,21 +3158,21 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
/* trace buffer not yet allocated */
continue;
}
-
+
while (ui32Count < RGXFW_TRACE_BUFFER_SIZE)
{
IMG_UINT32 ui32Data, ui32DataToId;
-
+
/* Find the first valid log ID, skipping whitespace... */
do
{
ui32Data = pui32TraceBuf[ui32TracePtr];
ui32DataToId = idToStringID(ui32Data);
- /* If an unrecognized id is found check if it is valid, if it is tracebuf needs updating. */
+ /* If an unrecognized id is found check if it is valid, if it is tracebuf needs updating. */
if (ui32DataToId == RGXFW_SF_LAST && RGXFW_LOG_VALIDID(ui32Data))
{
- PVR_DUMPDEBUG_LOG(("ERROR: Unrecognized id (%x). From here on the trace might be wrong!", ui32Data));
+ PVR_DUMPDEBUG_LOG("ERROR: Unrecognized id (%x). From here on the trace might be wrong!", ui32Data);
return;
}
@@ -3141,14 +3185,14 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (ui32Count < RGXFW_TRACE_BUFFER_SIZE)
{
IMG_UINT64 ui64Timestamp;
-
+
/* If we hit the ASSERT message then this is the end of the log... */
if (ui32Data == RGXFW_SF_MAIN_ASSERT_FAILED)
{
- PVR_DUMPDEBUG_LOG(("ASSERTION %s failed at %s:%u",
+ PVR_DUMPDEBUG_LOG("ASSERTION %s failed at %s:%u",
psRGXFWIfTraceBufCtl->sTraceBuf[tid].sAssertBuf.szInfo,
psRGXFWIfTraceBufCtl->sTraceBuf[tid].sAssertBuf.szPath,
- psRGXFWIfTraceBufCtl->sTraceBuf[tid].sAssertBuf.ui32LineNum));
+ psRGXFWIfTraceBufCtl->sTraceBuf[tid].sAssertBuf.ui32LineNum);
break;
}
@@ -3162,7 +3206,7 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
szBuffer[OSStringLength(szBuffer)-1] = '\0';
ui64Timestamp = (IMG_UINT64)(pui32TraceBuf[(ui32TracePtr + 0) % RGXFW_TRACE_BUFFER_SIZE]) << 32 |
(IMG_UINT64)(pui32TraceBuf[(ui32TracePtr + 1) % RGXFW_TRACE_BUFFER_SIZE]);
- PVR_DUMPDEBUG_LOG((szBuffer, ui64Timestamp, tid, groups[RGXFW_SF_GID(ui32Data)],
+ PVR_DUMPDEBUG_LOG(szBuffer, ui64Timestamp, tid, groups[RGXFW_SF_GID(ui32Data)],
pui32TraceBuf[(ui32TracePtr + 2) % RGXFW_TRACE_BUFFER_SIZE],
pui32TraceBuf[(ui32TracePtr + 3) % RGXFW_TRACE_BUFFER_SIZE],
pui32TraceBuf[(ui32TracePtr + 4) % RGXFW_TRACE_BUFFER_SIZE],
@@ -3182,7 +3226,7 @@ void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
pui32TraceBuf[(ui32TracePtr + 18) % RGXFW_TRACE_BUFFER_SIZE],
pui32TraceBuf[(ui32TracePtr + 19) % RGXFW_TRACE_BUFFER_SIZE],
pui32TraceBuf[(ui32TracePtr + 20) % RGXFW_TRACE_BUFFER_SIZE],
- pui32TraceBuf[(ui32TracePtr + 21) % RGXFW_TRACE_BUFFER_SIZE]));
+ pui32TraceBuf[(ui32TracePtr + 21) % RGXFW_TRACE_BUFFER_SIZE]);
/* Update the trace pointer... */
ui32TracePtr = (ui32TracePtr + 2 + RGXFW_SF_PARAMNUM(ui32Data)) % RGXFW_TRACE_BUFFER_SIZE;
@@ -3207,8 +3251,9 @@ static IMG_CHAR* _RGXGetDebugDevPowerStateString(PVRSRV_DEV_POWER_STATE ePowerSt
#endif
void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo,
- IMG_UINT32 ui32VerbLevel)
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo,
+ IMG_UINT32 ui32VerbLevel)
{
PVRSRV_DATA *psPVRSRVData = PVRSRVGetPVRSRVData();
@@ -3245,50 +3290,50 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
bRGXPoweredON = (ePowerState == PVRSRV_DEV_POWER_STATE_ON);
if(psPVRSRVData->sDriverInfo.bIsNoMatch)
{
- PVR_DUMPDEBUG_LOG(("------[ Driver Info ]------"));
+ PVR_DUMPDEBUG_LOG("------[ Driver Info ]------");
PVR_DUMP_DRIVER_INFO("UM", psPVRSRVData->sDriverInfo.sUMBuildInfo);
PVR_DUMP_DRIVER_INFO("KM", psPVRSRVData->sDriverInfo.sKMBuildInfo);
}
- PVR_DUMPDEBUG_LOG(("------[ RGX summary ]------"));
- PVR_DUMPDEBUG_LOG(("RGX BVNC: %s", RGX_BVNC_KM));
- PVR_DUMPDEBUG_LOG(("RGX Power State: %s", _RGXGetDebugDevPowerStateString(ePowerState)));
+ PVR_DUMPDEBUG_LOG("------[ RGX summary ]------");
+ PVR_DUMPDEBUG_LOG("RGX BVNC: %s", RGX_BVNC_KM);
+ PVR_DUMPDEBUG_LOG("RGX Power State: %s", _RGXGetDebugDevPowerStateString(ePowerState));
- _RGXDumpRGXDebugSummary(pfnDumpDebugPrintf, psDevInfo, bRGXPoweredON);
+ _RGXDumpRGXDebugSummary(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, bRGXPoweredON);
if (bRGXPoweredON)
{
- PVR_DUMPDEBUG_LOG(("------[ RGX registers ]------"));
- PVR_DUMPDEBUG_LOG(("RGX Register Base Address (Linear): 0x%p", psDevInfo->pvRegsBaseKM));
- PVR_DUMPDEBUG_LOG(("RGX Register Base Address (Physical): 0x%08lX", (unsigned long)psDevInfo->sRegsPhysBase.uiAddr));
+ PVR_DUMPDEBUG_LOG("------[ RGX registers ]------");
+ PVR_DUMPDEBUG_LOG("RGX Register Base Address (Linear): 0x%p", psDevInfo->pvRegsBaseKM);
+ PVR_DUMPDEBUG_LOG("RGX Register Base Address (Physical): 0x%08lX", (unsigned long)psDevInfo->sRegsPhysBase.uiAddr);
#if defined(RGX_FEATURE_META)
/* Forcing bit 6 of MslvCtrl1 to 0 to avoid internal reg read going though the core */
OSWriteHWReg32(psDevInfo->pvRegsBaseKM, RGX_CR_META_SP_MSLVCTRL1, 0x0);
#endif
- eError = RGXRunScript(psDevInfo, psDevInfo->psScripts->asDbgCommands, RGX_MAX_DEBUG_COMMANDS, PDUMP_FLAGS_CONTINUOUS, pfnDumpDebugPrintf);
+ eError = RGXRunScript(psDevInfo, psDevInfo->psScripts->asDbgCommands, RGX_MAX_DEBUG_COMMANDS, PDUMP_FLAGS_CONTINUOUS, pfnDumpDebugPrintf, pvDumpDebugFile);
#if defined(RGX_FEATURE_MIPS) && !defined(NO_HARDWARE)
{
RGX_MIPS_STATE sMIPSState;
PVRSRV_ERROR eError;
OSMemSet((void *)&sMIPSState, 0x00, sizeof(RGX_MIPS_STATE));
eError = _RGXMipsExtraDebug(psDevInfo, psDevInfo->psDeviceNode->psDevConfig, &sMIPSState);
- PVR_DUMPDEBUG_LOG(("---- [ MIPS internal state ] ----"));
+ PVR_DUMPDEBUG_LOG("---- [ MIPS internal state ] ----");
if (eError != PVRSRV_OK)
{
- PVR_DUMPDEBUG_LOG(("MIPS extra debug not available"));
+ PVR_DUMPDEBUG_LOG("MIPS extra debug not available");
}
else
{
- PVR_DUMPDEBUG_LOG(("PC :0x%08X", sMIPSState.ui32ErrorEPC));
- PVR_DUMPDEBUG_LOG(("STATUS_REGISTER :0x%08X", sMIPSState.ui32StatusRegister));
- PVR_DUMPDEBUG_LOG(("CAUSE_REGISTER :0x%08X", sMIPSState.ui32CauseRegister));
- PVR_DUMPDEBUG_LOG(("BAD_REGISTER :0x%08X", sMIPSState.ui32BadRegister));
- PVR_DUMPDEBUG_LOG(("EPC :0x%08X", sMIPSState.ui32EPC));
+ PVR_DUMPDEBUG_LOG("PC :0x%08X", sMIPSState.ui32ErrorEPC);
+ PVR_DUMPDEBUG_LOG("STATUS_REGISTER :0x%08X", sMIPSState.ui32StatusRegister);
+ PVR_DUMPDEBUG_LOG("CAUSE_REGISTER :0x%08X", sMIPSState.ui32CauseRegister);
+ PVR_DUMPDEBUG_LOG("BAD_REGISTER :0x%08X", sMIPSState.ui32BadRegister);
+ PVR_DUMPDEBUG_LOG("EPC :0x%08X", sMIPSState.ui32EPC);
}
- PVR_DUMPDEBUG_LOG(("--------------------------------"));
+ PVR_DUMPDEBUG_LOG("--------------------------------");
}
#endif
if (eError != PVRSRV_OK)
@@ -3296,13 +3341,13 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
PVR_DPF((PVR_DBG_ERROR,"RGXDebugRequestProcess: RGXRunScript failed (%d)", eError));
#if defined(RGX_FEATURE_META)
PVR_DPF((PVR_DBG_ERROR,"Dump Slave Port debug information"));
- _RGXDumpMetaSPExtraDebugInfo(pfnDumpDebugPrintf, psDevInfo);
+ _RGXDumpMetaSPExtraDebugInfo(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo);
#endif
}
}
else
{
- PVR_DUMPDEBUG_LOG((" (!) RGX power is down. No registers dumped"));
+ PVR_DUMPDEBUG_LOG(" (!) RGX power is down. No registers dumped");
}
/* Dump out the kernel CCB. */
@@ -3311,9 +3356,9 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (psKCCBCtl != NULL)
{
- PVR_DUMPDEBUG_LOG(("RGX Kernel CCB WO:0x%X RO:0x%X",
+ PVR_DUMPDEBUG_LOG("RGX Kernel CCB WO:0x%X RO:0x%X",
psKCCBCtl->ui32WriteOffset,
- psKCCBCtl->ui32ReadOffset));
+ psKCCBCtl->ui32ReadOffset);
}
}
@@ -3323,23 +3368,23 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (psFCCBCtl != NULL)
{
- PVR_DUMPDEBUG_LOG(("RGX Firmware CCB WO:0x%X RO:0x%X",
+ PVR_DUMPDEBUG_LOG("RGX Firmware CCB WO:0x%X RO:0x%X",
psFCCBCtl->ui32WriteOffset,
- psFCCBCtl->ui32ReadOffset));
+ psFCCBCtl->ui32ReadOffset);
}
}
/* Dump the KCCB commands executed */
{
- PVR_DUMPDEBUG_LOG(("RGX Kernel CCB commands executed = %d",
- psDevInfo->psRGXFWIfTraceBuf->ui32KCCBCmdsExecuted));
+ PVR_DUMPDEBUG_LOG("RGX Kernel CCB commands executed = %d",
+ psDevInfo->psRGXFWIfTraceBuf->ui32KCCBCmdsExecuted);
}
/* Dump the IRQ info */
{
- PVR_DUMPDEBUG_LOG(("RGX FW IRQ count = %d, last sampled in LISR = %d",
+ PVR_DUMPDEBUG_LOG("RGX FW IRQ count = %d, last sampled in LISR = %d",
psDevInfo->psRGXFWIfTraceBuf->ui32InterruptCount,
- g_ui32HostSampleIRQCount));
+ g_ui32HostSampleIRQCount);
}
/* Dump the FW config flags */
@@ -3356,7 +3401,7 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
goto Exit;
}
- PVR_DUMPDEBUG_LOG(("RGX FW config flags = 0x%X", psRGXFWInit->ui32ConfigFlags));
+ PVR_DUMPDEBUG_LOG("RGX FW config flags = 0x%X", psRGXFWInit->ui32ConfigFlags);
DevmemReleaseCpuVirtAddr(psDevInfo->psRGXFWIfInitMemDesc);
}
@@ -3371,8 +3416,8 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (psDevInfo->psRGXFWIfTraceBuf != NULL)
{
RGXFWIF_TRACEBUF *psRGXFWIfTraceBufCtl = psDevInfo->psRGXFWIfTraceBuf;
-
- for ( tid = 0 ; tid < RGXFW_THREAD_NUM ; tid++)
+
+ for ( tid = 0 ; tid < RGXFW_THREAD_NUM ; tid++)
{
IMG_UINT32 i;
IMG_BOOL bPrevLineWasZero = IMG_FALSE;
@@ -3383,22 +3428,22 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
if (psRGXFWIfTraceBufCtl->ui32LogType & RGXFWIF_LOG_TYPE_GROUP_MASK)
{
- PVR_DUMPDEBUG_LOG(("Debug log type: %s ( " RGXFWIF_LOG_ENABLED_GROUPS_LIST_PFSPEC ")",
+ PVR_DUMPDEBUG_LOG("Debug log type: %s ( " RGXFWIF_LOG_ENABLED_GROUPS_LIST_PFSPEC ")",
((psRGXFWIfTraceBufCtl->ui32LogType & RGXFWIF_LOG_TYPE_TRACE)?("trace"):("tbi")),
RGXFWIF_LOG_ENABLED_GROUPS_LIST(psRGXFWIfTraceBufCtl->ui32LogType)
- ));
+ );
}
else
{
- PVR_DUMPDEBUG_LOG(("Debug log type: none"));
+ PVR_DUMPDEBUG_LOG("Debug log type: none");
}
pui32TraceBuffer = psRGXFWIfTraceBufCtl->sTraceBuf[tid].pui32TraceBuffer;
-
+
/* Skip if trace buffer is not allocated */
if (pui32TraceBuffer == 0x0)
{
- PVR_DUMPDEBUG_LOG(("RGX FW thread %d: Trace buffer not yet allocated",tid));
+ PVR_DUMPDEBUG_LOG("RGX FW thread %d: Trace buffer not yet allocated",tid);
continue;
}
@@ -3409,10 +3454,10 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
PVR_DPF((PVR_DBG_ERROR,"RGXDebugRequestProcess: Out of mem allocating line string (size: %d)", 9*RGXFW_TRACE_BUFFER_LINESIZE));
goto Exit;
}
-
- PVR_DUMPDEBUG_LOG(("------[ RGX FW thread %d trace START ]------", tid));
- PVR_DUMPDEBUG_LOG(("FWT[traceptr]: %X", psRGXFWIfTraceBufCtl->sTraceBuf[tid].ui32TracePointer));
- PVR_DUMPDEBUG_LOG(("FWT[tracebufsize]: %X", RGXFW_TRACE_BUFFER_SIZE));
+
+ PVR_DUMPDEBUG_LOG("------[ RGX FW thread %d trace START ]------", tid);
+ PVR_DUMPDEBUG_LOG("FWT[traceptr]: %X", psRGXFWIfTraceBufCtl->sTraceBuf[tid].ui32TracePointer);
+ PVR_DUMPDEBUG_LOG("FWT[tracebufsize]: %X", RGXFW_TRACE_BUFFER_SIZE);
for (i = 0; i < RGXFW_TRACE_BUFFER_SIZE; i += RGXFW_TRACE_BUFFER_LINESIZE)
{
@@ -3442,27 +3487,27 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
{
bPrevLineWasZero = IMG_TRUE;
ui32CountLines = 1;
- PVR_DUMPDEBUG_LOG(("FWT[%08x]: 00000000 ... 00000000", ui32LineOffset));
+ PVR_DUMPDEBUG_LOG("FWT[%08x]: 00000000 ... 00000000", ui32LineOffset);
}
}
else
{
if (bPrevLineWasZero && ui32CountLines > 1)
{
- PVR_DUMPDEBUG_LOG(("FWT[...]: %d lines were all zero", ui32CountLines));
+ PVR_DUMPDEBUG_LOG("FWT[...]: %d lines were all zero", ui32CountLines);
}
bPrevLineWasZero = IMG_FALSE;
- PVR_DUMPDEBUG_LOG(("FWT[%08x]:%s", ui32LineOffset, pszLine));
+ PVR_DUMPDEBUG_LOG("FWT[%08x]:%s", ui32LineOffset, pszLine);
}
}
if (bPrevLineWasZero)
{
- PVR_DUMPDEBUG_LOG(("FWT[END]: %d lines were all zero", ui32CountLines));
+ PVR_DUMPDEBUG_LOG("FWT[END]: %d lines were all zero", ui32CountLines);
}
- PVR_DUMPDEBUG_LOG(("------[ RGX FW thread %d trace END ]------", tid));
+ PVR_DUMPDEBUG_LOG("------[ RGX FW thread %d trace END ]------", tid);
OSFreeMem(pszLine);
}
@@ -3489,15 +3534,15 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
IMG_UINT32 ui32T1PCXWOff = psRGXFWIfTraceBufCtl->ui32T1PCXWOff;
IMG_UINT32 i = ui32T1PCXWOff;
- PVR_DUMPDEBUG_LOG(("------[ FW Thread 1 PCX list (most recent first) ]------"));
+ PVR_DUMPDEBUG_LOG("------[ FW Thread 1 PCX list (most recent first) ]------");
do
{
- PVR_DUMPDEBUG_LOG((" 0x%08x", pui32T1PCX[i]));
+ PVR_DUMPDEBUG_LOG(" 0x%08x", pui32T1PCX[i]);
i = (i == 0) ? (RGXFWIF_MAX_PCX - 1) : (i - 1);
} while (i != ui32T1PCXWOff);
- PVR_DUMPDEBUG_LOG(("------[ FW Thread 1 PCX list [END] ]------"));
+ PVR_DUMPDEBUG_LOG("------[ FW Thread 1 PCX list [END] ]------");
}
DevmemReleaseCpuVirtAddr(psDevInfo->psRGXFWIfInitMemDesc);
@@ -3507,17 +3552,17 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
{
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING) || defined(PVRSRV_ENABLE_FULL_CCB_DUMP)
- PVR_DUMPDEBUG_LOG(("------[ Full CCB Status ]------"));
+ PVR_DUMPDEBUG_LOG("------[ Full CCB Status ]------");
#else
- PVR_DUMPDEBUG_LOG(("------[ Stalled FWCtxs ]------"));
+ PVR_DUMPDEBUG_LOG("------[ Stalled FWCtxs ]------");
#endif
- CheckForStalledTransferCtxt(psDevInfo, pfnDumpDebugPrintf);
- CheckForStalledRenderCtxt(psDevInfo, pfnDumpDebugPrintf);
+ CheckForStalledTransferCtxt(psDevInfo, pfnDumpDebugPrintf, pvDumpDebugFile);
+ CheckForStalledRenderCtxt(psDevInfo, pfnDumpDebugPrintf, pvDumpDebugFile);
#if defined(RGX_FEATURE_COMPUTE)
- CheckForStalledComputeCtxt(psDevInfo, pfnDumpDebugPrintf);
+ CheckForStalledComputeCtxt(psDevInfo, pfnDumpDebugPrintf, pvDumpDebugFile);
#endif
#if defined(RGX_FEATURE_RAY_TRACING)
- CheckForStalledRayCtxt(psDevInfo, pfnDumpDebugPrintf);
+ CheckForStalledRayCtxt(psDevInfo, pfnDumpDebugPrintf, pvDumpDebugFile);
#endif
}
break;
@@ -3540,13 +3585,13 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
bRGXPoweredON = (ePowerState == PVRSRV_DEV_POWER_STATE_ON);
- PVR_DUMPDEBUG_LOG(("------[ Debug bus ]------"));
+ PVR_DUMPDEBUG_LOG("------[ Debug bus ]------");
- _RGXDumpRGXDebugSummary(pfnDumpDebugPrintf, psDevInfo, bRGXPoweredON);
+ _RGXDumpRGXDebugSummary(pfnDumpDebugPrintf, pvDumpDebugFile, psDevInfo, bRGXPoweredON);
if (bRGXPoweredON)
{
- eError = RGXRunScript(psDevInfo, psDevInfo->psScripts->asDbgBusCommands, RGX_MAX_DBGBUS_COMMANDS, PDUMP_FLAGS_CONTINUOUS, pfnDumpDebugPrintf);
+ eError = RGXRunScript(psDevInfo, psDevInfo->psScripts->asDbgBusCommands, RGX_MAX_DBGBUS_COMMANDS, PDUMP_FLAGS_CONTINUOUS, pfnDumpDebugPrintf, pvDumpDebugFile);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_WARNING,"RGXDebugRequestProcess: RGXRunScript failed (%s)", PVRSRVGetErrorStringKM(eError)));
@@ -3569,7 +3614,7 @@ Exit:
void RGXPanic(PVRSRV_RGXDEV_INFO *psDevInfo)
{
PVR_LOG(("RGX panic"));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
OSPanic();
}
diff --git a/drivers/staging/imgtec/rogue/rgxdebug.h b/drivers/staging/imgtec/rogue/rgxdebug.h
index baf1f48a7b8d..84e635104156 100644
--- a/drivers/staging/imgtec/rogue/rgxdebug.h
+++ b/drivers/staging/imgtec/rogue/rgxdebug.h
@@ -79,13 +79,16 @@ void RGXPanic(PVRSRV_RGXDEV_INFO *psDevInfo);
Does not dump debugging information for all requester types.(SysDebug, ServerSync info)
@Input pfnDumpDebugPrintf - Optional replacement print function
- @Input psDevInfo - RGX device info
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
@Return void
******************************************************************************/
void RGXDumpDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo);
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo);
/*!
*******************************************************************************
@@ -98,16 +101,18 @@ void RGXDumpDebugInfo(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
verbosity
@Input pfnDumpDebugPrintf - Optional replacement print function
- @Input psDevInfo - RGX device info
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
@Input ui32VerbLevel - Verbosity level
@Return void
******************************************************************************/
void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo,
- IMG_UINT32 ui32VerbLevel);
-
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo,
+ IMG_UINT32 ui32VerbLevel);
/*!
*******************************************************************************
@@ -119,14 +124,16 @@ void RGXDebugRequestProcess(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
Dump useful debugging info
@Input pfnDumpDebugPrintf - Optional replacement print function
- @Input psDevInfo - RGX device info
+ @Input pvDumpDebugFile - Optional file identifier to be passed to the
+ 'printf' function if required
+ @Input psDevInfo - RGX device info
@Return void
******************************************************************************/
void RGXDumpFirmwareTrace(DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
- PVRSRV_RGXDEV_INFO *psDevInfo);
-
+ void *pvDumpDebugFile,
+ PVRSRV_RGXDEV_INFO *psDevInfo);
/*!
*******************************************************************************
diff --git a/drivers/staging/imgtec/rogue/rgxfwutils.c b/drivers/staging/imgtec/rogue/rgxfwutils.c
index 6c5095da72ce..e53914ffce10 100644
--- a/drivers/staging/imgtec/rogue/rgxfwutils.c
+++ b/drivers/staging/imgtec/rogue/rgxfwutils.c
@@ -2700,7 +2700,7 @@ PVRSRV_ERROR RGXSendCommandWithPowLock(PVRSRV_RGXDEV_INFO *psDevInfo,
#if defined(DEBUG)
/* PVRSRVDebugRequest must be called without powerlock */
PVRSRVPowerUnlock();
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
goto _PVRSRVPowerLock_Exit;
#endif
}
@@ -3183,7 +3183,7 @@ void RGXCheckFirmwareCCB(PVRSRV_RGXDEV_INFO *psDevInfo)
case RGXFWIF_FWCCB_CMD_DEBUG_DUMP:
{
- RGXDumpDebugInfo(NULL,psDevInfo);
+ RGXDumpDebugInfo(NULL,NULL,psDevInfo);
break;
}
@@ -3400,7 +3400,7 @@ PVRSRV_ERROR RGXWaitForFWOp(PVRSRV_RGXDEV_INFO *psDevInfo,
PVR_DPF((PVR_DBG_ERROR,"RGXScheduleCommandAndWait: PVRSRVWaitForValueKMAndHoldBridgeLock timed out. Dump debug information."));
PVRSRVPowerUnlock();
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX,NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX,NULL,NULL);
PVR_ASSERT(eError != PVRSRV_ERROR_TIMEOUT);
goto _PVRSRVDebugRequest_Exit;
}
@@ -3508,7 +3508,7 @@ PVRSRV_ERROR RGXScheduleCleanupCommand(PVRSRV_RGXDEV_INFO *psDevInfo,
eError = PVRSRV_ERROR_RETRY;
#if defined(DEBUG)
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX,NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX,NULL,NULL);
#endif
goto fail_poll;
}
@@ -4111,15 +4111,16 @@ PVRSRV_ERROR CheckStalledClientCommonContext(RGX_SERVER_COMMON_CONTEXT *psCurren
}
void DumpStalledFWCommonContext(RGX_SERVER_COMMON_CONTEXT *psCurrentServerCommonContext,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
RGX_CLIENT_CCB *psCurrentClientCCB = psCurrentServerCommonContext->psClientCCB;
PRGXFWIF_FWCOMMONCONTEXT sFWCommonContext = psCurrentServerCommonContext->sFWCommonContextFWAddr;
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING) || defined(PVRSRV_ENABLE_FULL_CCB_DUMP)
- DumpCCB(sFWCommonContext, psCurrentClientCCB, pfnDumpDebugPrintf);
+ DumpCCB(sFWCommonContext, psCurrentClientCCB, pfnDumpDebugPrintf, pvDumpDebugFile);
#else
- DumpStalledCCBCommand(sFWCommonContext, psCurrentClientCCB, pfnDumpDebugPrintf);
+ DumpStalledCCBCommand(sFWCommonContext, psCurrentClientCCB, pfnDumpDebugPrintf, pvDumpDebugFile);
#endif
}
diff --git a/drivers/staging/imgtec/rogue/rgxfwutils.h b/drivers/staging/imgtec/rogue/rgxfwutils.h
index 7b167d3c59cb..4d50625d47fe 100644
--- a/drivers/staging/imgtec/rogue/rgxfwutils.h
+++ b/drivers/staging/imgtec/rogue/rgxfwutils.h
@@ -734,7 +734,8 @@ PVRSRV_ERROR RGXUpdateHealthStatus(PVRSRV_DEVICE_NODE* psDevNode,
PVRSRV_ERROR CheckStalledClientCommonContext(RGX_SERVER_COMMON_CONTEXT *psCurrentServerCommonContext);
void DumpStalledFWCommonContext(RGX_SERVER_COMMON_CONTEXT *psCurrentServerCommonContext,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/*!
******************************************************************************
diff --git a/drivers/staging/imgtec/rogue/rgxinit.c b/drivers/staging/imgtec/rogue/rgxinit.c
index ba1c37c98926..174af604d80f 100644
--- a/drivers/staging/imgtec/rogue/rgxinit.c
+++ b/drivers/staging/imgtec/rogue/rgxinit.c
@@ -269,7 +269,7 @@ static void RGXCheckFWActivePowerState(void *psDevice)
PVRSRV_RGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
RGXFWIF_TRACEBUF *psFWTraceBuf = psDevInfo->psRGXFWIfTraceBuf;
PVRSRV_ERROR eError = PVRSRV_OK;
-
+
if (psFWTraceBuf->ePowState == RGXFWIF_POW_IDLE)
{
/* The FW is IDLE and therefore could be shut down */
@@ -281,7 +281,7 @@ static void RGXCheckFWActivePowerState(void *psDevice)
psDeviceNode->sDevId.ui32DeviceIndex,
PVRSRVGetErrorStringKM(eError)));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MAX, NULL, NULL);
}
}
@@ -764,7 +764,7 @@ PVRSRV_ERROR PVRSRVRGXInitDevPart2KM (CONNECTION_DATA *psConnection,
#if defined(PDUMP)
/* Run the deinit script to feed the last-frame deinit buffer */
PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_DEINIT, "RGX deinitialisation script");
- RGXRunScript(psDevInfo, psDevInfo->psScripts->asDeinitCommands, RGX_MAX_DEINIT_COMMANDS, PDUMP_FLAGS_DEINIT | PDUMP_FLAGS_NOHW, NULL);
+ RGXRunScript(psDevInfo, psDevInfo->psScripts->asDeinitCommands, RGX_MAX_DEINIT_COMMANDS, PDUMP_FLAGS_DEINIT | PDUMP_FLAGS_NOHW, NULL, NULL);
#endif
#endif /* defined(PVRSRV_GPUVIRT_GUESTDRV) */
@@ -1830,7 +1830,8 @@ PVRSRV_ERROR DevDeInitRGX (PVRSRV_DEVICE_NODE *psDeviceNode)
@Description Dump the debug data for RGX
******************************************************************************/
-static void RGXDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDbgReqestHandle, IMG_UINT32 ui32VerbLevel)
+static void RGXDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDbgReqestHandle, IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile)
{
#if defined(PVRSRV_GPUVIRT_GUESTDRV)
PVR_UNREFERENCED_PARAMETER(hDbgReqestHandle);
@@ -1841,7 +1842,7 @@ static void RGXDebugRequestNotify(PVRSRV_DBGREQ_HANDLE hDbgReqestHandle, IMG_UIN
/* Only action the request if we've fully init'ed */
if (g_bDevInit2Done)
{
- RGXDebugRequestProcess(g_pfnDumpDebugPrintf, psDeviceNode->pvDevice, ui32VerbLevel);
+ RGXDebugRequestProcess(pfnDumpDebugPrintf, pvDumpDebugFile, psDeviceNode->pvDevice, ui32VerbLevel);
}
#endif
}
diff --git a/drivers/staging/imgtec/rogue/rgxmem.c b/drivers/staging/imgtec/rogue/rgxmem.c
index 3a9893e49fce..e0b4d6888680 100644
--- a/drivers/staging/imgtec/rogue/rgxmem.c
+++ b/drivers/staging/imgtec/rogue/rgxmem.c
@@ -511,7 +511,11 @@ DEVMEM_MEMDESC *RGXGetFWMemDescFromMemoryContextHandle(IMG_HANDLE hPriv)
return psMMUContext->psFWMemContextMemDesc;
}
-void RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_VIRTADDR *psDevVAddr, IMG_DEV_PHYADDR *psDevPAddr)
+void RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo,
+ IMG_DEV_VIRTADDR *psDevVAddr,
+ IMG_DEV_PHYADDR *psDevPAddr,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
IMG_DEV_PHYADDR sPCDevPAddr;
DLLIST_NODE *psNode, *psNext;
@@ -531,13 +535,12 @@ void RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_VIRTADDR *psDev
if (psDevPAddr->uiAddr == sPCDevPAddr.uiAddr)
{
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
-
- PVR_DUMPDEBUG_LOG(("Found memory context (PID = %d, %s)",
+ PVR_DUMPDEBUG_LOG("Found memory context (PID = %d, %s)",
psServerMMUContext->uiPID,
- psServerMMUContext->szProcessName));
+ psServerMMUContext->szProcessName);
- MMU_CheckFaultAddress(psServerMMUContext->psMMUContext, psDevVAddr);
+ MMU_CheckFaultAddress(psServerMMUContext->psMMUContext, psDevVAddr,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
break;
}
}
@@ -550,7 +553,8 @@ void RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_VIRTADDR *psDev
if (psDevPAddr->uiAddr == sPCDevPAddr.uiAddr)
{
- MMU_CheckFaultAddress(psDevInfo->psKernelMMUCtx, psDevVAddr);
+ MMU_CheckFaultAddress(psDevInfo->psKernelMMUCtx, psDevVAddr,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
OSWRLockReleaseRead(psDevInfo->hMemoryCtxListLock);
diff --git a/drivers/staging/imgtec/rogue/rgxmem.h b/drivers/staging/imgtec/rogue/rgxmem.h
index b57d4c9a675a..2669a8c80995 100644
--- a/drivers/staging/imgtec/rogue/rgxmem.h
+++ b/drivers/staging/imgtec/rogue/rgxmem.h
@@ -82,8 +82,10 @@ PVRSRV_ERROR RGXRegisterMemoryContext(PVRSRV_DEVICE_NODE *psDeviceNode,
DEVMEM_MEMDESC *RGXGetFWMemDescFromMemoryContextHandle(IMG_HANDLE hPriv);
void RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo,
- IMG_DEV_VIRTADDR *psDevVAddr,
- IMG_DEV_PHYADDR *psDevPAddr);
+ IMG_DEV_VIRTADDR *psDevVAddr,
+ IMG_DEV_PHYADDR *psDevPAddr,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
IMG_BOOL RGXPCAddrToProcessInfo(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_PHYADDR sPCAddress,
RGXMEM_PROCESS_INFO *psInfo);
diff --git a/drivers/staging/imgtec/rogue/rgxta3d.c b/drivers/staging/imgtec/rogue/rgxta3d.c
index ec47d2423c6b..eb8172176d4e 100644
--- a/drivers/staging/imgtec/rogue/rgxta3d.c
+++ b/drivers/staging/imgtec/rogue/rgxta3d.c
@@ -831,6 +831,10 @@ void RGXProcessRequestFreelistsReconstruction(PVRSRV_RGXDEV_INFO *psDevInfo,
//PVR_DPF((PVR_DBG_ERROR,"FreeList RECONSTRUCTION: Reconstructing %u freelist(s)", ui32FreelistsCount));
+ /* initialise the command */
+ sTACCBCmd.eCmdType = RGXFWIF_KCCB_CMD_FREELISTS_RECONSTRUCTION_UPDATE;
+ sTACCBCmd.uCmdData.sFreeListsReconstructionData.ui32FreelistsCount = 0;
+
for (ui32Loop = 0; ui32Loop < ui32FreelistsCount; ui32Loop++)
{
/* check if there is more than one occurrence of FL on the list */
@@ -884,14 +888,14 @@ void RGXProcessRequestFreelistsReconstruction(PVRSRV_RGXDEV_INFO *psDevInfo,
if (eError == PVRSRV_OK)
{
/* Freelist reconstruction successful */
- sTACCBCmd.uCmdData.sFreeListsReconstructionData.aui32FreelistIDs[ui32Loop] =
+ sTACCBCmd.uCmdData.sFreeListsReconstructionData.aui32FreelistIDs[sTACCBCmd.uCmdData.sFreeListsReconstructionData.ui32FreelistsCount] =
paui32Freelists[ui32Loop];
}
#if 0
else
{
/* Freelist reconstruction failed */
- sTACCBCmd.uCmdData.sFreeListsReconstructionData.aui32FreelistIDs[ui32Loop] =
+ sTACCBCmd.uCmdData.sFreeListsReconstructionData.aui32FreelistIDs[sTACCBCmd.uCmdData.sFreeListsReconstructionData.ui32FreelistsCount] =
paui32Freelists[ui32Loop] | RGXFWIF_FREELISTS_RECONSTRUCTION_FAILED_FLAG;
PVR_DPF((PVR_DBG_ERROR,"Reconstructing of FreeList %p failed (error %u)",
@@ -899,18 +903,20 @@ void RGXProcessRequestFreelistsReconstruction(PVRSRV_RGXDEV_INFO *psDevInfo,
eError));
}
#endif
+ sTACCBCmd.uCmdData.sFreeListsReconstructionData.ui32FreelistsCount++;
}
else
{
/* Should never happen */
- PVR_DPF((PVR_DBG_ERROR,"FreeList Lookup for FreeList ID 0x%08x failed (Freelist reconstruction)", paui32Freelists[ui32Loop]));
+ PVR_DPF((PVR_DBG_ERROR,"RGXProcessRequestFreelistsReconstruction: FreeList Lookup for FreeList ID 0x%08X failed. "
+ "Last allocated FreeList ID: 0x%08X",
+ paui32Freelists[ui32Loop],
+ psDevInfo->ui32FreelistCurrID - 1));
PVR_ASSERT(IMG_FALSE);
}
}
/* send feedback */
- sTACCBCmd.eCmdType = RGXFWIF_KCCB_CMD_FREELISTS_RECONSTRUCTION_UPDATE;
- sTACCBCmd.uCmdData.sFreeListsReconstructionData.ui32FreelistsCount = ui32FreelistsCount;
LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
{
@@ -3556,7 +3562,8 @@ PVRSRV_ERROR PVRSRVRGXGetPartialRenderCountKM(DEVMEM_MEMDESC *psHWRTDataMemDesc,
}
void CheckForStalledRenderCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
DLLIST_NODE *psNode, *psNext;
OSWRLockAcquireRead(psDevInfo->hRenderCtxListLock);
@@ -3566,9 +3573,9 @@ void CheckForStalledRenderCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
IMG_CONTAINER_OF(psNode, RGX_SERVER_RENDER_CONTEXT, sListNode);
DumpStalledFWCommonContext(psCurrentServerRenderCtx->sTAData.psServerCommonContext,
- pfnDumpDebugPrintf);
+ pfnDumpDebugPrintf, pvDumpDebugFile);
DumpStalledFWCommonContext(psCurrentServerRenderCtx->s3DData.psServerCommonContext,
- pfnDumpDebugPrintf);
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
OSWRLockReleaseRead(psDevInfo->hRenderCtxListLock);
}
diff --git a/drivers/staging/imgtec/rogue/rgxta3d.h b/drivers/staging/imgtec/rogue/rgxta3d.h
index 8c896a19295b..f04f00e485d3 100644
--- a/drivers/staging/imgtec/rogue/rgxta3d.h
+++ b/drivers/staging/imgtec/rogue/rgxta3d.h
@@ -451,7 +451,8 @@ PVRSRV_ERROR PVRSRVRGXGetPartialRenderCountKM(DEVMEM_MEMDESC *psHWRTDataMemDesc,
/* Debug - check if render context is waiting on a fence */
void CheckForStalledRenderCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/* Debug/Watchdog - check if client contexts are stalled */
IMG_BOOL CheckForStalledClientRenderCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
diff --git a/drivers/staging/imgtec/rogue/rgxtransfer.c b/drivers/staging/imgtec/rogue/rgxtransfer.c
index e9c4548512d4..390c6659c58c 100644
--- a/drivers/staging/imgtec/rogue/rgxtransfer.c
+++ b/drivers/staging/imgtec/rogue/rgxtransfer.c
@@ -1056,7 +1056,8 @@ fail_2dcontext:
}
void CheckForStalledTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
DLLIST_NODE *psNode, *psNext;
@@ -1070,13 +1071,13 @@ void CheckForStalledTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
if (psCurrentServerTransferCtx->ui32Flags & RGX_SERVER_TQ_CONTEXT_FLAGS_2D)
{
DumpStalledFWCommonContext(psCurrentServerTransferCtx->s2DData.psServerCommonContext,
- pfnDumpDebugPrintf);
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
if (psCurrentServerTransferCtx->ui32Flags & RGX_SERVER_TQ_CONTEXT_FLAGS_3D)
{
DumpStalledFWCommonContext(psCurrentServerTransferCtx->s3DData.psServerCommonContext,
- pfnDumpDebugPrintf);
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
}
diff --git a/drivers/staging/imgtec/rogue/rgxtransfer.h b/drivers/staging/imgtec/rogue/rgxtransfer.h
index a0d3b1a9cc0e..3699f4d665a8 100644
--- a/drivers/staging/imgtec/rogue/rgxtransfer.h
+++ b/drivers/staging/imgtec/rogue/rgxtransfer.h
@@ -143,7 +143,8 @@ PVRSRV_ERROR PVRSRVRGXSetTransferContextPriorityKM(CONNECTION_DATA *psConnection
/* Debug - check if transfer context is waiting on a fence */
void CheckForStalledTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/* Debug/Watchdog - check if client transfer contexts are stalled */
IMG_BOOL CheckForStalledClientTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
diff --git a/drivers/staging/imgtec/rogue/rgxutils.c b/drivers/staging/imgtec/rogue/rgxutils.c
index e3d9f2aa15e0..588195aebff7 100644
--- a/drivers/staging/imgtec/rogue/rgxutils.c
+++ b/drivers/staging/imgtec/rogue/rgxutils.c
@@ -57,11 +57,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* RGXRunScript
*/
-PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
- RGX_INIT_COMMAND *psScript,
- IMG_UINT32 ui32NumCommands,
- IMG_UINT32 ui32PdumpFlags,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
+PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
+ RGX_INIT_COMMAND *psScript,
+ IMG_UINT32 ui32NumCommands,
+ IMG_UINT32 ui32PdumpFlags,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
IMG_UINT32 ui32PC;
#if !defined(NO_HARDWARE)
@@ -78,14 +79,14 @@ PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
{
IMG_UINT32 ui32RegVal;
ui32RegVal = OSReadHWReg32(psDevInfo->pvRegsBaseKM, psComm->sDBGReadHWReg.ui32Offset);
- PVR_DUMPDEBUG_LOG(("%s: 0x%08X", psComm->sDBGReadHWReg.aszName, ui32RegVal));
+ PVR_DUMPDEBUG_LOG("%s: 0x%08X", psComm->sDBGReadHWReg.aszName, ui32RegVal);
break;
}
case RGX_INIT_OP_DBG_READ64_HW_REG:
{
IMG_UINT64 ui64RegVal;
ui64RegVal = OSReadHWReg64(psDevInfo->pvRegsBaseKM, psComm->sDBGReadHWReg.ui32Offset);
- PVR_DUMPDEBUG_LOG(("%s: 0x%016llX", psComm->sDBGReadHWReg.aszName, ui64RegVal));
+ PVR_DUMPDEBUG_LOG("%s: 0x%016llX", psComm->sDBGReadHWReg.aszName, ui64RegVal);
break;
}
case RGX_INIT_OP_WRITE_HW_REG:
@@ -246,11 +247,11 @@ PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
ui32RegVal3 = OSReadHWReg32(psDevInfo->pvRegsBaseKM, psComm->sDBGCalc.ui32Offset3);
if (ui32RegVal1 + ui32RegVal2 > ui32RegVal3)
{
- PVR_DUMPDEBUG_LOG(("%s: 0x%08X", psComm->sDBGCalc.aszName, ui32RegVal1 + ui32RegVal2 - ui32RegVal3));
+ PVR_DUMPDEBUG_LOG("%s: 0x%08X", psComm->sDBGCalc.aszName, ui32RegVal1 + ui32RegVal2 - ui32RegVal3);
}
else
{
- PVR_DUMPDEBUG_LOG(("%s: 0x%08X", psComm->sDBGCalc.aszName, 0));
+ PVR_DUMPDEBUG_LOG("%s: 0x%08X", psComm->sDBGCalc.aszName, 0);
}
break;
}
@@ -261,7 +262,7 @@ PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
}
case RGX_INIT_OP_DBG_STRING:
{
- PVR_DUMPDEBUG_LOG(("%s", psComm->sDBGString.aszString));
+ PVR_DUMPDEBUG_LOG("%s", psComm->sDBGString.aszString);
break;
}
case RGX_INIT_OP_HALT:
diff --git a/drivers/staging/imgtec/rogue/rgxutils.h b/drivers/staging/imgtec/rogue/rgxutils.h
index f075f43807a2..718f70c08c5d 100644
--- a/drivers/staging/imgtec/rogue/rgxutils.h
+++ b/drivers/staging/imgtec/rogue/rgxutils.h
@@ -58,11 +58,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@Return PVRSRV_ERROR
******************************************************************************/
-PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
- RGX_INIT_COMMAND *psScript,
- IMG_UINT32 ui32NumCommands,
- IMG_UINT32 ui32PdumpFlags,
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+PVRSRV_ERROR RGXRunScript(PVRSRV_RGXDEV_INFO *psDevInfo,
+ RGX_INIT_COMMAND *psScript,
+ IMG_UINT32 ui32NumCommands,
+ IMG_UINT32 ui32PdumpFlags,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/******************************************************************************
End of file (rgxutils.h)
diff --git a/drivers/staging/imgtec/rogue/scp.c b/drivers/staging/imgtec/rogue/scp.c
index 0c5a0b606ab2..d8b2fb12fd40 100644
--- a/drivers/staging/imgtec/rogue/scp.c
+++ b/drivers/staging/imgtec/rogue/scp.c
@@ -294,20 +294,19 @@ void _SCPInsert(SCP_CONTEXT *psContext,
#if defined(SUPPORT_NATIVE_FENCE_SYNC)
-static void _SCPDumpFence(const char *psczName, struct sync_fence *psFence)
+static void _SCPDumpFence(const char *psczName, struct sync_fence *psFence,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
struct list_head *psEntry;
char szTime[16] = { '\0' };
char szVal1[64] = { '\0' };
char szVal2[64] = { '\0' };
char szVal3[132] = { '\0' };
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
-
- PVR_DUMPDEBUG_LOG(("\t %s: [%p] %s: %s", psczName, psFence, psFence->name,
+ PVR_DUMPDEBUG_LOG("\t %s: [%p] %s: %s", psczName, psFence, psFence->name,
(psFence->status > 0 ? "signaled" :
- psFence->status == 0 ? "active" : "error")));
+ psFence->status == 0 ? "active" : "error"));
list_for_each(psEntry, &psFence->pt_list_head)
{
struct sync_pt *psPt = container_of(psEntry, struct sync_pt, pt_list);
@@ -320,11 +319,11 @@ static void _SCPDumpFence(const char *psczName, struct sync_fence *psFence)
psPt->parent->ops->timeline_value_str(psPt->parent, szVal2, sizeof(szVal2));
snprintf(szVal3, sizeof(szVal3), ": %s / %s", szVal1, szVal2);
}
- PVR_DUMPDEBUG_LOG(("\t %s %s%s%s", psPt->parent->name,
+ PVR_DUMPDEBUG_LOG("\t %s %s%s%s", psPt->parent->name,
(psPt->status > 0 ? "signaled" :
psPt->status == 0 ? "active" : "error"),
(psPt->status > 0 ? szTime : ""),
- szVal3));
+ szVal3);
}
}
@@ -388,7 +387,7 @@ PVRSRV_ERROR _SCPCommandReady(SCP_COMMAND *psCommand)
if (err)
{
PVR_LOG(("SCP: Fence wait failed with %d", err));
- _SCPDumpFence("Acquire Fence", psCommand->psAcquireFence);
+ _SCPDumpFence("Acquire Fence", psCommand->psAcquireFence, NULL, NULL);
}
/* Put the fence. */
sync_fence_put(psCommand->psAcquireFence);
@@ -439,14 +438,13 @@ void _SCPCommandDo(SCP_COMMAND *psCommand)
@Return None
*/
/*****************************************************************************/
-static void _SCPDumpCommand(SCP_COMMAND *psCommand)
+static void _SCPDumpCommand(SCP_COMMAND *psCommand,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
IMG_UINT32 i;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
-
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
- PVR_DUMPDEBUG_LOG(("\tCommand type = %d (@%p)", psCommand->ui32CmdType, psCommand));
+ PVR_DUMPDEBUG_LOG("\tCommand type = %d (@%p)", psCommand->ui32CmdType, psCommand);
if (psCommand->ui32CmdType == SCP_COMMAND_CALLBACK)
{
@@ -463,20 +461,22 @@ static void _SCPDumpCommand(SCP_COMMAND *psCommand)
if (psSCPSyncData->ui32Flags & SCP_SYNC_DATA_FENCE)
{
PVR_ASSERT(psSCPSyncData->psSync != NULL);
- PVR_DUMPDEBUG_LOG(("\t\tFenced on 0x%08x = 0x%08x (?= 0x%08x)",
+ PVR_DUMPDEBUG_LOG("\t\tFenced on 0x%08x = 0x%08x (?= 0x%08x)",
ServerSyncGetFWAddr(psSCPSyncData->psSync),
psSCPSyncData->ui32Fence,
- ServerSyncGetValue(psSCPSyncData->psSync)));
+ ServerSyncGetValue(psSCPSyncData->psSync));
}
}
#if defined(SUPPORT_NATIVE_FENCE_SYNC)
if (psCommand->psAcquireFence)
{
- _SCPDumpFence("Acquire Fence", psCommand->psAcquireFence);
+ _SCPDumpFence("Acquire Fence", psCommand->psAcquireFence,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
if (psCommand->psReleaseFence)
{
- _SCPDumpFence("Release Fence", psCommand->psReleaseFence);
+ _SCPDumpFence("Release Fence", psCommand->psReleaseFence,
+ pfnDumpDebugPrintf, pvDumpDebugFile);
}
#endif /* defined(SUPPORT_NATIVE_FENCE_SYNC) */
}
@@ -878,12 +878,10 @@ IMG_BOOL SCPHasPendingCommand(SCP_CONTEXT *psContext)
}
IMG_EXPORT
-void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext)
+void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
-
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
-
PVR_ASSERT(psContext != NULL);
/*
@@ -892,10 +890,10 @@ void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext)
*/
OSLockAcquire(psContext->hLock);
- PVR_DUMPDEBUG_LOG(("Pending command:"));
+ PVR_DUMPDEBUG_LOG("Pending command:");
if (psContext->ui32DepOffset == psContext->ui32WriteOffset)
{
- PVR_DUMPDEBUG_LOG(("\tNone"));
+ PVR_DUMPDEBUG_LOG("\tNone");
}
else
{
@@ -908,7 +906,7 @@ void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext)
psCommand = (SCP_COMMAND *)((IMG_UINT8 *)psContext->pvCCB +
ui32DepOffset);
- _SCPDumpCommand(psCommand);
+ _SCPDumpCommand(psCommand, pfnDumpDebugPrintf, pvDumpDebugFile);
/* processed cmd so update queue */
UPDATE_CCB_OFFSET(ui32DepOffset,
@@ -918,10 +916,10 @@ void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext)
}
}
- PVR_DUMPDEBUG_LOG(("Active command(s):"));
+ PVR_DUMPDEBUG_LOG("Active command(s):");
if (psContext->ui32DepOffset == psContext->ui32ReadOffset)
{
- PVR_DUMPDEBUG_LOG(("\tNone"));
+ PVR_DUMPDEBUG_LOG("\tNone");
}
else
{
@@ -933,7 +931,7 @@ void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext)
psCommand = (SCP_COMMAND *)((IMG_UINT8 *)psContext->pvCCB +
ui32ReadOffset);
- _SCPDumpCommand(psCommand);
+ _SCPDumpCommand(psCommand, pfnDumpDebugPrintf, pvDumpDebugFile);
/* processed cmd so update queue */
UPDATE_CCB_OFFSET(ui32ReadOffset,
diff --git a/drivers/staging/imgtec/rogue/scp.h b/drivers/staging/imgtec/rogue/scp.h
index 926d4d3492a2..effdb741055b 100644
--- a/drivers/staging/imgtec/rogue/scp.h
+++ b/drivers/staging/imgtec/rogue/scp.h
@@ -205,11 +205,15 @@ IMG_BOOL SCPHasPendingCommand(SCP_CONTEXT *psContext);
@Input psSCPContext Context to dump
+@Input pfnDumpDebugPrintf Debug print function
+
@Return None
*/
/*****************************************************************************/
IMG_EXPORT
-void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext);
+void IMG_CALLCONV SCPDumpStatus(SCP_CONTEXT *psContext,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile);
/*************************************************************************/ /*!
@Function SCPDestroy
diff --git a/drivers/staging/imgtec/rogue/srvcore.c b/drivers/staging/imgtec/rogue/srvcore.c
index 9680950bd1e5..cefef8972aaa 100644
--- a/drivers/staging/imgtec/rogue/srvcore.c
+++ b/drivers/staging/imgtec/rogue/srvcore.c
@@ -498,7 +498,7 @@ PVRSRVDumpDebugInfoKM(IMG_UINT32 ui32VerbLevel)
}
PVR_LOG(("User requested PVR debug info"));
- PVRSRVDebugRequest(ui32VerbLevel, NULL);
+ PVRSRVDebugRequest(ui32VerbLevel, NULL, NULL);
return PVRSRV_OK;
}
@@ -539,7 +539,7 @@ PVRSRVHWOpTimeoutKM(void)
OSPanic();
#endif
PVR_LOG(("HW operation timeout, dump server info"));
- PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MEDIUM, NULL);
+ PVRSRVDebugRequest(DEBUG_REQUEST_VERBOSITY_MEDIUM, NULL, NULL);
return PVRSRV_OK;
}
diff --git a/drivers/staging/imgtec/rogue/sync_server.c b/drivers/staging/imgtec/rogue/sync_server.c
index 5296b0fb5ee4..4718602a00f2 100644
--- a/drivers/staging/imgtec/rogue/sync_server.c
+++ b/drivers/staging/imgtec/rogue/sync_server.c
@@ -1234,50 +1234,49 @@ IMG_UINT32 ServerSyncGetNextValue(SERVER_SYNC_PRIMITIVE *psSync)
return psSync->ui32NextOp;
}
-static void _ServerSyncState(PDLLIST_NODE psNode)
+static void _ServerSyncState(PDLLIST_NODE psNode,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
SERVER_SYNC_PRIMITIVE *psSync = IMG_CONTAINER_OF(psNode, SERVER_SYNC_PRIMITIVE, sNode);
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
-
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
if (*psSync->psSync->pui32LinAddr != psSync->ui32NextOp)
{
#if !defined(SUPPORT_EXTRA_METASP_DEBUG)
- PVR_DUMPDEBUG_LOG(("\tPending server sync (ID = %d, FWAddr = 0x%08x): Current = 0x%08x, NextOp = 0x%08x (%s)",
+ PVR_DUMPDEBUG_LOG("\tPending server sync (ID = %d, FWAddr = 0x%08x): Current = 0x%08x, NextOp = 0x%08x (%s)",
psSync->ui32UID,
ServerSyncGetFWAddr(psSync),
ServerSyncGetValue(psSync),
psSync->ui32NextOp,
- psSync->szClassName));
+ psSync->szClassName);
#else
- PVR_DUMPDEBUG_LOG(("\tPending server sync (ID = %d, FWAddr = 0x%08x): Value (Host) = 0x%08x, Value (FW) = 0x%08x, NextOp = 0x%08x (%s)",
+ PVR_DUMPDEBUG_LOG("\tPending server sync (ID = %d, FWAddr = 0x%08x): Value (Host) = 0x%08x, Value (FW) = 0x%08x, NextOp = 0x%08x (%s)",
psSync->ui32UID,
ServerSyncGetFWAddr(psSync),
ServerSyncGetValue(psSync),
RGXReadWithSP(ServerSyncGetFWAddr(psSync)),
psSync->ui32NextOp,
- psSync->szClassName));
+ psSync->szClassName);
#endif
}
}
-static void _ServerSyncDebugRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel)
+static void _ServerSyncDebugRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle,
+ IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
-
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = NULL;
DLLIST_NODE *psNode, *psNext;
PVR_UNREFERENCED_PARAMETER(hDebugRequestHandle);
- pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
if (ui32VerbLevel == DEBUG_REQUEST_VERBOSITY_HIGH)
{
- PVR_DUMPDEBUG_LOG(("Dumping all pending server syncs"));
+ PVR_DUMPDEBUG_LOG("Dumping all pending server syncs");
OSLockAcquire(g_hListLock);
dllist_foreach_node(&g_sAllServerSyncs, psNode, psNext)
{
- _ServerSyncState(psNode);
+ _ServerSyncState(psNode, pfnDumpDebugPrintf, pvDumpDebugFile);
}
OSLockRelease(g_hListLock);
}
@@ -1837,10 +1836,12 @@ void SyncRecordLookup(
}
#define NS_IN_S (1000000000UL)
-static void _SyncRecordPrint(struct SYNC_RECORD * psSyncRec, IMG_UINT64 ui64TimeNow)
+static void _SyncRecordPrint(struct SYNC_RECORD *psSyncRec,
+ IMG_UINT64 ui64TimeNow,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
SYNC_PRIMITIVE_BLOCK *psSyncBlock = psSyncRec->psServerSyncPrimBlock;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
if (SYNC_RECORD_TYPE_UNKNOWN != psSyncRec->eRecordType)
{
@@ -1855,33 +1856,35 @@ static void _SyncRecordPrint(struct SYNC_RECORD * psSyncRec, IMG_UINT64 ui64Time
pui32SyncAddr = psSyncBlock->pui32LinAddr
+ (psSyncRec->ui32SyncOffset/sizeof(IMG_UINT32));
- PVR_DUMPDEBUG_LOG(("\t%s %05u %05llu.%09u FWAddr=0x%08x Val=0x%08x (%s)",
+ PVR_DUMPDEBUG_LOG("\t%s %05u %05llu.%09u FWAddr=0x%08x Val=0x%08x (%s)",
((SYNC_RECORD_TYPE_SERVER==psSyncRec->eRecordType)?"Server":"Client"),
psSyncRec->uiPID,
ui64DeltaS, ui32DeltaF,
(psSyncRec->ui32FwBlockAddr+psSyncRec->ui32SyncOffset),
*pui32SyncAddr,
psSyncRec->szClassName
- ));
+ );
}
else
{
- PVR_DUMPDEBUG_LOG(("\t%s %05u %05llu.%09u FWAddr=0x%08x Val=<null_ptr> (%s)",
+ PVR_DUMPDEBUG_LOG("\t%s %05u %05llu.%09u FWAddr=0x%08x Val=<null_ptr> (%s)",
((SYNC_RECORD_TYPE_SERVER==psSyncRec->eRecordType)?"Server":"Client"),
psSyncRec->uiPID,
ui64DeltaS, ui32DeltaF,
(psSyncRec->ui32FwBlockAddr+psSyncRec->ui32SyncOffset),
psSyncRec->szClassName
- ));
+ );
}
}
}
-static void _SyncRecordRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel)
+static void _SyncRecordRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle,
+ IMG_UINT32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
+ void *pvDumpDebugFile)
{
IMG_UINT64 ui64TimeNowS;
IMG_UINT32 ui32TimeNowF;
- DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;
IMG_UINT64 ui64TimeNow = OSClockns64();
DLLIST_NODE *psNode, *psNext;
@@ -1894,27 +1897,28 @@ static void _SyncRecordRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UIN
unsigned i;
OSLockAcquire(g_hSyncRecordListLock);
- PVR_DUMPDEBUG_LOG(("Dumping all allocated syncs @ %05llu.%09u", ui64TimeNowS, ui32TimeNowF));
- PVR_DUMPDEBUG_LOG(("\t%-6s %-5s %-15s %-17s %-14s (%s)",
- "Type", "PID", "Time Delta (s)", "Address", "Value", "Annotation"));
+ PVR_DUMPDEBUG_LOG("Dumping all allocated syncs @ %05llu.%09u", ui64TimeNowS, ui32TimeNowF);
+ PVR_DUMPDEBUG_LOG("\t%-6s %-5s %-15s %-17s %-14s (%s)",
+ "Type", "PID", "Time Delta (s)", "Address", "Value", "Annotation");
dllist_foreach_node(&g_sSyncRecordList, psNode, psNext)
{
struct SYNC_RECORD *psSyncRec =
IMG_CONTAINER_OF(psNode, struct SYNC_RECORD, sNode);
- _SyncRecordPrint(psSyncRec, ui64TimeNow);
+ _SyncRecordPrint(psSyncRec, ui64TimeNow, pfnDumpDebugPrintf, pvDumpDebugFile);
}
- PVR_DUMPDEBUG_LOG(("Dumping all recently freed syncs @ %05llu.%09u", ui64TimeNowS, ui32TimeNowF));
- PVR_DUMPDEBUG_LOG(("\t%-6s %-5s %-15s %-17s %-14s (%s)",
- "Type", "PID", "Time Delta (s)", "Address", "Value", "Annotation"));
+ PVR_DUMPDEBUG_LOG("Dumping all recently freed syncs @ %05llu.%09u", ui64TimeNowS, ui32TimeNowF);
+ PVR_DUMPDEBUG_LOG("\t%-6s %-5s %-15s %-17s %-14s (%s)",
+ "Type", "PID", "Time Delta (s)", "Address", "Value", "Annotation");
for(i = DECREMENT_WITH_WRAP(g_uiFreedSyncRecordIdx, PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN);
i != g_uiFreedSyncRecordIdx;
i = DECREMENT_WITH_WRAP(i, PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN))
{
if (g_apsFreedSyncRecords[i])
{
- _SyncRecordPrint(g_apsFreedSyncRecords[i], ui64TimeNow);
+ _SyncRecordPrint(g_apsFreedSyncRecords[i],
+ ui64TimeNow, pfnDumpDebugPrintf, pvDumpDebugFile);
}
else
{
diff --git a/drivers/staging/imgtec/rogue/syscommon.h b/drivers/staging/imgtec/rogue/syscommon.h
index 32972388ff32..f70097b223bc 100644
--- a/drivers/staging/imgtec/rogue/syscommon.h
+++ b/drivers/staging/imgtec/rogue/syscommon.h
@@ -63,7 +63,7 @@ PVRSRV_ERROR SysCreateConfigData(PVRSRV_SYSTEM_CONFIG **ppsSysConfig, void *hDev
void SysDestroyConfigData(PVRSRV_SYSTEM_CONFIG *psSysConfig);
PVRSRV_ERROR SysAcquireSystemData(IMG_HANDLE hSysData);
PVRSRV_ERROR SysReleaseSystemData(IMG_HANDLE hSysData);
-PVRSRV_ERROR SysDebugInfo(PVRSRV_SYSTEM_CONFIG *psSysConfig, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
+PVRSRV_ERROR SysDebugInfo(PVRSRV_SYSTEM_CONFIG *psSysConfig, DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile);
#if defined(SUPPORT_GPUVIRT_VALIDATION)
#include "services_km.h"
diff --git a/drivers/staging/imgtec/services_kernel_client.h b/drivers/staging/imgtec/services_kernel_client.h
index 665a463faf89..7a1ab690e7c9 100644
--- a/drivers/staging/imgtec/services_kernel_client.h
+++ b/drivers/staging/imgtec/services_kernel_client.h
@@ -93,9 +93,7 @@ struct SYNC_PRIM_CONTEXT;
#define DEBUG_REQUEST_VERBOSITY_HIGH 2
#define DEBUG_REQUEST_VERBOSITY_MAX (DEBUG_REQUEST_VERBOSITY_HIGH)
-typedef void (DUMPDEBUG_PRINTF_FUNC)(const char *fmt, ...) __printf(1, 2);
-
-extern DUMPDEBUG_PRINTF_FUNC *g_pfnDumpDebugPrintf;
+typedef void (DUMPDEBUG_PRINTF_FUNC)(void *pvDumpDebugFile, const char *fmt, ...) __printf(2, 3);
typedef void (*PFN_CMDCOMP_NOTIFY)(void *hCmdCompHandle);
enum PVRSRV_ERROR PVRSRVRegisterCmdCompleteNotify(void **phNotify,
@@ -103,7 +101,8 @@ enum PVRSRV_ERROR PVRSRVRegisterCmdCompleteNotify(void **phNotify,
enum PVRSRV_ERROR PVRSRVUnregisterCmdCompleteNotify(void *hNotify);
typedef void (*PFN_DBGREQ_NOTIFY) (void *hDebugRequestHandle,
- __u32 ui32VerbLevel);
+ __u32 ui32VerbLevel,
+ DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf, void *pvDumpDebugFile);
enum PVRSRV_ERROR PVRSRVRegisterDbgRequestNotify(void **phNotify,
PFN_DBGREQ_NOTIFY pfnDbgRequestNotify,
__u32 ui32RequesterID, void *hDbgReqeustHandle);