aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-03-07 20:28:56 -0500
committerInki Dae <inki.dae@samsung.com>2012-03-14 22:38:59 -0400
commit0d8ce3ae37e9bcfacbbc750cabf892fa00bb720e (patch)
tree8799f2509f1a7081dfce5394a1db84e86aa25aba /drivers/gpu
parent9866b6c64b317a92e5c020165bc41efd3008a88a (diff)
drm/exynos: fix runtime_pm fimd device state on probe
A call to pm_runtime_set_active() forces device to be at the active state and skips calling its runtime suspend/resume callbacks. This results in a freeze with a new power domain code based on gen_pd. Fimd driver does all required runtime power management calls, so this pm_runtime_set_active call is buggy. This patch removes it and corrects clock management in probe function (clocks are now enabled by pm_runtime_get_sync() call). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 360adf2bba04..56458eea0501 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -817,8 +817,6 @@ static int __devinit fimd_probe(struct platform_device *pdev)
817 goto err_clk_get; 817 goto err_clk_get;
818 } 818 }
819 819
820 clk_enable(ctx->bus_clk);
821
822 ctx->lcd_clk = clk_get(dev, "sclk_fimd"); 820 ctx->lcd_clk = clk_get(dev, "sclk_fimd");
823 if (IS_ERR(ctx->lcd_clk)) { 821 if (IS_ERR(ctx->lcd_clk)) {
824 dev_err(dev, "failed to get lcd clock\n"); 822 dev_err(dev, "failed to get lcd clock\n");
@@ -826,8 +824,6 @@ static int __devinit fimd_probe(struct platform_device *pdev)
826 goto err_bus_clk; 824 goto err_bus_clk;
827 } 825 }
828 826
829 clk_enable(ctx->lcd_clk);
830
831 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 827 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
832 if (!res) { 828 if (!res) {
833 dev_err(dev, "failed to find registers\n"); 829 dev_err(dev, "failed to find registers\n");
@@ -864,17 +860,11 @@ static int __devinit fimd_probe(struct platform_device *pdev)
864 goto err_req_irq; 860 goto err_req_irq;
865 } 861 }
866 862
867 ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing);
868 ctx->vidcon0 = pdata->vidcon0; 863 ctx->vidcon0 = pdata->vidcon0;
869 ctx->vidcon1 = pdata->vidcon1; 864 ctx->vidcon1 = pdata->vidcon1;
870 ctx->default_win = pdata->default_win; 865 ctx->default_win = pdata->default_win;
871 ctx->panel = panel; 866 ctx->panel = panel;
872 867
873 panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
874
875 DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n",
876 panel->timing.pixclock, ctx->clkdiv);
877
878 subdrv = &ctx->subdrv; 868 subdrv = &ctx->subdrv;
879 869
880 subdrv->probe = fimd_subdrv_probe; 870 subdrv->probe = fimd_subdrv_probe;
@@ -889,10 +879,15 @@ static int __devinit fimd_probe(struct platform_device *pdev)
889 879
890 platform_set_drvdata(pdev, ctx); 880 platform_set_drvdata(pdev, ctx);
891 881
892 pm_runtime_set_active(dev);
893 pm_runtime_enable(dev); 882 pm_runtime_enable(dev);
894 pm_runtime_get_sync(dev); 883 pm_runtime_get_sync(dev);
895 884
885 ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing);
886 panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
887
888 DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n",
889 panel->timing.pixclock, ctx->clkdiv);
890
896 for (win = 0; win < WINDOWS_NR; win++) 891 for (win = 0; win < WINDOWS_NR; win++)
897 fimd_clear_win(ctx, win); 892 fimd_clear_win(ctx, win);
898 893