video: rockchip: fb: disable ion_unmap_iommu video buffer
authorZheng Yang <zhengyang@rock-chips.com>
Tue, 1 Dec 2015 08:19:28 +0000 (16:19 +0800)
committerHuang Jiachai <hjc@rock-chips.com>
Thu, 17 Dec 2015 07:20:58 +0000 (15:20 +0800)
The mapping action of ion_map_iommu will cost longer time
and more cpu load if mapped buffer size is large, especially
for 4K video buffer.

If this buffer has been mapped, ion_map_iommu will use the
mapped table before, almost no time consuming. And the mapping
relationship will be free when this buffer is free.

So we disable ion_unmap_iommu to reduce RK_FBIOSET_CONFIG_DONE
cost time and cpu load. On 3228, surfaceflinger cpu load reduce
to 4% from 9% when playing 4K video.

Change-Id: I64b2d4550b21b6ff44d8cceafe114ca8405601d9
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
drivers/video/rockchip/rk_fb.c

index c4739bdde591c595126856db5c06aea57a4fc873..976089450d530779e697385b51209a2223f5802f 100644 (file)
@@ -1520,7 +1520,8 @@ void rk_fb_free_dma_buf(struct rk_lcdc_driver *dev_drv,
                index_buf = area_data->index_buf;
 #if defined(CONFIG_RK_IOMMU)
                if (dev_drv->iommu_enabled) {
-                       if (area_data->ion_handle != NULL)
+                       if (area_data->ion_handle != NULL &&
+                           !IS_YUV_FMT(area_data->data_format))
                                ion_unmap_iommu(dev_drv->dev, rk_fb->ion_client,
                                                area_data->ion_handle);
                        freed_addr[freed_index++] = area_data->smem_start;