We need the GPU to stay awake for this.

Signed-off-by: Rob Clark <[email protected]>
---
 drivers/gpu/drm/msm/msm_debugfs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/msm/msm_debugfs.c 
b/drivers/gpu/drm/msm/msm_debugfs.c
index f12701e286ec..f068315541e8 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -86,7 +86,17 @@ static int msm_gpu_open(struct inode *inode, struct file 
*file)
 
        pm_runtime_get_sync(&gpu->pdev->dev);
        msm_gpu_hw_init(gpu);
+
+       /* Inhibit IFPC while accessing registers: */
+       if (gpu->funcs->sysprof_setup)
+               gpu->funcs->sysprof_setup(gpu, true);
+
        show_priv->state = gpu->funcs->gpu_state_get(gpu);
+
+       /* Re-enable IFPC: */
+       if (gpu->funcs->sysprof_setup)
+               gpu->funcs->sysprof_setup(gpu, false);
+
        pm_runtime_put_sync(&gpu->pdev->dev);
 
        mutex_unlock(&gpu->lock);
-- 
2.56.0

Reply via email to