aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-01-30 11:15:14 -0500
committerRob Clark <robdclark@gmail.com>2017-02-06 11:28:42 -0500
commit4e09b95d72e502e200ad0f509fe89fb852add173 (patch)
tree1d2b65f6d63fee1d9426d8e06962417096a5fc8c /drivers/gpu
parent1db7afa4914642146637f891c9d369948bb026c7 (diff)
drm/msm: drop quirks binding
This was never documented or used in upstream dtb. It is used by downstream bindings from android device kernels. But the quirks are a property of the gpu revision, and as such are redundant to be listed separately in dt. Instead, move the quirks to the device table. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/adreno/a5xx_gpu.c4
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_device.c18
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c1
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.h4
4 files changed, 7 insertions, 20 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index b8647198c11c..8308bb8166c8 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -327,7 +327,7 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
327 /* Enable RBBM error reporting bits */ 327 /* Enable RBBM error reporting bits */
328 gpu_write(gpu, REG_A5XX_RBBM_AHB_CNTL0, 0x00000001); 328 gpu_write(gpu, REG_A5XX_RBBM_AHB_CNTL0, 0x00000001);
329 329
330 if (adreno_gpu->quirks & ADRENO_QUIRK_FAULT_DETECT_MASK) { 330 if (adreno_gpu->info->quirks & ADRENO_QUIRK_FAULT_DETECT_MASK) {
331 /* 331 /*
332 * Mask out the activity signals from RB1-3 to avoid false 332 * Mask out the activity signals from RB1-3 to avoid false
333 * positives 333 * positives
@@ -381,7 +381,7 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
381 381
382 gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, (0x400 << 11 | 0x300 << 22)); 382 gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, (0x400 << 11 | 0x300 << 22));
383 383
384 if (adreno_gpu->quirks & ADRENO_QUIRK_TWO_PASS_USE_WFI) 384 if (adreno_gpu->info->quirks & ADRENO_QUIRK_TWO_PASS_USE_WFI)
385 gpu_rmw(gpu, REG_A5XX_PC_DBG_ECO_CNTL, 0, (1 << 8)); 385 gpu_rmw(gpu, REG_A5XX_PC_DBG_ECO_CNTL, 0, (1 << 8));
386 386
387 gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, 0xc0200100); 387 gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, 0xc0200100);
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 5fa51a9abc20..ece39b16a864 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -75,12 +75,14 @@ static const struct adreno_info gpulist[] = {
75 .gmem = (SZ_1M + SZ_512K), 75 .gmem = (SZ_1M + SZ_512K),
76 .init = a4xx_gpu_init, 76 .init = a4xx_gpu_init,
77 }, { 77 }, {
78 .rev = ADRENO_REV(5, 3, 0, ANY_ID), 78 .rev = ADRENO_REV(5, 3, 0, 2),
79 .revn = 530, 79 .revn = 530,
80 .name = "A530", 80 .name = "A530",
81 .pm4fw = "a530_pm4.fw", 81 .pm4fw = "a530_pm4.fw",
82 .pfpfw = "a530_pfp.fw", 82 .pfpfw = "a530_pfp.fw",
83 .gmem = SZ_1M, 83 .gmem = SZ_1M,
84 .quirks = ADRENO_QUIRK_TWO_PASS_USE_WFI |
85 ADRENO_QUIRK_FAULT_DETECT_MASK,
84 .init = a5xx_gpu_init, 86 .init = a5xx_gpu_init,
85 .gpmufw = "a530v3_gpmu.fw2", 87 .gpmufw = "a530v3_gpmu.fw2",
86 }, 88 },
@@ -181,14 +183,6 @@ static void set_gpu_pdev(struct drm_device *dev,
181 priv->gpu_pdev = pdev; 183 priv->gpu_pdev = pdev;
182} 184}
183 185
184static const struct {
185 const char *str;
186 uint32_t flag;
187} quirks[] = {
188 { "qcom,gpu-quirk-two-pass-use-wfi", ADRENO_QUIRK_TWO_PASS_USE_WFI },
189 { "qcom,gpu-quirk-fault-detect-mask", ADRENO_QUIRK_FAULT_DETECT_MASK },
190};
191
192static int find_chipid(struct device *dev, u32 *chipid) 186static int find_chipid(struct device *dev, u32 *chipid)
193{ 187{
194 struct device_node *node = dev->of_node; 188 struct device_node *node = dev->of_node;
@@ -231,7 +225,7 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
231 static struct adreno_platform_config config = {}; 225 static struct adreno_platform_config config = {};
232 struct device_node *child, *node = dev->of_node; 226 struct device_node *child, *node = dev->of_node;
233 u32 val; 227 u32 val;
234 int ret, i; 228 int ret;
235 229
236 ret = find_chipid(dev, &val); 230 ret = find_chipid(dev, &val);
237 if (ret) { 231 if (ret) {
@@ -267,10 +261,6 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
267 config.slow_rate = 27000000; 261 config.slow_rate = 27000000;
268 } 262 }
269 263
270 for (i = 0; i < ARRAY_SIZE(quirks); i++)
271 if (of_property_read_bool(node, quirks[i].str))
272 config.quirks |= quirks[i].flag;
273
274 dev->platform_data = &config; 264 dev->platform_data = &config;
275 set_gpu_pdev(dev_get_drvdata(master), to_platform_device(dev)); 265 set_gpu_pdev(dev_get_drvdata(master), to_platform_device(dev));
276 return 0; 266 return 0;
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 686a580c711a..c9bd1e6225f4 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -352,7 +352,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
352 adreno_gpu->gmem = adreno_gpu->info->gmem; 352 adreno_gpu->gmem = adreno_gpu->info->gmem;
353 adreno_gpu->revn = adreno_gpu->info->revn; 353 adreno_gpu->revn = adreno_gpu->info->revn;
354 adreno_gpu->rev = config->rev; 354 adreno_gpu->rev = config->rev;
355 adreno_gpu->quirks = config->quirks;
356 355
357 gpu->fast_rate = config->fast_rate; 356 gpu->fast_rate = config->fast_rate;
358 gpu->slow_rate = config->slow_rate; 357 gpu->slow_rate = config->slow_rate;
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index e8d55b0306ed..42e444a67630 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -75,6 +75,7 @@ struct adreno_info {
75 const char *pm4fw, *pfpfw; 75 const char *pm4fw, *pfpfw;
76 const char *gpmufw; 76 const char *gpmufw;
77 uint32_t gmem; 77 uint32_t gmem;
78 enum adreno_quirks quirks;
78 struct msm_gpu *(*init)(struct drm_device *dev); 79 struct msm_gpu *(*init)(struct drm_device *dev);
79}; 80};
80 81
@@ -116,8 +117,6 @@ struct adreno_gpu {
116 * code (a3xx_gpu.c) and stored in this common location. 117 * code (a3xx_gpu.c) and stored in this common location.
117 */ 118 */
118 const unsigned int *reg_offsets; 119 const unsigned int *reg_offsets;
119
120 uint32_t quirks;
121}; 120};
122#define to_adreno_gpu(x) container_of(x, struct adreno_gpu, base) 121#define to_adreno_gpu(x) container_of(x, struct adreno_gpu, base)
123 122
@@ -128,7 +127,6 @@ struct adreno_platform_config {
128#ifdef DOWNSTREAM_CONFIG_MSM_BUS_SCALING 127#ifdef DOWNSTREAM_CONFIG_MSM_BUS_SCALING
129 struct msm_bus_scale_pdata *bus_scale_table; 128 struct msm_bus_scale_pdata *bus_scale_table;
130#endif 129#endif
131 uint32_t quirks;
132}; 130};
133 131
134#define ADRENO_IDLE_TIMEOUT msecs_to_jiffies(1000) 132#define ADRENO_IDLE_TIMEOUT msecs_to_jiffies(1000)