summaryrefslogtreecommitdiffstats
path: root/pvr-source/services4/srvkm/devices/sgx/sgxpower.c
diff options
context:
space:
mode:
authorHemant Hariyani <hemanthariyani@ti.com>2013-07-03 15:14:18 -0700
committerAndrew Jiang <sam.andrew.jiang@gmail.com>2013-07-04 07:33:40 -0400
commit363c0c259416c7e9d93ddf6ffcb655153bff9158 (patch)
treebf7fda0dfb7a4cbc33656c8b2b37000c13ad1cd0 /pvr-source/services4/srvkm/devices/sgx/sgxpower.c
parent08130d7fa7748feefb437ffb8f626dab7d75679e (diff)
downloaddevice_samsung_omap4-common-363c0c259416c7e9d93ddf6ffcb655153bff9158.zip
device_samsung_omap4-common-363c0c259416c7e9d93ddf6ffcb655153bff9158.tar.gz
device_samsung_omap4-common-363c0c259416c7e9d93ddf6ffcb655153bff9158.tar.bz2
SGX-BIN: DDK binaries and KM source 1.9@2291151
Includes new pixel formats. Change-Id: I4a56e6bff9c477610f2ce30706831f66dcc9c651
Diffstat (limited to 'pvr-source/services4/srvkm/devices/sgx/sgxpower.c')
-rw-r--r--pvr-source/services4/srvkm/devices/sgx/sgxpower.c34
1 files changed, 32 insertions, 2 deletions
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",