drm/msm/gpu: Increase the pm runtime autosuspend for 5xx
authorJordan Crouse <jcrouse@codeaurora.org>
Mon, 7 May 2018 22:47:50 +0000 (16:47 -0600)
committerRob Clark <robdclark@gmail.com>
Wed, 25 Jul 2018 11:51:04 +0000 (07:51 -0400)
Experimentation shows that resuming power quickly after suspending
ends up forcing a system hang for unknown reasons on 5xx targets.
To avoid cycling the power too much (especially during init)
turn up the autosuspend time for a5xx to 250ms and use
pm_runtime_put_autosuspend() when applicable.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/adreno_device.c
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/adreno/adreno_gpu.h

index 01d4e09..4481362 100644 (file)
@@ -35,6 +35,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a300_pfp.fw",
                },
                .gmem  = SZ_256K,
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a3xx_gpu_init,
        }, {
                .rev   = ADRENO_REV(3, 0, 6, 0),
@@ -45,6 +46,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a300_pfp.fw",
                },
                .gmem  = SZ_128K,
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a3xx_gpu_init,
        }, {
                .rev   = ADRENO_REV(3, 2, ANY_ID, ANY_ID),
@@ -55,6 +57,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a300_pfp.fw",
                },
                .gmem  = SZ_512K,
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a3xx_gpu_init,
        }, {
                .rev   = ADRENO_REV(3, 3, 0, ANY_ID),
@@ -65,6 +68,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a330_pfp.fw",
                },
                .gmem  = SZ_1M,
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a3xx_gpu_init,
        }, {
                .rev   = ADRENO_REV(4, 2, 0, ANY_ID),
@@ -75,6 +79,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a420_pfp.fw",
                },
                .gmem  = (SZ_1M + SZ_512K),
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a4xx_gpu_init,
        }, {
                .rev   = ADRENO_REV(4, 3, 0, ANY_ID),
@@ -85,6 +90,7 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_PFP] = "a420_pfp.fw",
                },
                .gmem  = (SZ_1M + SZ_512K),
+               .inactive_period = DRM_MSM_INACTIVE_PERIOD,
                .init  = a4xx_gpu_init,
        }, {
                .rev = ADRENO_REV(5, 3, 0, 2),
@@ -96,6 +102,11 @@ static const struct adreno_info gpulist[] = {
                        [ADRENO_FW_GPMU] = "a530v3_gpmu.fw2",
                },
                .gmem = SZ_1M,
+               /*
+                * Increase inactive period to 250 to avoid bouncing
+                * the GDSC which appears to make it grumpy
+                */
+               .inactive_period = 250,
                .quirks = ADRENO_QUIRK_TWO_PASS_USE_WFI |
                        ADRENO_QUIRK_FAULT_DETECT_MASK,
                .init = a5xx_gpu_init,
@@ -158,7 +169,7 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
        mutex_lock(&dev->struct_mutex);
        ret = msm_gpu_hw_init(gpu);
        mutex_unlock(&dev->struct_mutex);
-       pm_runtime_put_sync(&pdev->dev);
+       pm_runtime_put_autosuspend(&pdev->dev);
        if (ret) {
                dev_err(dev->dev, "gpu hw init failed: %d\n", ret);
                return NULL;
index 17d0506..bcbf9f2 100644 (file)
@@ -565,7 +565,8 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 
        adreno_get_pwrlevels(&pdev->dev, gpu);
 
-       pm_runtime_set_autosuspend_delay(&pdev->dev, DRM_MSM_INACTIVE_PERIOD);
+       pm_runtime_set_autosuspend_delay(&pdev->dev,
+               adreno_gpu->info->inactive_period);
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_enable(&pdev->dev);
 
index d6b0e7b..bc9ec27 100644 (file)
@@ -84,6 +84,7 @@ struct adreno_info {
        enum adreno_quirks quirks;
        struct msm_gpu *(*init)(struct drm_device *dev);
        const char *zapfw;
+       u32 inactive_period;
 };
 
 const struct adreno_info *adreno_info(struct adreno_rev rev);