drm/rockchip: vop2: wb uv address must follow yrgb address without gap

VOP writeback directly without stride, and the uv buffer is follow
yrgb buffer without gap.

Change-Id: I9f63eb0527499e2d18d99fc248dbfd95b5d6179d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
Andy Yan
2021-03-25 11:49:04 +08:00
committed by Tao Huang
parent 824600d786
commit 55fab09816

View File

@@ -1866,9 +1866,14 @@ static int vop2_wb_encoder_atomic_check(struct drm_encoder *encoder,
wb_state->vp_id = vp->id;
wb_state->yrgb_addr = rockchip_fb_get_dma_addr(fb, 0);
/*
* uv address must follow yrgb address without gap.
* the fb->offsets is include stride, so we should
* not use it.
*/
if (fb->format->is_yuv) {
wb_state->uv_addr = rockchip_fb_get_dma_addr(fb, 1);
wb_state->uv_addr += fb->offsets[1];
wb_state->uv_addr = wb_state->yrgb_addr;
wb_state->uv_addr += DIV_ROUND_UP(fb->width * fb->format->bpp[0], 8) * fb->height;
}
return 0;