aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-12-05 17:39:53 -0500
committerRob Clark <robdclark@gmail.com>2014-01-09 14:44:06 -0500
commit55459968176f1319b5fe298420aa06347e3481a1 (patch)
tree4bdccb782c04d7f6762d7cdd6efa0f27797cc762
parent06c0dd96bfbba8a9368ffd7c4b12d3bfed37001d (diff)
drm/msm: add a330/apq8x74
Add support for adreno 330. Not too much different, just a few differences in initial configuration plus setting OCMEM base. Userspace support is already in upstream mesa. Note that the existing DT code is simply using the bindings from downstream android kernel, to simplify porting of this driver to existing devices. These do not constitute any committed/stable DT ABI. The addition of proper DT bindings will be a subsequent patch, at which point (as best as possible) I will try to support either upstream bindings or what is found in downstream android kernel, so that existing device DT files can be used. Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--drivers/gpu/drm/msm/adreno/a3xx_gpu.c148
-rw-r--r--drivers/gpu/drm/msm/adreno/a3xx_gpu.h4
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c7
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.h6
-rw-r--r--drivers/gpu/drm/msm/msm_iommu.c2
5 files changed, 144 insertions, 23 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
index f4aa815b690a..461df93e825e 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
@@ -15,6 +15,10 @@
15 * this program. If not, see <http://www.gnu.org/licenses/>. 15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18#ifdef CONFIG_MSM_OCMEM
19# include <mach/ocmem.h>
20#endif
21
18#include "a3xx_gpu.h" 22#include "a3xx_gpu.h"
19 23
20#define A3XX_INT0_MASK \ 24#define A3XX_INT0_MASK \
@@ -63,6 +67,7 @@ static void a3xx_me_init(struct msm_gpu *gpu)
63static int a3xx_hw_init(struct msm_gpu *gpu) 67static int a3xx_hw_init(struct msm_gpu *gpu)
64{ 68{
65 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); 69 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
70 struct a3xx_gpu *a3xx_gpu = to_a3xx_gpu(adreno_gpu);
66 uint32_t *ptr, len; 71 uint32_t *ptr, len;
67 int i, ret; 72 int i, ret;
68 73
@@ -105,6 +110,21 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
105 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT, 0x000000ff); 110 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT, 0x000000ff);
106 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT_CONF, 0x000000a4); 111 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT_CONF, 0x000000a4);
107 112
113 } else if (adreno_is_a330v2(adreno_gpu)) {
114 /*
115 * Most of the VBIF registers on 8974v2 have the correct
116 * values at power on, so we won't modify those if we don't
117 * need to
118 */
119 /* Enable 1k sort: */
120 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT, 0x0001003f);
121 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT_CONF, 0x000000a4);
122 /* Enable WR-REQ: */
123 gpu_write(gpu, REG_A3XX_VBIF_GATE_OFF_WRREQ_EN, 0x00003f);
124 gpu_write(gpu, REG_A3XX_VBIF_DDR_OUT_MAX_BURST, 0x0000303);
125 /* Set up VBIF_ROUND_ROBIN_QOS_ARB: */
126 gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
127
108 } else if (adreno_is_a330(adreno_gpu)) { 128 } else if (adreno_is_a330(adreno_gpu)) {
109 /* Set up 16 deep read/write request queues: */ 129 /* Set up 16 deep read/write request queues: */
110 gpu_write(gpu, REG_A3XX_VBIF_IN_RD_LIM_CONF0, 0x18181818); 130 gpu_write(gpu, REG_A3XX_VBIF_IN_RD_LIM_CONF0, 0x18181818);
@@ -121,10 +141,10 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
121 /* Set up VBIF_ROUND_ROBIN_QOS_ARB: */ 141 /* Set up VBIF_ROUND_ROBIN_QOS_ARB: */
122 gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0001); 142 gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0001);
123 /* Set up AOOO: */ 143 /* Set up AOOO: */
124 gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO_EN, 0x0000ffff); 144 gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO_EN, 0x0000003f);
125 gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO, 0xffffffff); 145 gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO, 0x003f003f);
126 /* Enable 1K sort: */ 146 /* Enable 1K sort: */
127 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT, 0x0001ffff); 147 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT, 0x0001003f);
128 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT_CONF, 0x000000a4); 148 gpu_write(gpu, REG_A3XX_VBIF_ABIT_SORT_CONF, 0x000000a4);
129 /* Disable VBIF clock gating. This is to enable AXI running 149 /* Disable VBIF clock gating. This is to enable AXI running
130 * higher frequency than GPU: 150 * higher frequency than GPU:
@@ -162,14 +182,23 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
162 gpu_write(gpu, REG_A3XX_UCHE_CACHE_MODE_CONTROL_REG, 0x00000001); 182 gpu_write(gpu, REG_A3XX_UCHE_CACHE_MODE_CONTROL_REG, 0x00000001);
163 183
164 /* Enable Clock gating: */ 184 /* Enable Clock gating: */
165 gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbfffffff); 185 if (adreno_is_a320(adreno_gpu))
166 186 gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbfffffff);
167 /* Set the OCMEM base address for A330 */ 187 else if (adreno_is_a330v2(adreno_gpu))
168//TODO: 188 gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa);
169// if (adreno_is_a330(adreno_gpu)) { 189 else if (adreno_is_a330(adreno_gpu))
170// gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR, 190 gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbffcffff);
171// (unsigned int)(a3xx_gpu->ocmem_base >> 14)); 191
172// } 192 if (adreno_is_a330v2(adreno_gpu))
193 gpu_write(gpu, REG_A3XX_RBBM_GPR0_CTL, 0x05515455);
194 else if (adreno_is_a330(adreno_gpu))
195 gpu_write(gpu, REG_A3XX_RBBM_GPR0_CTL, 0x00000000);
196
197 /* Set the OCMEM base address for A330, etc */
198 if (a3xx_gpu->ocmem_hdl) {
199 gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR,
200 (unsigned int)(a3xx_gpu->ocmem_base >> 14));
201 }
173 202
174 /* Turn on performance counters: */ 203 /* Turn on performance counters: */
175 gpu_write(gpu, REG_A3XX_RBBM_PERFCTR_CTL, 0x01); 204 gpu_write(gpu, REG_A3XX_RBBM_PERFCTR_CTL, 0x01);
@@ -238,12 +267,19 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
238 gpu_write(gpu, REG_A3XX_CP_PFP_UCODE_DATA, ptr[i]); 267 gpu_write(gpu, REG_A3XX_CP_PFP_UCODE_DATA, ptr[i]);
239 268
240 /* CP ROQ queue sizes (bytes) - RB:16, ST:16, IB1:32, IB2:64 */ 269 /* CP ROQ queue sizes (bytes) - RB:16, ST:16, IB1:32, IB2:64 */
241 if (adreno_is_a305(adreno_gpu) || adreno_is_a320(adreno_gpu)) 270 if (adreno_is_a305(adreno_gpu) || adreno_is_a320(adreno_gpu)) {
242 gpu_write(gpu, REG_AXXX_CP_QUEUE_THRESHOLDS, 271 gpu_write(gpu, REG_AXXX_CP_QUEUE_THRESHOLDS,
243 AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB1_START(2) | 272 AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB1_START(2) |
244 AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB2_START(6) | 273 AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB2_START(6) |
245 AXXX_CP_QUEUE_THRESHOLDS_CSQ_ST_START(14)); 274 AXXX_CP_QUEUE_THRESHOLDS_CSQ_ST_START(14));
246 275 } else if (adreno_is_a330(adreno_gpu)) {
276 /* NOTE: this (value take from downstream android driver)
277 * includes some bits outside of the known bitfields. But
278 * A330 has this "MERCIU queue" thing too, which might
279 * explain a new bitfield or reshuffling:
280 */
281 gpu_write(gpu, REG_AXXX_CP_QUEUE_THRESHOLDS, 0x003e2008);
282 }
247 283
248 /* clear ME_HALT to start micro engine */ 284 /* clear ME_HALT to start micro engine */
249 gpu_write(gpu, REG_AXXX_CP_ME_CNTL, 0); 285 gpu_write(gpu, REG_AXXX_CP_ME_CNTL, 0);
@@ -253,6 +289,14 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
253 return 0; 289 return 0;
254} 290}
255 291
292static void a3xx_recover(struct msm_gpu *gpu)
293{
294 gpu_write(gpu, REG_A3XX_RBBM_SW_RESET_CMD, 1);
295 gpu_read(gpu, REG_A3XX_RBBM_SW_RESET_CMD);
296 gpu_write(gpu, REG_A3XX_RBBM_SW_RESET_CMD, 0);
297 adreno_recover(gpu);
298}
299
256static void a3xx_destroy(struct msm_gpu *gpu) 300static void a3xx_destroy(struct msm_gpu *gpu)
257{ 301{
258 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); 302 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
@@ -261,6 +305,12 @@ static void a3xx_destroy(struct msm_gpu *gpu)
261 DBG("%s", gpu->name); 305 DBG("%s", gpu->name);
262 306
263 adreno_gpu_cleanup(adreno_gpu); 307 adreno_gpu_cleanup(adreno_gpu);
308
309#ifdef CONFIG_MSM_OCMEM
310 if (a3xx_gpu->ocmem_base)
311 ocmem_free(OCMEM_GRAPHICS, a3xx_gpu->ocmem_hdl);
312#endif
313
264 put_device(&a3xx_gpu->pdev->dev); 314 put_device(&a3xx_gpu->pdev->dev);
265 kfree(a3xx_gpu); 315 kfree(a3xx_gpu);
266} 316}
@@ -371,7 +421,7 @@ static const struct adreno_gpu_funcs funcs = {
371 .hw_init = a3xx_hw_init, 421 .hw_init = a3xx_hw_init,
372 .pm_suspend = msm_gpu_pm_suspend, 422 .pm_suspend = msm_gpu_pm_suspend,
373 .pm_resume = msm_gpu_pm_resume, 423 .pm_resume = msm_gpu_pm_resume,
374 .recover = adreno_recover, 424 .recover = a3xx_recover,
375 .last_fence = adreno_last_fence, 425 .last_fence = adreno_last_fence,
376 .submit = adreno_submit, 426 .submit = adreno_submit,
377 .flush = adreno_flush, 427 .flush = adreno_flush,
@@ -387,6 +437,7 @@ static const struct adreno_gpu_funcs funcs = {
387struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) 437struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
388{ 438{
389 struct a3xx_gpu *a3xx_gpu = NULL; 439 struct a3xx_gpu *a3xx_gpu = NULL;
440 struct adreno_gpu *adreno_gpu;
390 struct msm_gpu *gpu; 441 struct msm_gpu *gpu;
391 struct platform_device *pdev = a3xx_pdev; 442 struct platform_device *pdev = a3xx_pdev;
392 struct adreno_platform_config *config; 443 struct adreno_platform_config *config;
@@ -406,7 +457,8 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
406 goto fail; 457 goto fail;
407 } 458 }
408 459
409 gpu = &a3xx_gpu->base.base; 460 adreno_gpu = &a3xx_gpu->base;
461 gpu = &adreno_gpu->base;
410 462
411 get_device(&pdev->dev); 463 get_device(&pdev->dev);
412 a3xx_gpu->pdev = pdev; 464 a3xx_gpu->pdev = pdev;
@@ -421,11 +473,25 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
421 DBG("fast_rate=%u, slow_rate=%u, bus_freq=%u", 473 DBG("fast_rate=%u, slow_rate=%u, bus_freq=%u",
422 gpu->fast_rate, gpu->slow_rate, gpu->bus_freq); 474 gpu->fast_rate, gpu->slow_rate, gpu->bus_freq);
423 475
424 ret = adreno_gpu_init(dev, pdev, &a3xx_gpu->base, 476 ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, config->rev);
425 &funcs, config->rev);
426 if (ret) 477 if (ret)
427 goto fail; 478 goto fail;
428 479
480 /* if needed, allocate gmem: */
481 if (adreno_is_a330(adreno_gpu)) {
482#ifdef CONFIG_MSM_OCMEM
483 /* TODO this is different/missing upstream: */
484 struct ocmem_buf *ocmem_hdl =
485 ocmem_allocate(OCMEM_GRAPHICS, adreno_gpu->gmem);
486
487 a3xx_gpu->ocmem_hdl = ocmem_hdl;
488 a3xx_gpu->ocmem_base = ocmem_hdl->addr;
489 adreno_gpu->gmem = ocmem_hdl->len;
490 DBG("using %dK of OCMEM at 0x%08x", adreno_gpu->gmem / 1024,
491 a3xx_gpu->ocmem_base);
492#endif
493 }
494
429 if (!gpu->mmu) { 495 if (!gpu->mmu) {
430 /* TODO we think it is possible to configure the GPU to 496 /* TODO we think it is possible to configure the GPU to
431 * restrict access to VRAM carveout. But the required 497 * restrict access to VRAM carveout. But the required
@@ -460,7 +526,42 @@ static int a3xx_probe(struct platform_device *pdev)
460{ 526{
461 static struct adreno_platform_config config = {}; 527 static struct adreno_platform_config config = {};
462#ifdef CONFIG_OF 528#ifdef CONFIG_OF
463 /* TODO */ 529 struct device_node *child, *node = pdev->dev.of_node;
530 u32 val;
531 int ret;
532
533 ret = of_property_read_u32(node, "qcom,chipid", &val);
534 if (ret) {
535 dev_err(&pdev->dev, "could not find chipid: %d\n", ret);
536 return ret;
537 }
538
539 config.rev = ADRENO_REV((val >> 24) & 0xff,
540 (val >> 16) & 0xff, (val >> 8) & 0xff, val & 0xff);
541
542 /* find clock rates: */
543 config.fast_rate = 0;
544 config.slow_rate = ~0;
545 for_each_child_of_node(node, child) {
546 if (of_device_is_compatible(child, "qcom,gpu-pwrlevels")) {
547 struct device_node *pwrlvl;
548 for_each_child_of_node(child, pwrlvl) {
549 ret = of_property_read_u32(pwrlvl, "qcom,gpu-freq", &val);
550 if (ret) {
551 dev_err(&pdev->dev, "could not find gpu-freq: %d\n", ret);
552 return ret;
553 }
554 config.fast_rate = max(config.fast_rate, val);
555 config.slow_rate = min(config.slow_rate, val);
556 }
557 }
558 }
559
560 if (!config.fast_rate) {
561 dev_err(&pdev->dev, "could not find clk rates\n");
562 return -ENXIO;
563 }
564
464#else 565#else
465 struct kgsl_device_platform_data *pdata = pdev->dev.platform_data; 566 struct kgsl_device_platform_data *pdata = pdev->dev.platform_data;
466 uint32_t version = socinfo_get_version(); 567 uint32_t version = socinfo_get_version();
@@ -519,10 +620,19 @@ static int a3xx_remove(struct platform_device *pdev)
519 return 0; 620 return 0;
520} 621}
521 622
623static const struct of_device_id dt_match[] = {
624 { .compatible = "qcom,kgsl-3d0" },
625 {}
626};
627MODULE_DEVICE_TABLE(of, dt_match);
628
522static struct platform_driver a3xx_driver = { 629static struct platform_driver a3xx_driver = {
523 .probe = a3xx_probe, 630 .probe = a3xx_probe,
524 .remove = a3xx_remove, 631 .remove = a3xx_remove,
525 .driver.name = "kgsl-3d0", 632 .driver = {
633 .name = "kgsl-3d0",
634 .of_match_table = dt_match,
635 },
526}; 636};
527 637
528void __init a3xx_register(void) 638void __init a3xx_register(void)
diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.h b/drivers/gpu/drm/msm/adreno/a3xx_gpu.h
index 32c398c2d00a..bb9a8ca0507b 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.h
@@ -24,6 +24,10 @@
24struct a3xx_gpu { 24struct a3xx_gpu {
25 struct adreno_gpu base; 25 struct adreno_gpu base;
26 struct platform_device *pdev; 26 struct platform_device *pdev;
27
28 /* if OCMEM is used for GMEM: */
29 uint32_t ocmem_base;
30 void *ocmem_hdl;
27}; 31};
28#define to_a3xx_gpu(x) container_of(x, struct a3xx_gpu, base) 32#define to_a3xx_gpu(x) container_of(x, struct a3xx_gpu, base)
29 33
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 3f1c7b27e33e..d321099abdd4 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -45,7 +45,7 @@ static const struct adreno_info gpulist[] = {
45 .pfpfw = "a300_pfp.fw", 45 .pfpfw = "a300_pfp.fw",
46 .gmem = SZ_512K, 46 .gmem = SZ_512K,
47 }, { 47 }, {
48 .rev = ADRENO_REV(3, 3, 0, 0), 48 .rev = ADRENO_REV(3, 3, 0, ANY_ID),
49 .revn = 330, 49 .revn = 330,
50 .name = "A330", 50 .name = "A330",
51 .pm4fw = "a330_pm4.fw", 51 .pm4fw = "a330_pm4.fw",
@@ -71,7 +71,7 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
71 *value = adreno_gpu->info->revn; 71 *value = adreno_gpu->info->revn;
72 return 0; 72 return 0;
73 case MSM_PARAM_GMEM_SIZE: 73 case MSM_PARAM_GMEM_SIZE:
74 *value = adreno_gpu->info->gmem; 74 *value = adreno_gpu->gmem;
75 return 0; 75 return 0;
76 default: 76 default:
77 DBG("%s: invalid param: %u", gpu->name, param); 77 DBG("%s: invalid param: %u", gpu->name, param);
@@ -92,7 +92,7 @@ int adreno_hw_init(struct msm_gpu *gpu)
92 gpu_write(gpu, REG_AXXX_CP_RB_CNTL, 92 gpu_write(gpu, REG_AXXX_CP_RB_CNTL,
93 /* size is log2(quad-words): */ 93 /* size is log2(quad-words): */
94 AXXX_CP_RB_CNTL_BUFSZ(ilog2(gpu->rb->size / 8)) | 94 AXXX_CP_RB_CNTL_BUFSZ(ilog2(gpu->rb->size / 8)) |
95 AXXX_CP_RB_CNTL_BLKSZ(RB_BLKSIZE)); 95 AXXX_CP_RB_CNTL_BLKSZ(ilog2(RB_BLKSIZE / 8)));
96 96
97 /* Setup ringbuffer address: */ 97 /* Setup ringbuffer address: */
98 gpu_write(gpu, REG_AXXX_CP_RB_BASE, gpu->rb_iova); 98 gpu_write(gpu, REG_AXXX_CP_RB_BASE, gpu->rb_iova);
@@ -318,6 +318,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
318 rev.core, rev.major, rev.minor, rev.patchid); 318 rev.core, rev.major, rev.minor, rev.patchid);
319 319
320 gpu->funcs = funcs; 320 gpu->funcs = funcs;
321 gpu->gmem = gpu->info->gmem;
321 gpu->rev = rev; 322 gpu->rev = rev;
322 323
323 ret = request_firmware(&gpu->pm4, gpu->info->pm4fw, drm->dev); 324 ret = request_firmware(&gpu->pm4, gpu->info->pm4fw, drm->dev);
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index 451b741fbd12..ca11ea4da165 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -51,6 +51,7 @@ struct adreno_gpu {
51 struct msm_gpu base; 51 struct msm_gpu base;
52 struct adreno_rev rev; 52 struct adreno_rev rev;
53 const struct adreno_info *info; 53 const struct adreno_info *info;
54 uint32_t gmem; /* actual gmem size */
54 uint32_t revn; /* numeric revision name */ 55 uint32_t revn; /* numeric revision name */
55 const struct adreno_gpu_funcs *funcs; 56 const struct adreno_gpu_funcs *funcs;
56 57
@@ -97,6 +98,11 @@ static inline bool adreno_is_a330(struct adreno_gpu *gpu)
97 return gpu->revn == 330; 98 return gpu->revn == 330;
98} 99}
99 100
101static inline bool adreno_is_a330v2(struct adreno_gpu *gpu)
102{
103 return adreno_is_a330(gpu) && (gpu->rev.patchid > 0);
104}
105
100int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value); 106int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value);
101int adreno_hw_init(struct msm_gpu *gpu); 107int adreno_hw_init(struct msm_gpu *gpu);
102uint32_t adreno_last_fence(struct msm_gpu *gpu); 108uint32_t adreno_last_fence(struct msm_gpu *gpu);
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index 014a3fd04f62..92b745986231 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -40,7 +40,7 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char **names, int cnt)
40 for (i = 0; i < cnt; i++) { 40 for (i = 0; i < cnt; i++) {
41 struct device *msm_iommu_get_ctx(const char *ctx_name); 41 struct device *msm_iommu_get_ctx(const char *ctx_name);
42 struct device *ctx = msm_iommu_get_ctx(names[i]); 42 struct device *ctx = msm_iommu_get_ctx(names[i]);
43 if (!ctx) 43 if (IS_ERR_OR_NULL(ctx))
44 continue; 44 continue;
45 ret = iommu_attach_device(iommu->domain, ctx); 45 ret = iommu_attach_device(iommu->domain, ctx);
46 if (ret) { 46 if (ret) {