drm/rockchip: vop2: fix double config done at one frame time

Maybe appear the following case:
-> set gamma
-> config done
-> atomic commit
   --> update win format
   --> update win address
   ---> here maybe meet vop hardware frame start, and triggle some config take affect.
   ---> as only some config take affect, this maybe lead to iommu pagefault.
   --> update win size
   --> update win other parameters
-> config done

so we add readx_poll_timeout() to make sure the first config done take
effect and then to do next frame config.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6ec67b374b3afd2bed4a57aa1e7b729964df1736
This commit is contained in:
Sandy Huang
2022-01-13 16:07:03 +08:00
committed by Tao Huang
parent 0424da3594
commit a2d8c2aeb0

View File

@@ -2348,6 +2348,23 @@ static void vop2_crtc_load_lut(struct drm_crtc *crtc)
vp->gamma_lut_active = true;
spin_unlock(&vop2->reg_lock);
/*
* maybe appear the following case:
* -> set gamma
* -> config done
* -> atomic commit
* --> update win format
* --> update win address
* ---> here maybe meet vop hardware frame start, and triggle some config take affect.
* ---> as only some config take affect, this maybe lead to iommu pagefault.
* --> update win size
* --> update win other parameters
* -> config done
*
* so we add readx_poll_timeout() to make sure the first config done take
* effect and then to do next frame config.
*/
readx_poll_timeout(CTRL_GET, dsp_lut_en, dle, dle, 5, 33333);
#undef CTRL_GET
}