From: Imre Deak Date: Fri, 15 Oct 2010 17:25:43 +0000 (+0300) Subject: gpu: pvr: wire in the dynamic power-down delay calculation X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=255eee64c2fca0685ea0f8fbd0efae2e6e8c8d42;p=sgx.git gpu: pvr: wire in the dynamic power-down delay calculation Support for this was added in the previous patch. We're considering only the TA/3D and 2D blit commands to be part of a command burst. The rest of the commands are power management related and we can ignore them when detecting repeated burst patterns. Fixes: NB#195379 - SGX sleep causes performance penalty Signed-off-by: Imre Deak Reviewed-by: Luc Verhaegen --- diff --git a/pvr/sgxkick.c b/pvr/sgxkick.c index 3232526..045de0f 100644 --- a/pvr/sgxkick.c +++ b/pvr/sgxkick.c @@ -410,6 +410,9 @@ enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, struct SGX_CCB_KICK *psCCBKick, } #endif + /* to aid in determining the next power down delay */ + sgx_mark_new_command(psDeviceNode); + eError = SGXScheduleCCBCommandKM(hDevHandle, psCCBKick->eCommand, &psCCBKick->sCommand, KERNEL_ID, 0); if (eError == PVRSRV_ERROR_RETRY) { diff --git a/pvr/sgxpower.c b/pvr/sgxpower.c index 092ddfa..899613f 100644 --- a/pvr/sgxpower.c +++ b/pvr/sgxpower.c @@ -198,7 +198,7 @@ static void SGXGetTimingInfo(struct PVRSRV_DEVICE_NODE *psDeviceNode) sSGXTimingInfo.ui32uKernelFreq; sgx_set_pwrdown_delay(psDeviceNode, sSGXTimingInfo.ui32uKernelFreq, - sSGXTimingInfo.ui32ActivePowManLatencyms); + sgx_calc_power_down_delay(psDeviceNode)); } void SGXStartTimer(struct PVRSRV_SGXDEV_INFO *psDevInfo, IMG_BOOL bStartOSTimer) diff --git a/pvr/sgxtransfer.c b/pvr/sgxtransfer.c index 6cc159e..410b97e 100644 --- a/pvr/sgxtransfer.c +++ b/pvr/sgxtransfer.c @@ -241,6 +241,9 @@ enum PVRSRV_ERROR SGXSubmitTransferKM(void *hDevHandle, sCommand.ui32Data[0] = PVRSRV_CCBFLAGS_TRANSFERCMD; sCommand.ui32Data[1] = psKick->sHWTransferContextDevVAddr.uiAddr; + /* To aid in determining the next power down delay */ + sgx_mark_new_command(hDevHandle); + eError = SGXScheduleCCBCommandKM(hDevHandle, SGXMKIF_COMMAND_EDM_KICK, &sCommand, KERNEL_ID, psKick->ui32PDumpFlags); diff --git a/pvr/sgxutils.c b/pvr/sgxutils.c index ba14487..b92d502 100644 --- a/pvr/sgxutils.c +++ b/pvr/sgxutils.c @@ -51,6 +51,9 @@ static void SGXPostActivePowerEvent(struct PVRSRV_DEVICE_NODE *psDeviceNode) psDevInfo->psSGXHostCtl; u32 l; + /* To aid in calculating the next power down delay */ + sgx_mark_power_down(psDeviceNode); + l = readl(&psSGXHostCtl->ui32NumActivePowerEvents); l++; writel(l, &psSGXHostCtl->ui32NumActivePowerEvents);