aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>2016-09-27 11:59:56 -0400
committerInki Dae <daeinki@gmail.com>2016-09-30 11:39:41 -0400
commit7c3fc2b5ccd6694b48c2226704e25fad7acc6976 (patch)
treeb89c925019ddede78201dedc81eb30346d31c219
parent134a0fe98471b2e15a2b1bc22f4bddbb98bd6e18 (diff)
drm/exynos: g2d: use autosuspend mode for PM runtime
The runqueue worker currently issues a get() when a new node is processed, and a put() once a node is completed. The corresponding suspend and resume calls currently only do clock gating, but with the upcoming introduction of IOMMU runpm also the corresponding IOMMU domain gets enabled (for get()) and disabled (for put()). This introduces performance regressions with we mitigate here. Switch PM runtime to autosuspend, such that clock gating and IOMMU control only happens when the engine is idle for a 'long' time. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 94fb9d2f90c1..1f0bcff69737 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -903,7 +903,8 @@ static void g2d_runqueue_worker(struct work_struct *work)
903 g2d->runqueue_node = NULL; 903 g2d->runqueue_node = NULL;
904 904
905 if (runqueue_node) { 905 if (runqueue_node) {
906 pm_runtime_put(g2d->dev); 906 pm_runtime_mark_last_busy(g2d->dev);
907 pm_runtime_put_autosuspend(g2d->dev);
907 908
908 complete(&runqueue_node->complete); 909 complete(&runqueue_node->complete);
909 if (runqueue_node->async) 910 if (runqueue_node->async)
@@ -1022,7 +1023,8 @@ static void g2d_wait_finish(struct g2d_data *g2d, struct drm_file *file)
1022 * the IRQ which triggers the PM runtime put(). 1023 * the IRQ which triggers the PM runtime put().
1023 * So do this manually here. 1024 * So do this manually here.
1024 */ 1025 */
1025 pm_runtime_put(dev); 1026 pm_runtime_mark_last_busy(dev);
1027 pm_runtime_put_autosuspend(dev);
1026 1028
1027 complete(&runqueue_node->complete); 1029 complete(&runqueue_node->complete);
1028 if (runqueue_node->async) 1030 if (runqueue_node->async)
@@ -1519,6 +1521,8 @@ static int g2d_probe(struct platform_device *pdev)
1519 goto err_destroy_workqueue; 1521 goto err_destroy_workqueue;
1520 } 1522 }
1521 1523
1524 pm_runtime_use_autosuspend(dev);
1525 pm_runtime_set_autosuspend_delay(dev, 2000);
1522 pm_runtime_enable(dev); 1526 pm_runtime_enable(dev);
1523 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags); 1527 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
1524 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags); 1528 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
@@ -1590,6 +1594,7 @@ static int g2d_remove(struct platform_device *pdev)
1590 /* There should be no locking needed here. */ 1594 /* There should be no locking needed here. */
1591 g2d_remove_runqueue_nodes(g2d, NULL); 1595 g2d_remove_runqueue_nodes(g2d, NULL);
1592 1596
1597 pm_runtime_dont_use_autosuspend(&pdev->dev);
1593 pm_runtime_disable(&pdev->dev); 1598 pm_runtime_disable(&pdev->dev);
1594 1599
1595 g2d_fini_cmdlist(g2d); 1600 g2d_fini_cmdlist(g2d);