drm/rockchip: vop2: Check writeback fifo depth

The fifo depth of RK356X/RK3588 writeback is 1920x4/16.
A fifo_throd larger than this value will cause a empty(zero)
writeback.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Id67209f7b162608dcba191ab23cf6eec11e3fc08
This commit is contained in:
Andy Yan
2021-12-30 19:41:36 +08:00
committed by Tao Huang
parent 5bf8973ca1
commit 82e307e6d2
3 changed files with 4 additions and 0 deletions

View File

@@ -852,6 +852,7 @@ struct vop2_wb_data {
const uint32_t *formats;
struct vop_rect max_output;
const struct vop2_wb_regs *regs;
uint32_t fifo_depth;
};
struct vop2_video_port_data {

View File

@@ -2730,6 +2730,8 @@ static void vop2_wb_commit(struct drm_crtc *crtc)
spin_unlock_irqrestore(&wb->job_lock, flags);
fifo_throd = fb->pitches[0] >> 4;
if (fifo_throd >= vop2->data->wb->fifo_depth)
fifo_throd = vop2->data->wb->fifo_depth;
r2y = is_yuv_support(fb->format->format) && (!is_yuv_output(vcstate->bus_format));
/*

View File

@@ -650,6 +650,7 @@ static const struct vop2_wb_data rk3568_vop_wb_data = {
.formats = formats_wb,
.nformats = ARRAY_SIZE(formats_wb),
.max_output = { 1920, 1080 },
.fifo_depth = 1920 * 4 / 16,
.regs = &rk3568_vop_wb_regs,
};