From d3438bad81f5b88c21da4243d3a2021c74d636a8 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Tue, 1 Dec 2015 16:19:28 +0800 Subject: [PATCH] video: rockchip: fb: disable ion_unmap_iommu video buffer 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 --- drivers/video/rockchip/rk_fb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index c4739bdde591..976089450d53 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -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; -- 2.34.1