drm/rockchip: vop: fix display flash when switch to iommu mapping
authorMark Yao <mark.yao@rock-chips.com>
Mon, 28 Nov 2016 00:46:29 +0000 (08:46 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 28 Nov 2016 03:52:35 +0000 (11:52 +0800)
commit939aa1c5095fe0c4b81efb34b4e6a547379cea8a
tree0f221f088e81c1f49b3128261949f563ee82f9a1
parent078f5873cfe53a193eae9d98ee0312e868b2c644
drm/rockchip: vop: fix display flash when switch to iommu mapping

Do iommu mapping with looping vop vblank register have a problem, when
iommu attach take too long time or vblank time is too short, the display
would flash.

This patch use another method to fix this problem:
  Use standby and dsp_hold interrupt to enter vblank time, when iommu
  mapping is finish, exit vop standby, then vop would start scanout
  immediately,
      vop enter standby    -> |
      dsp_hold irq         -> |--------- vblank start
      do iommu mapping     -> | vblank time
      exit standby         -> |--------- vblank end

We try add 20ms delay to iommu attach, display also looks good, that
means this method have higher compatibility.

Change-Id: I59d57c9085631d0c42174ea18890c80e26b42d22
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c