mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
media: rockchip: vpss: remove RKMOUDLE_UNITE_EXTEND_PIXEL
Change-Id: Ic6d9d1cac97c9c7a147634651f9940849491651b Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -300,6 +300,7 @@ static int rkvpss_plat_probe(struct platform_device *pdev)
|
||||
|
||||
dev_set_drvdata(dev, vpss_dev);
|
||||
vpss_dev->dev = dev;
|
||||
vpss_dev->unite_extend_pixel = 128;
|
||||
|
||||
ret = rkvpss_attach_hw(vpss_dev);
|
||||
if (ret)
|
||||
|
||||
@@ -91,6 +91,7 @@ struct rkvpss_device {
|
||||
bool mir_en;
|
||||
bool cmsc_upd;
|
||||
u32 unite_mode;
|
||||
u32 unite_extend_pixel;
|
||||
u8 unite_index;
|
||||
bool stopping;
|
||||
wait_queue_head_t stop_done;
|
||||
|
||||
@@ -595,17 +595,17 @@ static void calc_unite_scl_params(struct rkvpss_stream *stream)
|
||||
|
||||
if (stream->id == 0 && stream->crop.width != stream->out_fmt.width) {
|
||||
right_y_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_y - 3;
|
||||
right_c_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_c - 6;
|
||||
} else {
|
||||
right_y_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_y;
|
||||
right_c_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_c;
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ static int rkvpss_stream_crop(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
VPSS_UNITE_LEFT);
|
||||
else
|
||||
rkvpss_idx_write(dev, reg_h_size, crop->width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL, VPSS_UNITE_LEFT);
|
||||
dev->unite_extend_pixel, VPSS_UNITE_LEFT);
|
||||
rkvpss_idx_write(dev, reg_v_size, crop->height, VPSS_UNITE_LEFT);
|
||||
v4l2_dbg(4, rkvpss_debug, &dev->v4l2_dev,
|
||||
"left crop left:%d top:%d w:%d h:%d\n",
|
||||
@@ -1180,8 +1180,8 @@ static int rkvpss_stream_crop(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_v_offs, crop->top, VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_h_size, crop->width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->unite_params.quad_crop_w, VPSS_UNITE_RIGHT);
|
||||
dev->unite_extend_pixel - stream->unite_params.quad_crop_w,
|
||||
VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_v_size, crop->height, VPSS_UNITE_RIGHT);
|
||||
v4l2_dbg(4, rkvpss_debug, &dev->v4l2_dev,
|
||||
"right crop left:%d top:%d w:%d h:%d\n",
|
||||
@@ -1264,7 +1264,7 @@ static void poly_phase_scale(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
if (in_w == out_w)
|
||||
val = (in_w / 2 - 1) | ((in_h - 1) << 16);
|
||||
else
|
||||
val = (in_w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL - 1) |
|
||||
val = (in_w / 2 + dev->unite_extend_pixel - 1) |
|
||||
((in_h - 1) << 16);
|
||||
rkvpss_idx_write(dev, RKVPSS_ZME_Y_SRC_SIZE, val, VPSS_UNITE_LEFT);
|
||||
rkvpss_idx_write(dev, RKVPSS_ZME_UV_SRC_SIZE, val, VPSS_UNITE_LEFT);
|
||||
@@ -1602,7 +1602,7 @@ static void bilinear_scale(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
if (in_w == out_w)
|
||||
val = (in_w / 2) | (in_h << 16);
|
||||
else
|
||||
val = (in_w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL) | (in_h << 16);
|
||||
val = (in_w / 2 + dev->unite_extend_pixel) | (in_h << 16);
|
||||
reg = stream->config->scale.src_size;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_LEFT);
|
||||
|
||||
@@ -1668,7 +1668,7 @@ static void bilinear_scale(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
reg = stream->config->scale.hc_offs_mi;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_RIGHT);
|
||||
|
||||
val = (in_w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL) | (in_h << 16);
|
||||
val = (in_w / 2 + dev->unite_extend_pixel) | (in_h << 16);
|
||||
reg = stream->config->scale.src_size;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_RIGHT);
|
||||
|
||||
@@ -2469,29 +2469,29 @@ void rkvpss_cmsc_config_v10(struct rkvpss_device *dev, bool sync)
|
||||
win->point[1].x != win->point[2].x) {
|
||||
right_cfg.win[i].win_en &= ~BIT(j);
|
||||
} else {
|
||||
win->point[0].x = RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
win->point[3].x = RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
win->point[0].x = dev->unite_extend_pixel;
|
||||
win->point[3].x = dev->unite_extend_pixel;
|
||||
win->point[1].x = win->point[1].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2)
|
||||
+ RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
+ dev->unite_extend_pixel;
|
||||
win->point[2].x = win->point[2].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2)
|
||||
+ RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
+ dev->unite_extend_pixel;
|
||||
}
|
||||
} else {
|
||||
/** all right **/
|
||||
win->point[0].x = win->point[0].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[1].x = win->point[1].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[2].x = win->point[2].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[3].x = win->point[3].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,17 +791,17 @@ static void calc_unite_scl_params(struct rkvpss_stream *stream)
|
||||
|
||||
if (stream->id == 0 && stream->crop.width != stream->out_fmt.width) {
|
||||
right_y_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_y - 3;
|
||||
right_c_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_c - 6;
|
||||
} else {
|
||||
right_y_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_y;
|
||||
right_c_crop_total = stream->crop.width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->dev->unite_extend_pixel -
|
||||
right_scl_need_size_c;
|
||||
}
|
||||
|
||||
@@ -1455,7 +1455,7 @@ static int rkvpss_stream_crop_ch4_5(struct rkvpss_stream *stream, bool on, bool
|
||||
if (crop->width == stream->out_fmt.width)
|
||||
h_size = crop->width / 2;
|
||||
else
|
||||
h_size = crop->width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
h_size = crop->width / 2 + dev->unite_extend_pixel;
|
||||
|
||||
v_size = crop->height;
|
||||
rkvpss_idx_write(dev, reg_ch4_5_size,
|
||||
@@ -1471,7 +1471,7 @@ static int rkvpss_stream_crop_ch4_5(struct rkvpss_stream *stream, bool on, bool
|
||||
rkvpss_idx_set_bits(dev, reg_ctrl, 0, val, VPSS_UNITE_RIGHT);
|
||||
h_offs = stream->unite_params.quad_crop_w;
|
||||
v_offs = crop->top;
|
||||
h_size = crop->width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
h_size = crop->width / 2 + dev->unite_extend_pixel -
|
||||
stream->unite_params.quad_crop_w;
|
||||
v_size = crop->height;
|
||||
rkvpss_idx_write(dev, reg_ch4_5_offs,
|
||||
@@ -1554,7 +1554,7 @@ static int rkvpss_stream_crop(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
VPSS_UNITE_LEFT);
|
||||
else
|
||||
rkvpss_idx_write(dev, reg_h_size, crop->width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL, VPSS_UNITE_LEFT);
|
||||
dev->unite_extend_pixel, VPSS_UNITE_LEFT);
|
||||
rkvpss_idx_write(dev, reg_v_size, crop->height, VPSS_UNITE_LEFT);
|
||||
v4l2_dbg(4, rkvpss_debug, &dev->v4l2_dev,
|
||||
"left crop left:%d top:%d w:%d h:%d\n",
|
||||
@@ -1569,8 +1569,8 @@ static int rkvpss_stream_crop(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_v_offs, crop->top, VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_h_size, crop->width / 2 +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL -
|
||||
stream->unite_params.quad_crop_w, VPSS_UNITE_RIGHT);
|
||||
dev->unite_extend_pixel -
|
||||
stream->unite_params.quad_crop_w, VPSS_UNITE_RIGHT);
|
||||
rkvpss_idx_write(dev, reg_v_size, crop->height, VPSS_UNITE_RIGHT);
|
||||
v4l2_dbg(4, rkvpss_debug, &dev->v4l2_dev,
|
||||
"right crop left:%d top:%d w:%d h:%d\n",
|
||||
@@ -1822,7 +1822,7 @@ static void bilinear_scale(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
if (in_w == out_w)
|
||||
val = (in_w / 2) | (in_h << 16);
|
||||
else
|
||||
val = (in_w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL) | (in_h << 16);
|
||||
val = (in_w / 2 + dev->unite_extend_pixel) | (in_h << 16);
|
||||
reg = stream->config->scale.src_size;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_LEFT);
|
||||
|
||||
@@ -1887,7 +1887,7 @@ static void bilinear_scale(struct rkvpss_stream *stream, bool on, bool sync)
|
||||
reg = stream->config->scale.hc_offs_mi;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_RIGHT);
|
||||
|
||||
val = (in_w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL) | (in_h << 16);
|
||||
val = (in_w / 2 + dev->unite_extend_pixel) | (in_h << 16);
|
||||
reg = stream->config->scale.src_size;
|
||||
rkvpss_idx_write(dev, reg, val, VPSS_UNITE_RIGHT);
|
||||
|
||||
@@ -2749,29 +2749,29 @@ void rkvpss_cmsc_config_v20(struct rkvpss_device *dev, bool sync)
|
||||
win->point[1].x != win->point[2].x) {
|
||||
right_cfg.win[i].win_en &= ~BIT(j);
|
||||
} else {
|
||||
win->point[0].x = RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
win->point[3].x = RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
win->point[0].x = dev->unite_extend_pixel;
|
||||
win->point[3].x = dev->unite_extend_pixel;
|
||||
win->point[1].x = win->point[1].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2)
|
||||
+ RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
+ dev->unite_extend_pixel;
|
||||
win->point[2].x = win->point[2].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2)
|
||||
+ RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
+ dev->unite_extend_pixel;
|
||||
}
|
||||
} else {
|
||||
/** all right **/
|
||||
win->point[0].x = win->point[0].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[1].x = win->point[1].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[2].x = win->point[2].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
win->point[3].x = win->point[3].x -
|
||||
(dev->vpss_sdev.in_fmt.width / 2) +
|
||||
RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
dev->unite_extend_pixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ static int rkvpss_sd_s_stream(struct v4l2_subdev *sd, int on)
|
||||
rkvpss_cmsc_config(dev, true);
|
||||
|
||||
if (dev->unite_mode)
|
||||
w = w / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
w = w / 2 + dev->unite_extend_pixel;
|
||||
|
||||
rkvpss_unite_write(dev, RKVPSS_VPSS_ONLINE2_SIZE, h << 16 | w);
|
||||
|
||||
@@ -236,6 +236,8 @@ static int rkvpss_sd_s_power(struct v4l2_subdev *sd, int on)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
v4l2_subdev_call(dev->remote_sd, core, ioctl, RKISP_VPSS_GET_UNITE_EXTEND_PIXEL,
|
||||
&dev->unite_extend_pixel);
|
||||
v4l2_subdev_call(dev->remote_sd, core, ioctl, RKISP_VPSS_GET_UNITE_MODE,
|
||||
&dev->unite_mode);
|
||||
ret = pm_runtime_get_sync(dev->dev);
|
||||
|
||||
Reference in New Issue
Block a user