drm/vc4: Use runtime autosuspend to avoid thrashing V3D power state.

The pm_runtime_put() we were using immediately released power on the
device, which meant that we were generally turning the device off and
on once per frame.  In many profiles I've looked at, that added up to
about 1% of CPU time, but this could get worse in the case of frequent
rendering and readback (as may happen in X rendering).  By keeping the
device on until we've been idle for a couple of frames, we drop the
overhead of runtime PM down to sub-.1%.

Signed-off-by: Eric Anholt <eric@anholt.net>
此提交包含在:
Eric Anholt
2016-11-04 15:58:38 -07:00
父節點 7154d76fed
當前提交 3a62234680
共有 3 個檔案被更改,包括 12 行新增5 行删除

查看文件

@@ -709,8 +709,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
}
mutex_lock(&vc4->power_lock);
if (--vc4->power_refcount == 0)
pm_runtime_put(&vc4->v3d->pdev->dev);
if (--vc4->power_refcount == 0) {
pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev);
pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev);
}
mutex_unlock(&vc4->power_lock);
kfree(exec);