gpu: pvr: wire in the dynamic power-down delay calculation
authorImre Deak <imre.deak@nokia.com>
Fri, 15 Oct 2010 17:25:43 +0000 (20:25 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
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 <imre.deak@nokia.com>
Reviewed-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
pvr/sgxkick.c
pvr/sgxpower.c
pvr/sgxtransfer.c
pvr/sgxutils.c

index 3232526..045de0f 100644 (file)
@@ -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) {
index 092ddfa..899613f 100644 (file)
@@ -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)
index 6cc159e..410b97e 100644 (file)
@@ -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);
index ba14487..b92d502 100644 (file)
@@ -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);