drm/rockchip: vop2: Remove the flag &vop2->is_iommu_needed

For a specific case, there will be unexpected abnormal display:

If the logo display is disabled and the cubit lut is updated before
refreshing the first frame, the cubit lut function will be abnormal
along with display abnormalities.

The reason is:

The 3D look-up table is allocated via iommu while the flag
&vop2->is_iommu_needed, which to initialize the iommu, is first set
before refreshing the first frame. Therefore, for the above case,
the cubit lut function is working without iommu initialized.

Through analysis of the code logic, we found that the flag
&vop2->is_iommu_needed is redundant. After removing it, the iommu
will be enabled at the same time as the first atomic flush
operation, which may refresh the frame or not.

What's more, this method also help to avoid the cubit lut abnormal
issue in above case.

Change-Id: I196c1652798164690bedbe6cc4c5fce265f1e178
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
Damon Ding
2025-08-04 21:15:24 +08:00
committed by Tao Huang
parent 4a8f31cec6
commit 97e3aa256f

View File

@@ -925,7 +925,6 @@ struct vop2 {
struct drm_prop_enum_list *plane_name_list;
struct vop2_shared_mode_res shared_mode_res;
bool is_iommu_enabled;
bool is_iommu_needed;
bool is_enabled;
bool support_multi_area;
bool disable_afbc_win;
@@ -7241,8 +7240,6 @@ static void vop2_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_
}
vop2_win_atomic_update(win, &wsrc, &wdst, pstate);
vop2->is_iommu_needed = true;
}
static const struct drm_plane_helper_funcs vop2_plane_helper_funcs = {
@@ -13483,7 +13480,7 @@ static void vop2_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_stat
vop2_cfg_update(crtc, old_cstate);
if (!vop2->is_iommu_enabled && vop2->is_iommu_needed) {
if (!vop2->is_iommu_enabled) {
enum rockchip_drm_vop_aclk_mode aclk_mode = vop2->aclk_mode;
bool enter_vop_aclk_reset_mode = false;