MALI: rockchip: not to use sg_dma_len in midgard ddk r11p0-00rel0
authorchenzhen <chenzhen@rock-chips.com>
Thu, 14 Apr 2016 02:17:36 +0000 (10:17 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 31 May 2016 01:12:11 +0000 (09:12 +0800)
When CONFIG_NEED_SG_DMA_LENGTH is enabled,
sg_dma_len is defined as follow :
"#define sg_dma_len(sg)             ((sg)->dma_length)"
But, dma_length is not used by the framework indeed.

Change-Id: I51d1adf9f2738b1036fdaf6172ae932c007fac76
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
drivers/gpu/arm/midgard/mali_kbase_mem.c

index 385d56a8f53d587cec24b8d6877c6cd70ff3f8a9..1484a6a688cc60449cb9e2624ddf3b21c67e0ad3 100644 (file)
@@ -2130,6 +2130,10 @@ static void kbase_jd_user_buf_unmap(struct kbase_context *kctx,
        alloc->nents = 0;
 }
 
+
+/* to replace sg_dma_len. */
+#define MALI_SG_DMA_LEN(sg)        ((sg)->length)
+
 #ifdef CONFIG_DMA_SHARED_BUFFER
 static int kbase_jd_umm_map(struct kbase_context *kctx,
                struct kbase_va_region *reg)
@@ -2160,11 +2164,11 @@ static int kbase_jd_umm_map(struct kbase_context *kctx,
 
        for_each_sg(sgt->sgl, s, sgt->nents, i) {
                int j;
-               size_t pages = PFN_UP(sg_dma_len(s));
+               size_t pages = PFN_UP(MALI_SG_DMA_LEN(s));
 
-               WARN_ONCE(sg_dma_len(s) & (PAGE_SIZE-1),
-               "sg_dma_len(s)=%u is not a multiple of PAGE_SIZE\n",
-               sg_dma_len(s));
+               WARN_ONCE(MALI_SG_DMA_LEN(s) & (PAGE_SIZE-1),
+               "MALI_SG_DMA_LEN(s)=%u is not a multiple of PAGE_SIZE\n",
+               MALI_SG_DMA_LEN(s));
 
                WARN_ONCE(sg_dma_address(s) & (PAGE_SIZE-1),
                "sg_dma_address(s)=%llx is not aligned to PAGE_SIZE\n",