drm/rockchip: vop2: Report max_input of window as 4096x4320

Make hwc work correct when handle a 8K input source

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I77ee3c13f5c884fbdd9eec72b02998e10bbc3425
This commit is contained in:
Andy Yan
2021-11-29 19:26:03 +08:00
committed by Tao Huang
parent 6953760a2a
commit 1966a3328a
2 changed files with 12 additions and 6 deletions

View File

@@ -3404,6 +3404,8 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta
struct rockchip_gem_object *rk_obj, *rk_uv_obj;
int min_scale = win->regs->scl ? FRAC_16_16(1, 8) : DRM_PLANE_HELPER_NO_SCALING;
int max_scale = win->regs->scl ? FRAC_16_16(8, 1) : DRM_PLANE_HELPER_NO_SCALING;
int max_input_w;
int max_input_h;
unsigned long offset;
dma_addr_t dma_addr;
int ret;
@@ -3424,6 +3426,9 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta
mode = &cstate->mode;
vcstate = to_rockchip_crtc_state(cstate);
max_input_w = vop2_data->max_input.width;
max_input_h = vop2_data->max_input.height;
if (vop2_has_feature(win->vop2, VOP_FEATURE_SPLICE)) {
if (mode->hdisplay > VOP2_MAX_VP_OUTPUT_WIDTH) {
vcstate->splice_mode = true;
@@ -3434,6 +3439,7 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta
splice_win->splice_mode_right = true;
splice_win->left_win = win;
win->splice_win = splice_win;
max_input_w <<= 1;
}
}
@@ -3486,13 +3492,13 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta
return 0;
}
if (drm_rect_width(src) >> 16 > vop2_data->max_input.width ||
drm_rect_height(src) >> 16 > vop2_data->max_input.height) {
if (drm_rect_width(src) >> 16 > max_input_w ||
drm_rect_height(src) >> 16 > max_input_h) {
DRM_ERROR("Invalid source: %dx%d. max input: %dx%d\n",
drm_rect_width(src) >> 16,
drm_rect_height(src) >> 16,
vop2_data->max_input.width,
vop2_data->max_input.height);
max_input_w,
max_input_h);
return -EINVAL;
}

View File

@@ -2667,8 +2667,8 @@ static const struct vop2_data rk3588_vop = {
.nr_mixers = 7,
.nr_layers = 8,
.nr_pds = 7,
.max_input = { 8192, 4320 },
.max_output = { 4096, 2304 },
.max_input = { 4096, 4320 },
.max_output = { 4096, 4320 },
.ctrl = &rk3588_vop_ctrl,
.grf = &rk3588_vop_grf_ctrl,
.sys_grf = &rk3588_sys_grf_ctrl,