From: chenzhen Date: Thu, 14 Apr 2016 02:17:36 +0000 (+0800) Subject: MALI: rockchip: not to use sg_dma_len in midgard ddk r11p0-00rel0 X-Git-Tag: firefly_0821_release~2585 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ff9877f38beaebd4ae9eb7d22698d8fbec8eb2e8;p=firefly-linux-kernel-4.4.55.git MALI: rockchip: not to use sg_dma_len in midgard ddk r11p0-00rel0 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 --- diff --git a/drivers/gpu/arm/midgard/mali_kbase_mem.c b/drivers/gpu/arm/midgard/mali_kbase_mem.c index 385d56a8f53d..1484a6a688cc 100644 --- a/drivers/gpu/arm/midgard/mali_kbase_mem.c +++ b/drivers/gpu/arm/midgard/mali_kbase_mem.c @@ -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",