summaryrefslogtreecommitdiffstats
path: root/pvr-source/services4/srvkm/devices
diff options
context:
space:
mode:
Diffstat (limited to 'pvr-source/services4/srvkm/devices')
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxinfokm.h4
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxinit.c13
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxkick.c19
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxpower.c34
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxutils.c14
5 files changed, 67 insertions, 17 deletions
diff --git a/pvr-source/services4/srvkm/devices/sgx/sgxinfokm.h b/pvr-source/services4/srvkm/devices/sgx/sgxinfokm.h
index 125da09..b143347 100644
--- a/pvr-source/services4/srvkm/devices/sgx/sgxinfokm.h
+++ b/pvr-source/services4/srvkm/devices/sgx/sgxinfokm.h
@@ -155,10 +155,6 @@ typedef struct _PVRSRV_SGXDEV_INFO_
#if defined(FIX_HW_BRN_29823)
PPVRSRV_KERNEL_MEM_INFO psKernelDummyTermStreamMemInfo; /*!< Meminfo for dummy terminate stream */
#endif
-#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31559)
- PPVRSRV_KERNEL_MEM_INFO psKernelVDMSnapShotBufferMemInfo; /*!< Meminfo for dummy snapshot buffer */
- PPVRSRV_KERNEL_MEM_INFO psKernelVDMCtrlStreamBufferMemInfo; /*!< Meminfo for dummy control stream */
-#endif
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && \
defined(FIX_HW_BRN_33657) && defined(SUPPORT_SECURE_33657_FIX)
PPVRSRV_KERNEL_MEM_INFO psKernelVDMStateUpdateBufferMemInfo; /*!< Meminfo for state update buffer */
diff --git a/pvr-source/services4/srvkm/devices/sgx/sgxinit.c b/pvr-source/services4/srvkm/devices/sgx/sgxinit.c
index 199aa9d..cc86c4f 100644
--- a/pvr-source/services4/srvkm/devices/sgx/sgxinit.c
+++ b/pvr-source/services4/srvkm/devices/sgx/sgxinit.c
@@ -68,6 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "srvkm.h"
#include "ttrace.h"
+IMG_UINT32 g_ui32HostIRQCountSample = 0;
extern int powering_down;
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
@@ -243,10 +244,6 @@ static PVRSRV_ERROR InitDevInfo(PVRSRV_PER_PROCESS_DATA *psPerProc,
#if defined(FIX_HW_BRN_29823)
psDevInfo->psKernelDummyTermStreamMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelDummyTermStreamMemInfo;
#endif
-#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31559)
- psDevInfo->psKernelVDMSnapShotBufferMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelVDMSnapShotBufferMemInfo;
- psDevInfo->psKernelVDMCtrlStreamBufferMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelVDMCtrlStreamBufferMemInfo;
-#endif
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && \
defined(FIX_HW_BRN_33657) && defined(SUPPORT_SECURE_33657_FIX)
psDevInfo->psKernelVDMStateUpdateBufferMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelVDMStateUpdateBufferMemInfo;
@@ -1884,11 +1881,17 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
/* Clear master interrupt bit */
ui32EventClear |= EUR_CR_EVENT_HOST_CLEAR_MASTER_INTERRUPT_MASK;
+ /* clear the events */
if(!powering_down) {
- /* clear the events */
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear);
OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR2, ui32EventClear2);
}
+
+ /*
+ Sample the current count from the uKernel _after_ we've cleared the
+ interrupt.
+ */
+ g_ui32HostIRQCountSample = psDevInfo->psSGXHostCtl->ui32InterruptCount;
}
}
diff --git a/pvr-source/services4/srvkm/devices/sgx/sgxkick.c b/pvr-source/services4/srvkm/devices/sgx/sgxkick.c
index 584f538..a40bb9e 100644
--- a/pvr-source/services4/srvkm/devices/sgx/sgxkick.c
+++ b/pvr-source/services4/srvkm/devices/sgx/sgxkick.c
@@ -645,6 +645,25 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
MAKEUNIQUETAG(psCCBMemInfo));
}
+ if (psCCBKick->hTA3DSyncInfo != IMG_NULL)
+ {
+ psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
+
+ PDUMPCOMMENT("Modify TA/3D dependency WOpPendingVal\r\n");
+
+ PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
+ psCCBMemInfo,
+ psCCBKick->ui32CCBDumpWOff + offsetof(SGXMKIF_CMDTA_SHARED, sTA3DDependency.ui32WriteOpsPendingVal),
+ sizeof(IMG_UINT32),
+ 0,
+ MAKEUNIQUETAG(psCCBMemInfo));
+
+ if (psCCBKick->bTADependency)
+ {
+ psSyncInfo->psSyncData->ui32LastOpDumpVal++;
+ }
+ }
+
if (psCCBKick->hTASyncInfo != IMG_NULL)
{
psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTASyncInfo;
diff --git a/pvr-source/services4/srvkm/devices/sgx/sgxpower.c b/pvr-source/services4/srvkm/devices/sgx/sgxpower.c
index 2acd28d..034deab 100644
--- a/pvr-source/services4/srvkm/devices/sgx/sgxpower.c
+++ b/pvr-source/services4/srvkm/devices/sgx/sgxpower.c
@@ -48,9 +48,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sgxutils.h"
#include "pdump_km.h"
+extern IMG_UINT32 g_ui32HostIRQCountSample;
int powering_down = 0;
-
#if defined(SUPPORT_HW_RECOVERY)
static PVRSRV_ERROR SGXAddTimer(PVRSRV_DEVICE_NODE *psDeviceNode,
SGX_TIMING_INFORMATION *psSGXTimingInfo,
@@ -359,7 +359,11 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE hDevHandle,
}
#endif /* NO_HARDWARE */
- psDevInfo->bSGXIdle = IMG_TRUE;
+ if (psDevInfo->bSGXIdle == IMG_FALSE)
+ {
+ psDevInfo->bSGXIdle = IMG_TRUE;
+ SysSGXIdleEntered();
+ }
#if defined(PDUMP)
PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel.");
@@ -372,6 +376,20 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE hDevHandle,
MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
#endif /* PDUMP */
+ /* Wait for the pending ukernel to host interrupts to come back. */
+ #if !defined(NO_HARDWARE)
+ if (PollForValueKM(&g_ui32HostIRQCountSample,
+ psDevInfo->psSGXHostCtl->ui32InterruptCount,
+ 0xffffffff,
+ MAX_HW_TIME_US,
+ MAX_HW_TIME_US/WAIT_TRY_COUNT,
+ IMG_FALSE) != PVRSRV_OK)
+ {
+ PVR_DPF((PVR_DBG_ERROR,"SGXPrePowerState: Wait for pending interrupts failed."));
+ SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
+ PVR_DBG_BREAK;
+ }
+ #endif /* NO_HARDWARE */
#if defined(SGX_FEATURE_MP)
ui32CoresEnabled = ((OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE) & EUR_CR_MASTER_CORE_ENABLE_MASK) >> EUR_CR_MASTER_CORE_ENABLE_SHIFT) + 1;
#else
@@ -548,6 +566,18 @@ PVRSRV_ERROR SGXPreClockSpeedChange (IMG_HANDLE hDevHandle,
return eError;
}
}
+ else
+ {
+ #if defined(SUPPORT_HW_RECOVERY)
+ PVRSRV_ERROR eError;
+
+ eError = OSDisableTimer(psDevInfo->hTimer);
+ if (eError != PVRSRV_OK)
+ {
+ PVR_DPF((PVR_DBG_ERROR,"SGXStartTimer : Failed to enable host timer"));
+ }
+ #endif /* SUPPORT_HW_RECOVERY */
+ }
}
PVR_DPF((PVR_DBG_MESSAGE,"SGXPreClockSpeedChange: SGX clock speed was %uHz",
diff --git a/pvr-source/services4/srvkm/devices/sgx/sgxutils.c b/pvr-source/services4/srvkm/devices/sgx/sgxutils.c
index 227675d..d5cb3c1 100644
--- a/pvr-source/services4/srvkm/devices/sgx/sgxutils.c
+++ b/pvr-source/services4/srvkm/devices/sgx/sgxutils.c
@@ -172,9 +172,11 @@ IMG_VOID SGXTestActivePowerEvent (PVRSRV_DEVICE_NODE *psDeviceNode,
((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_IDLE) != 0))
{
psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_IDLE;
- psDevInfo->bSGXIdle = IMG_TRUE;
-
- SysSGXIdleEntered();
+ if (psDevInfo->bSGXIdle == IMG_FALSE)
+ {
+ psDevInfo->bSGXIdle = IMG_TRUE;
+ SysSGXIdleEntered();
+ }
}
/*
@@ -709,9 +711,6 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode,
/* Note that a power-up has been dumped in the init phase. */
PDUMPSUSPEND();
- SysSGXCommandPending(psDevInfo->bSGXIdle);
- psDevInfo->bSGXIdle = IMG_FALSE;
-
/* Ensure that SGX is powered up before kicking the ukernel. */
eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex,
PVRSRV_DEV_POWER_STATE_ON);
@@ -729,6 +728,9 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode,
return eError;
}
+ SysSGXCommandPending(psDevInfo->bSGXIdle);
+ psDevInfo->bSGXIdle = IMG_FALSE;
+
eError = SGXScheduleCCBCommand(psDeviceNode, eCmdType, psCommandData, ui32CallerID, ui32PDumpFlags, hDevMemContext, bLastInScene);
PVRSRVPowerUnlock(ui32CallerID);