Skip to content

Commit

Permalink
rockchip: vop: force skip lines if image too big
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwiboo committed Jan 22, 2018
1 parent 7fd9cf5 commit f68a5c2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/gpu/drm/rockchip/rockchip_drm_vop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
int ymirror, xmirror;
uint32_t val;
bool rb_swap, global_alpha_en;
int skip_lines = 0;

/*
* can't update plane when vop is disabled.
Expand All @@ -1566,8 +1567,13 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
return;
}

/*
* force skip lines if image too big.
*/
actual_w = drm_rect_width(src) >> 16;
actual_h = drm_rect_height(src) >> 16;
if (actual_w == 3840 && is_yuv_support(fb->pixel_format))
skip_lines = 1;
actual_h = drm_rect_height(src) >> (16 + skip_lines);
act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);

dsp_info = (drm_rect_height(dest) - 1) << 16;
Expand All @@ -1589,10 +1595,10 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
VOP_WIN_SET(vop, win, xmirror, xmirror);
VOP_WIN_SET(vop, win, ymirror, ymirror);
VOP_WIN_SET(vop, win, format, vop_plane_state->format);
VOP_WIN_SET(vop, win, yrgb_vir, fb->pitches[0] >> 2);
VOP_WIN_SET(vop, win, yrgb_vir, fb->pitches[0] >> (2 - skip_lines));
VOP_WIN_SET(vop, win, yrgb_mst, vop_plane_state->yrgb_mst);
if (is_yuv_support(fb->pixel_format)) {
VOP_WIN_SET(vop, win, uv_vir, fb->pitches[1] >> 2);
VOP_WIN_SET(vop, win, uv_vir, fb->pitches[1] >> (2 - skip_lines));
VOP_WIN_SET(vop, win, uv_mst, vop_plane_state->uv_mst);
}
VOP_WIN_SET(vop, win, fmt_10, is_yuv_10bit(fb->pixel_format));
Expand Down

0 comments on commit f68a5c2

Please sign in to comment.