]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/msm/adreno/a3xx_gpu.c
Merge tag 'for-5.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
[linux.git] / drivers / gpu / drm / msm / adreno / a3xx_gpu.c
index 5f7e98028eaf4cc82623250d38e469f427dd909b..7ad14937fcdf80f37de996ee7fbaba872331c288 100644 (file)
@@ -6,10 +6,6 @@
  * Copyright (c) 2014 The Linux Foundation. All rights reserved.
  */
 
-#ifdef CONFIG_MSM_OCMEM
-#  include <mach/ocmem.h>
-#endif
-
 #include "a3xx_gpu.h"
 
 #define A3XX_INT0_MASK \
@@ -195,9 +191,9 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
                gpu_write(gpu, REG_A3XX_RBBM_GPR0_CTL, 0x00000000);
 
        /* Set the OCMEM base address for A330, etc */
-       if (a3xx_gpu->ocmem_hdl) {
+       if (a3xx_gpu->ocmem.hdl) {
                gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR,
-                       (unsigned int)(a3xx_gpu->ocmem_base >> 14));
+                       (unsigned int)(a3xx_gpu->ocmem.base >> 14));
        }
 
        /* Turn on performance counters: */
@@ -318,10 +314,7 @@ static void a3xx_destroy(struct msm_gpu *gpu)
 
        adreno_gpu_cleanup(adreno_gpu);
 
-#ifdef CONFIG_MSM_OCMEM
-       if (a3xx_gpu->ocmem_base)
-               ocmem_free(OCMEM_GRAPHICS, a3xx_gpu->ocmem_hdl);
-#endif
+       adreno_gpu_ocmem_cleanup(&a3xx_gpu->ocmem);
 
        kfree(a3xx_gpu);
 }
@@ -494,17 +487,10 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
 
        /* if needed, allocate gmem: */
        if (adreno_is_a330(adreno_gpu)) {
-#ifdef CONFIG_MSM_OCMEM
-               /* TODO this is different/missing upstream: */
-               struct ocmem_buf *ocmem_hdl =
-                               ocmem_allocate(OCMEM_GRAPHICS, adreno_gpu->gmem);
-
-               a3xx_gpu->ocmem_hdl = ocmem_hdl;
-               a3xx_gpu->ocmem_base = ocmem_hdl->addr;
-               adreno_gpu->gmem = ocmem_hdl->len;
-               DBG("using %dK of OCMEM at 0x%08x", adreno_gpu->gmem / 1024,
-                               a3xx_gpu->ocmem_base);
-#endif
+               ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev,
+                                           adreno_gpu, &a3xx_gpu->ocmem);
+               if (ret)
+                       goto fail;
        }
 
        if (!gpu->aspace) {