mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/rockchip: vop2: disable writeback auto gating at oneshot mode
At writeback oneshot mode, the writeback auto gating will close clk after VOP writeback complete, but at this time, the writeback axi access maybe uncomplete, this will lead to writeback state error and iommu stall failed. Signed-off-by: Sandy Huang <hjc@rock-chips.com> Change-Id: I4a74a8ace1cf6dba6d60af822e0d74d31d7f61fa
This commit is contained in:
@@ -1037,6 +1037,7 @@ struct vop2_wb_regs {
|
||||
struct vop_reg vir_stride_en;
|
||||
struct vop_reg act_width;
|
||||
struct vop_reg one_frame_mode;
|
||||
struct vop_reg auto_gating;
|
||||
};
|
||||
|
||||
struct vop2_power_domain_data {
|
||||
|
||||
@@ -3564,22 +3564,30 @@ static void vop2_wb_commit(struct drm_crtc *crtc)
|
||||
VOP_MODULE_SET(vop2, wb, scale_x_en, wb_state->scale_x_en);
|
||||
VOP_MODULE_SET(vop2, wb, scale_y_en, wb_state->scale_y_en);
|
||||
VOP_MODULE_SET(vop2, wb, r2y_en, r2y);
|
||||
if (vop2->version == VOP_VERSION_RK3576) {
|
||||
bool enable_one_frame_mode = true;
|
||||
|
||||
/*
|
||||
* From rk3576, VOP writeback can support oneshot mode, and
|
||||
* at rk3576 writbeback oneshot mode must disable auto gating.
|
||||
*/
|
||||
if (!is_vop3(vop2) || vop2->version == VOP_VERSION_RK3528 ||
|
||||
vop2->version == VOP_VERSION_RK3562) {
|
||||
VOP_MODULE_SET(vop2, wb, enable, 1);
|
||||
} else {
|
||||
bool one_frame_mode = true;
|
||||
|
||||
VOP_MODULE_SET(vop2, wb, act_width, fb->width - 1);
|
||||
VOP_MODULE_SET(vop2, wb, vir_stride, fb->pitches[0] >> 2);
|
||||
VOP_MODULE_SET(vop2, wb, vir_stride_en, 1);
|
||||
|
||||
if (enable_one_frame_mode) {
|
||||
if (one_frame_mode) {
|
||||
if (vop2->version == VOP_VERSION_RK3576)
|
||||
VOP_MODULE_SET(vop2, wb, auto_gating, 0);
|
||||
VOP_MODULE_SET(vop2, wb, one_frame_mode, 1);
|
||||
vop2_write_reg_uncached(vop2, &wb->regs->enable, 1);
|
||||
} else {
|
||||
VOP_MODULE_SET(vop2, wb, enable, 1);
|
||||
}
|
||||
} else {
|
||||
VOP_MODULE_SET(vop2, wb, enable, 1);
|
||||
}
|
||||
|
||||
vop2_wb_irqs_enable(vop2);
|
||||
VOP_CTRL_SET(vop2, wb_dma_finish_and_en, 1);
|
||||
}
|
||||
|
||||
@@ -906,6 +906,7 @@ static const struct vop2_wb_regs rk3576_vop_wb_regs = {
|
||||
.vir_stride = VOP_REG(RK3576_WB_VIR_STRIDE, 0x1fff, 0),
|
||||
.vir_stride_en = VOP_REG(RK3576_WB_VIR_STRIDE, 0x1, 15),
|
||||
.act_width = VOP_REG(RK3576_WB_VIR_STRIDE, 0x1fff, 16),
|
||||
.auto_gating = VOP_REG(RK3568_SYS_AUTO_GATING_CTRL, 0x1, 11),
|
||||
};
|
||||
|
||||
static const struct vop2_wb_data rk3576_vop_wb_data = {
|
||||
|
||||
Reference in New Issue
Block a user