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>
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;