]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/msm: fix bus scaling
authorRob Clark <robdclark@gmail.com>
Fri, 15 Nov 2013 14:03:15 +0000 (09:03 -0500)
committerRob Clark <robdclark@gmail.com>
Thu, 9 Jan 2014 19:38:58 +0000 (14:38 -0500)
This got a bit broken with original patches when re-arranging things to
move dependencies on mach-msm inside #ifndef OF.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/a3xx_gpu.c
drivers/gpu/drm/msm/adreno/adreno_gpu.h
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_gpu.h

index 035bd13dc8bdc3ab039bc2f1bab291cbf4c9bf17..d9e72a60080cc80e2789466d5fafea882bfa27ac 100644 (file)
@@ -414,6 +414,9 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
        gpu->fast_rate = config->fast_rate;
        gpu->slow_rate = config->slow_rate;
        gpu->bus_freq  = config->bus_freq;
+#ifdef CONFIG_MSM_BUS_SCALING
+       gpu->bus_scale_table = config->bus_scale_table;
+#endif
 
        DBG("fast_rate=%u, slow_rate=%u, bus_freq=%u",
                        gpu->fast_rate, gpu->slow_rate, gpu->bus_freq);
@@ -436,12 +439,17 @@ fail:
  * The a3xx device:
  */
 
+#if defined(CONFIG_MSM_BUS_SCALING) && !defined(CONFIG_OF)
+#  include <mach/kgsl.h>
+#endif
+
 static int a3xx_probe(struct platform_device *pdev)
 {
        static struct adreno_platform_config config = {};
 #ifdef CONFIG_OF
        /* TODO */
 #else
+       struct kgsl_device_platform_data *pdata = pdev->dev.platform_data;
        uint32_t version = socinfo_get_version();
        if (cpu_is_apq8064ab()) {
                config.fast_rate = 450000000;
@@ -473,6 +481,9 @@ static int a3xx_probe(struct platform_device *pdev)
                        config.rev = ADRENO_REV(3, 0, 5, 0);
 
        }
+#  ifdef CONFIG_MSM_BUS_SCALING
+       config.bus_scale_table = pdata->bus_scale_table;
+#  endif
 #endif
        pdev->dev.platform_data = &config;
        a3xx_pdev = pdev;
index f73abfba7c22eb03b4aa0c7f1e962ade219edf1f..451b741fbd1272f8d8ab52007f7826c77ea3459f 100644 (file)
@@ -70,6 +70,9 @@ struct adreno_gpu {
 struct adreno_platform_config {
        struct adreno_rev rev;
        uint32_t fast_rate, slow_rate, bus_freq;
+#ifdef CONFIG_MSM_BUS_SCALING
+       struct msm_bus_scale_pdata *bus_scale_table;
+#endif
 };
 
 #define ADRENO_IDLE_TIMEOUT (20 * 1000)
index 4583d61556f5bed5c7d9cf9d26988d1160ddb386..71f105f0d8976c91c04dc31cdaf7f2b46dd5bd4f 100644 (file)
 
 #ifdef CONFIG_MSM_BUS_SCALING
 #include <mach/board.h>
-#include <mach/kgsl.h>
-static void bs_init(struct msm_gpu *gpu, struct platform_device *pdev)
+static void bs_init(struct msm_gpu *gpu)
 {
-       struct drm_device *dev = gpu->dev;
-       struct kgsl_device_platform_data *pdata;
-
-       if (!pdev) {
-               dev_err(dev->dev, "could not find dtv pdata\n");
-               return;
-       }
-
-       pdata = pdev->dev.platform_data;
-       if (pdata->bus_scale_table) {
-               gpu->bsc = msm_bus_scale_register_client(pdata->bus_scale_table);
+       if (gpu->bus_scale_table) {
+               gpu->bsc = msm_bus_scale_register_client(gpu->bus_scale_table);
                DBG("bus scale client: %08x", gpu->bsc);
        }
 }
@@ -59,7 +49,7 @@ static void bs_set(struct msm_gpu *gpu, int idx)
        }
 }
 #else
-static void bs_init(struct msm_gpu *gpu, struct platform_device *pdev) {}
+static void bs_init(struct msm_gpu *gpu) {}
 static void bs_fini(struct msm_gpu *gpu) {}
 static void bs_set(struct msm_gpu *gpu, int idx) {}
 #endif
@@ -452,7 +442,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
                goto fail;
        }
 
-       bs_init(gpu, pdev);
+       bs_init(gpu);
 
        return 0;
 
index 8cd829e520bb84b6bfa10d90fce8236cf9fbd3c5..08d08420cbcc6e99c6ca396a3641811ee50eee00 100644 (file)
@@ -85,7 +85,11 @@ struct msm_gpu {
        struct regulator *gpu_reg, *gpu_cx;
        struct clk *ebi1_clk, *grp_clks[5];
        uint32_t fast_rate, slow_rate, bus_freq;
+
+#ifdef CONFIG_MSM_BUS_SCALING
+       struct msm_bus_scale_pdata *bus_scale_table;
        uint32_t bsc;
+#endif
 
        /* Hang Detction: */
 #define DRM_MSM_HANGCHECK_PERIOD 500 /* in ms */