diff options
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/ipu3/ipu_device.c | 40 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_ic.c | 29 |
2 files changed, 59 insertions, 10 deletions
diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c index 4c98d4c7edd3..4ac6fc77ca79 100644 --- a/drivers/mxc/ipu3/ipu_device.c +++ b/drivers/mxc/ipu3/ipu_device.c @@ -374,6 +374,46 @@ static int mxc_ipu_ioctl(struct inode *inode, struct file *file, ret = 0; } break; + case IPU_CALC_STRIPES_SIZE: + { + ipu_stripe_parm stripe_parm; + + if (copy_from_user (&stripe_parm, (ipu_stripe_parm *)arg, + sizeof(ipu_stripe_parm))) + return -EFAULT; + ipu_calc_stripes_sizes(stripe_parm.input_width, + stripe_parm.output_width, + stripe_parm.maximal_stripe_width, + stripe_parm.cirr, + stripe_parm.equal_stripes, + stripe_parm.input_pixelformat, + stripe_parm.output_pixelformat, + &stripe_parm.left, + &stripe_parm.right); + if (copy_to_user((ipu_stripe_parm *) arg, &stripe_parm, + sizeof(ipu_stripe_parm)) > 0) + return -EFAULT; + } + break; + case IPU_UPDATE_BUF_OFFSET: + { + ipu_buf_offset_parm offset_parm; + + if (copy_from_user (&offset_parm, (ipu_buf_offset_parm *)arg, + sizeof(ipu_buf_offset_parm))) + return -EFAULT; + ret = ipu_update_channel_offset(offset_parm.channel, + offset_parm.type, + offset_parm.pixel_fmt, + offset_parm.width, + offset_parm.height, + offset_parm.stride, + offset_parm.u_offset, + offset_parm.v_offset, + offset_parm.vertical_offset, + offset_parm.horizontal_offset); + } + break; default: break; } diff --git a/drivers/mxc/ipu3/ipu_ic.c b/drivers/mxc/ipu3/ipu_ic.c index 1a4bda3f071a..564fab0b699a 100644 --- a/drivers/mxc/ipu3/ipu_ic.c +++ b/drivers/mxc/ipu3/ipu_ic.c @@ -226,10 +226,14 @@ void _ipu_ic_init_prpvf(ipu_channel_params_t *params, bool src_is_csi) reg = (downsizeCoeff << 30) | (resizeCoeff << 16); /* Setup horizontal resizing */ - _calc_resize_coeffs(params->mem_prp_vf_mem.in_width, - params->mem_prp_vf_mem.out_width, - &resizeCoeff, &downsizeCoeff); - reg |= (downsizeCoeff << 14) | resizeCoeff; + /* Upadeted for IC split case */ + if (!(params->mem_prp_vf_mem.out_resize_ratio)) { + _calc_resize_coeffs(params->mem_prp_vf_mem.in_width, + params->mem_prp_vf_mem.out_width, + &resizeCoeff, &downsizeCoeff); + reg |= (downsizeCoeff << 14) | resizeCoeff; + } else + reg |= params->mem_prp_vf_mem.out_resize_ratio; __raw_writel(reg, IC_PRP_VF_RSC); @@ -344,10 +348,14 @@ void _ipu_ic_init_prpenc(ipu_channel_params_t *params, bool src_is_csi) reg = (downsizeCoeff << 30) | (resizeCoeff << 16); /* Setup horizontal resizing */ - _calc_resize_coeffs(params->mem_prp_enc_mem.in_width, - params->mem_prp_enc_mem.out_width, - &resizeCoeff, &downsizeCoeff); - reg |= (downsizeCoeff << 14) | resizeCoeff; + /* Upadeted for IC split case */ + if (!(params->mem_prp_enc_mem.out_resize_ratio)) { + _calc_resize_coeffs(params->mem_prp_enc_mem.in_width, + params->mem_prp_enc_mem.out_width, + &resizeCoeff, &downsizeCoeff); + reg |= (downsizeCoeff << 14) | resizeCoeff; + } else + reg |= params->mem_prp_enc_mem.out_resize_ratio; __raw_writel(reg, IC_PRP_ENC_RSC); @@ -416,14 +424,15 @@ void _ipu_ic_init_pp(ipu_channel_params_t *params) reg = (downsizeCoeff << 30) | (resizeCoeff << 16); /* Setup horizontal resizing */ - /* Upadeted for IC split case */ + /* Upadeted for IC split case */ if (!(params->mem_pp_mem.out_resize_ratio)) { _calc_resize_coeffs(params->mem_pp_mem.in_width, params->mem_pp_mem.out_width, &resizeCoeff, &downsizeCoeff); reg |= (downsizeCoeff << 14) | resizeCoeff; - } else + } else { reg |= params->mem_pp_mem.out_resize_ratio; + } __raw_writel(reg, IC_PP_RSC); |