aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gpu.c')
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 10babd18e286..372fafc76f3e 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -92,6 +92,25 @@ static struct devfreq_dev_profile msm_devfreq_profile = {
.get_cur_freq = msm_devfreq_get_cur_freq,
};
+static int bs_init(struct msm_gpu *gpu)
+{
+ gpu->path = of_icc_get(&gpu->pdev->dev, "gfx");
+ if (IS_ERR(gpu->path))
+ return PTR_ERR(gpu->path);
+
+ return 0;
+}
+
+static void bs_set(struct msm_gpu *gpu, int idx)
+{
+ u32 peak_bw = 0;
+
+ if (idx > 0)
+ peak_bw = 14432000;
+
+ icc_set_bw(gpu->path, 0, kBps_to_icc(peak_bw));
+}
+
static void msm_devfreq_init(struct msm_gpu *gpu)
{
/* We need target support to do devfreq */
@@ -183,6 +202,7 @@ static int enable_axi(struct msm_gpu *gpu)
{
if (gpu->ebi1_clk)
clk_prepare_enable(gpu->ebi1_clk);
+ bs_set(gpu, 1);
return 0;
}
@@ -190,6 +210,7 @@ static int disable_axi(struct msm_gpu *gpu)
{
if (gpu->ebi1_clk)
clk_disable_unprepare(gpu->ebi1_clk);
+ bs_set(gpu, 0);
return 0;
}
@@ -879,6 +900,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
gpu->num_perfcntrs = ARRAY_SIZE(gpu->last_cntrs);
gpu->dev = drm;
+ gpu->pdev = pdev;
gpu->funcs = funcs;
gpu->name = name;
@@ -918,6 +940,10 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (ret)
goto fail;
+ ret = bs_init(gpu);
+ if (ret)
+ goto fail;
+
gpu->ebi1_clk = msm_clk_get(pdev, "bus");
DBG("ebi1_clk: %p", gpu->ebi1_clk);
if (IS_ERR(gpu->ebi1_clk))
@@ -934,7 +960,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (IS_ERR(gpu->gpu_cx))
gpu->gpu_cx = NULL;
- gpu->pdev = pdev;
platform_set_drvdata(pdev, gpu);
msm_devfreq_init(gpu);