drm/rockchip: vop2: udpate linear 10bit yuv format align role

At RK356X/RK3588/RK3562/RK3528 linear 10bit yuv format actual_w should
align as 4 pixel, from RK3576 linear 10bit yuv format actual_w should
align as 2 pixel.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I719f59574442628f2ed2410d6ca20194cf6f580d
This commit is contained in:
Sandy Huang
2024-05-31 09:44:20 +08:00
committed by Tao Huang
parent d03a5046f1
commit 07bed61e89
2 changed files with 15 additions and 5 deletions

View File

@@ -28,11 +28,12 @@
#define VOP2_MINOR(version) (((version) >> 16) & 0xff)
#define VOP2_BUILD(version) ((version) & 0xffff)
/* The new SOC VOP version is bigger than the old */
#define VOP_VERSION_RK3568 VOP2_VERSION(0x40, 0x15, 0x8023)
#define VOP_VERSION_RK3588 VOP2_VERSION(0x40, 0x17, 0x6786)
#define VOP_VERSION_RK3528 VOP2_VERSION(0x50, 0x17, 0x1263)
#define VOP_VERSION_RK3562 VOP2_VERSION(0x50, 0x17, 0x4350)
#define VOP_VERSION_RK3568 VOP2_VERSION(0x40, 0x15, 0x8023)
#define VOP_VERSION_RK3576 VOP2_VERSION(0x50, 0x19, 0x9765)
#define VOP_VERSION_RK3588 VOP2_VERSION(0x40, 0x17, 0x6786)
/* register one connector */
#define ROCKCHIP_OUTPUT_DUAL_CHANNEL_LEFT_RIGHT_MODE BIT(0)

View File

@@ -5914,9 +5914,18 @@ static void vop2_win_atomic_update(struct vop2_win *win, struct drm_rect *src, s
}
}
if (is_linear_10bit_yuv(fb->format->format) && actual_w & 0x3) {
DRM_WARN("vp%d %s actual_w[%d] should align as 4 pixel when is linear 10 bit yuv format\n", vp->id, win->name, actual_w);
actual_w = ALIGN_DOWN(actual_w, 4);
/*
* At RK356X/RK3588/RK3562/RK3528 linear 10bit yuv format actual_w should align as 4 pixel,
* from RK3576 linear 10bit yuv format actual_w should align as 2 pixel.
*/
if (is_linear_10bit_yuv(fb->format->format)) {
if (vop2->version < VOP_VERSION_RK3576 && actual_w & 0x3) {
DRM_WARN("vp%d %s actual_w[%d] should align as 4 pixel when is linear 10 bit yuv format\n", vp->id, win->name, actual_w);
actual_w = ALIGN_DOWN(actual_w, 4);
} else if (vop2->version >= VOP_VERSION_RK3576 && actual_w & 0x1) {
DRM_WARN("vp%d %s actual_w[%d] should align as 2 pixel when is linear 10 bit yuv format\n", vp->id, win->name, actual_w);
actual_w = ALIGN_DOWN(actual_w, 2);
}
}
act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);