mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
media: rockchip: cif: remove RKMOUDLE_UNITE_EXTEND_PIXEL
Change-Id: Idc265a50c910b6bf9cfb2a0dfeac4a96686ea2fa Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -4024,9 +4024,9 @@ static int rkcif_csi_channel_init(struct rkcif_stream *stream,
|
||||
(dev->hdr.hdr_mode == HDR_X2 && stream->id == 1) ||
|
||||
(dev->hdr.hdr_mode == HDR_X3 && stream->id == 2))) {
|
||||
channel->crop_st_x += channel->width / 2;
|
||||
channel->crop_st_x -= RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
channel->crop_st_x -= dev->unite_extend_pixel;
|
||||
channel->width /= 2;
|
||||
channel->width += RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
channel->width += dev->unite_extend_pixel;
|
||||
}
|
||||
/*
|
||||
* for mipi or lvds, when enable compact, the virtual width of raw10/raw12
|
||||
@@ -5275,9 +5275,9 @@ void rkcif_reinit_right_half_config(struct rkcif_stream *stream)
|
||||
return;
|
||||
}
|
||||
channel->crop_st_x += channel->width / 2;
|
||||
channel->crop_st_x -= RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
channel->crop_st_x -= cif_dev->unite_extend_pixel;
|
||||
channel->width /= 2;
|
||||
channel->width += RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
channel->width += cif_dev->unite_extend_pixel;
|
||||
channel->virtual_width = ALIGN(channel->width * fmt->raw_bpp / 8, 256);
|
||||
if (cif_dev->chip_id < CHIP_RK3576_CIF)
|
||||
rkcif_write_register(cif_dev, get_reg_index_of_id_ctrl1(channel->id),
|
||||
@@ -6271,7 +6271,7 @@ static u32 rkcif_get_right_half_buf_size(struct rkcif_stream *stream)
|
||||
height = stream->pixm.height;
|
||||
}
|
||||
width /= 2;
|
||||
width += RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
width += stream->cifdev->unite_extend_pixel;
|
||||
if (stream->is_compact)
|
||||
virtual_width = ALIGN(width * stream->cif_fmt_out->raw_bpp / 8, 256);
|
||||
else
|
||||
@@ -14934,6 +14934,17 @@ void rkcif_switch_change(struct rkcif_device *cif_dev, bool is_switch)
|
||||
}
|
||||
}
|
||||
|
||||
void rkcif_update_unite_extend_pixel(struct rkcif_device *cif_dev)
|
||||
{
|
||||
struct v4l2_subdev *sd = get_rkisp_sd(cif_dev->sditf[0]);
|
||||
|
||||
if (!sd)
|
||||
return;
|
||||
v4l2_subdev_call(sd, core, ioctl,
|
||||
RKISP_VICAP_CMD_GET_UNITE_EXTEND_PIXEL,
|
||||
&cif_dev->unite_extend_pixel);
|
||||
}
|
||||
|
||||
/* pingpong irq for rk3588 and next */
|
||||
void rkcif_irq_pingpong_v1(struct rkcif_device *cif_dev)
|
||||
{
|
||||
|
||||
@@ -3209,6 +3209,7 @@ static int rkcif_plat_probe(struct platform_device *pdev)
|
||||
|
||||
dev_set_drvdata(dev, cif_dev);
|
||||
cif_dev->dev = dev;
|
||||
cif_dev->unite_extend_pixel = 128;
|
||||
|
||||
if (sysfs_create_group(&pdev->dev.kobj, &dev_attr_grp))
|
||||
return -ENODEV;
|
||||
|
||||
@@ -1073,6 +1073,7 @@ struct rkcif_device {
|
||||
u32 pre_buf_addr[MAX_PRE_BUF_NUM];
|
||||
u64 pre_buf_timestamp[MAX_PRE_BUF_NUM];
|
||||
u32 dvp_pin_group;
|
||||
u32 unite_extend_pixel;
|
||||
struct rkcif_switch_info switch_info;
|
||||
};
|
||||
|
||||
@@ -1202,4 +1203,5 @@ void rkcif_set_sensor_streamon_in_sync_mode(struct rkcif_device *cif_dev);
|
||||
int rkcif_sensor_set_power(struct rkcif_stream *stream, int on);
|
||||
void rkcif_switch_change(struct rkcif_device *cif_dev, bool is_switch);
|
||||
|
||||
void rkcif_update_unite_extend_pixel(struct rkcif_device *cif_dev);
|
||||
#endif
|
||||
|
||||
@@ -216,7 +216,7 @@ static int sditf_get_set_fmt(struct v4l2_subdev *sd,
|
||||
|
||||
out_fmt = rkcif_find_output_fmt(NULL, pixm.pixelformat);
|
||||
if (priv->toisp_inf.link_mode == TOISP_UNITE &&
|
||||
((pixm.width / 2 - RKMOUDLE_UNITE_EXTEND_PIXEL) * out_fmt->raw_bpp / 8) & 0xf)
|
||||
((pixm.width / 2 - cif_dev->unite_extend_pixel) * out_fmt->raw_bpp / 8) & 0xf)
|
||||
is_uncompact = true;
|
||||
|
||||
v4l2_dbg(1, rkcif_debug, &cif_dev->v4l2_dev,
|
||||
@@ -808,7 +808,7 @@ static int sditf_channel_enable_rv1103b(struct sditf_priv *priv, int user)
|
||||
if (capture_info->mode == RKMODULE_MULTI_DEV_COMBINE_ONE &&
|
||||
priv->toisp_inf.link_mode == TOISP_UNITE) {
|
||||
if (capture_info->multi_dev.dev_num != 2 ||
|
||||
capture_info->multi_dev.pixel_offset != RKMOUDLE_UNITE_EXTEND_PIXEL) {
|
||||
capture_info->multi_dev.pixel_offset != cif_dev->unite_extend_pixel) {
|
||||
v4l2_err(&cif_dev->v4l2_dev,
|
||||
"param error of online mode, combine dev num %d, offset %d\n",
|
||||
capture_info->multi_dev.dev_num,
|
||||
@@ -879,9 +879,9 @@ static int sditf_channel_enable_rv1103b(struct sditf_priv *priv, int user)
|
||||
if (user == 0) {
|
||||
if (priv->mode.rdbk_mode == RKISP_VICAP_ONLINE_UNITE) {
|
||||
width /= 2;
|
||||
width += RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
width += cif_dev->unite_extend_pixel;
|
||||
} else if (priv->toisp_inf.link_mode == TOISP_UNITE) {
|
||||
width = priv->cap_info.width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
width = priv->cap_info.width / 2 + cif_dev->unite_extend_pixel;
|
||||
}
|
||||
rkcif_write_register(cif_dev, CIF_REG_TOISP0_CTRL, ctrl_ch0);
|
||||
rkcif_write_register(cif_dev, CIF_REG_TOISP0_CROP,
|
||||
@@ -936,7 +936,7 @@ static int sditf_channel_enable(struct sditf_priv *priv, int user)
|
||||
if (capture_info->mode == RKMODULE_MULTI_DEV_COMBINE_ONE &&
|
||||
priv->toisp_inf.link_mode == TOISP_UNITE) {
|
||||
if (capture_info->multi_dev.dev_num != 2 ||
|
||||
capture_info->multi_dev.pixel_offset != RKMOUDLE_UNITE_EXTEND_PIXEL) {
|
||||
capture_info->multi_dev.pixel_offset != cif_dev->unite_extend_pixel) {
|
||||
v4l2_err(&cif_dev->v4l2_dev,
|
||||
"param error of online mode, combine dev num %d, offset %d\n",
|
||||
capture_info->multi_dev.dev_num,
|
||||
@@ -1013,7 +1013,7 @@ static int sditf_channel_enable(struct sditf_priv *priv, int user)
|
||||
ctrl_val |= BIT(28);
|
||||
if (user == 0) {
|
||||
if (priv->toisp_inf.link_mode == TOISP_UNITE)
|
||||
width = priv->cap_info.width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
width = priv->cap_info.width / 2 + cif_dev->unite_extend_pixel;
|
||||
rkcif_write_register(cif_dev, CIF_REG_TOISP0_CTRL, ctrl_val);
|
||||
if (width && height) {
|
||||
rkcif_write_register(cif_dev, CIF_REG_TOISP0_CROP,
|
||||
@@ -1028,8 +1028,8 @@ static int sditf_channel_enable(struct sditf_priv *priv, int user)
|
||||
if (capture_info->mode == RKMODULE_MULTI_DEV_COMBINE_ONE)
|
||||
offset_x = 0;
|
||||
else
|
||||
offset_x = priv->cap_info.width / 2 - RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
width = priv->cap_info.width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL;
|
||||
offset_x = priv->cap_info.width / 2 - cif_dev->unite_extend_pixel;
|
||||
width = priv->cap_info.width / 2 + cif_dev->unite_extend_pixel;
|
||||
}
|
||||
rkcif_write_register(cif_dev, CIF_REG_TOISP1_CTRL, ctrl_val);
|
||||
if (width && height) {
|
||||
@@ -1322,6 +1322,8 @@ static int sditf_s_power(struct v4l2_subdev *sd, int on)
|
||||
if (on && atomic_inc_return(&priv->power_cnt) > 1)
|
||||
return 0;
|
||||
|
||||
if (on)
|
||||
rkcif_update_unite_extend_pixel(cif_dev);
|
||||
if (cif_dev->chip_id >= CHIP_RK3588_CIF) {
|
||||
v4l2_dbg(1, rkcif_debug, &cif_dev->v4l2_dev,
|
||||
"%s, toisp mode %d, hdr %d, set power %d\n",
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
#define RKMODULE_API_VERSION KERNEL_VERSION(0, 1, 0x2)
|
||||
|
||||
/* using for rk3588 dual isp unite */
|
||||
#define RKMOUDLE_UNITE_EXTEND_PIXEL 128
|
||||
/* using for rv1109 and rv1126 */
|
||||
#define RKMODULE_EXTEND_LINE 24
|
||||
|
||||
|
||||
Reference in New Issue
Block a user