drm/rockchip: use drm_format_info_min_pitch calculate pixel pitch

According to comment in drm_format_info, drm_format_info_min_pitch
has better compatibility than calculate by cpp.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I246f29bc6a5482242ff8d533c0416101a04c7550
This commit is contained in:
Andy Yan
2022-05-26 15:43:50 +08:00
committed by Tao Huang
parent 001467a8bc
commit de1b8efb44

View File

@@ -4325,11 +4325,10 @@ static void vop2_win_atomic_update(struct vop2_win *win, struct drm_rect *src, s
*/
if (win->splice_mode_right) {
splice_pixel_offset = (src->x1 - left_src->x1) >> 16;
splice_yrgb_offset = splice_pixel_offset * fb->format->cpp[0];
splice_yrgb_offset = drm_format_info_min_pitch(fb->format, 0, splice_pixel_offset);
if (fb->format->is_yuv && fb->format->num_planes > 1) {
hsub = fb->format->hsub;
splice_uv_offset = splice_pixel_offset * fb->format->cpp[1] / hsub;
splice_uv_offset = drm_format_info_min_pitch(fb->format, 1, splice_pixel_offset / hsub);
}
}