drm/rockchip: vop2: Disable all other multi area when disable area0

When area0 is disabled, all other sub multi area must be
disabled, or the win may run into unexpected situlation:
such as post_buf_empty or iommu fault.

Change-Id: I8a92e45849cfc31af029ba0e86562751be92ddbd
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
Andy Yan
2021-06-23 15:06:11 +08:00
committed by Tao Huang
parent 2c9cf24286
commit 97e31ffa5d
3 changed files with 24 additions and 2 deletions

View File

@@ -48,6 +48,7 @@
* This is a feather on rk3566
*/
#define WIN_FEATURE_MIRROR BIT(6)
#define WIN_FEATURE_MULTI_AREA BIT(7)
#define VOP2_SOC_VARIANT 4

View File

@@ -1101,6 +1101,19 @@ static inline void vop2_wb_cfg_done(struct vop2_video_port *vp)
}
static void vop2_win_multi_area_disable(struct vop2_win *parent)
{
struct vop2 *vop2 = parent->vop2;
struct vop2_win *area;
int i;
for (i = 0; i < vop2->registered_num_wins; i++) {
area = &vop2->win[i];
if (area->parent == parent)
VOP_WIN_SET(vop2, area, enable, 0);
}
}
static void vop2_win_disable(struct vop2_win *win)
{
struct vop2 *vop2 = win->vop2;
@@ -1120,6 +1133,12 @@ static void vop2_win_disable(struct vop2_win *win)
VOP_CLUSTER_SET(vop2, win, enable, 0);
}
/*
* disable all other multi area win if we want disable area0 here
*/
if (!win->parent && (win->feature & WIN_FEATURE_MULTI_AREA))
vop2_win_multi_area_disable(win);
}
static inline void vop2_write_lut(struct vop2 *vop2, uint32_t offset, uint32_t v)

View File

@@ -1021,6 +1021,7 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
.max_upscale_factor = 8,
.max_downscale_factor = 8,
.dly = { 20, 47, 41 },
.feature = WIN_FEATURE_MULTI_AREA,
},
{
@@ -1043,7 +1044,7 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
.max_upscale_factor = 8,
.max_downscale_factor = 8,
.dly = { 20, 47, 41 },
.feature = WIN_FEATURE_MIRROR,
.feature = WIN_FEATURE_MIRROR | WIN_FEATURE_MULTI_AREA,
},
{
@@ -1066,7 +1067,7 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
.max_upscale_factor = 8,
.max_downscale_factor = 8,
.dly = { 20, 47, 41 },
.feature = WIN_FEATURE_MIRROR,
.feature = WIN_FEATURE_MIRROR | WIN_FEATURE_MULTI_AREA,
},
{
@@ -1089,6 +1090,7 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
.max_upscale_factor = 8,
.max_downscale_factor = 8,
.dly = { 20, 47, 41 },
.feature = WIN_FEATURE_MULTI_AREA,
},
{