public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Amit Grover <amit.grover@samsung.com>
Cc: linux-media@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com,
	k.debski@samsung.com, prabhakar.csengg@gmail.com,
	s.nawrocki@samsung.com, hans.verkuil@cisco.com,
	swaminath.p@samsung.com, jtp.park@samsung.com, Rrob@landley.net,
	andrew.smirnov@gmail.com, anatol.pomozov@gmail.com,
	jmccrohan@gmail.com, joe@perches.com, awalls@md.metrocast.net,
	arun.kk@samsung.com, austin.lobo@samsung.com
Subject: Re: [PATCH v2 2/2] drivers/media: s5p-mfc: Add Horizontal and Vertical MV Search Range
Date: Thu, 30 Jan 2014 08:39:24 +0100	[thread overview]
Message-ID: <52EA01AC.3000706@xs4all.nl> (raw)
In-Reply-To: <1391060563-27015-3-git-send-email-amit.grover@samsung.com>

On 01/30/2014 06:42 AM, Amit Grover wrote:
> This patch adds Controls to set Horizontal and Vertical search range
> for Motion Estimation block for Samsung MFC video Encoders.
> 
> Signed-off-by: Swami Nathan <swaminath.p@samsung.com>
> Signed-off-by: Amit Grover <amit.grover@samsung.com>
> ---
>  drivers/media/platform/s5p-mfc/regs-mfc-v6.h    |    1 +
>  drivers/media/platform/s5p-mfc/s5p_mfc_common.h |    2 ++
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c    |   24 +++++++++++++++++++++++
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c |    8 ++------
>  4 files changed, 29 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h
> index 2398cdf..8d0b686 100644
> --- a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h
> +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h
> @@ -229,6 +229,7 @@
>  #define S5P_FIMV_E_PADDING_CTRL_V6		0xf7a4
>  #define S5P_FIMV_E_MV_HOR_RANGE_V6		0xf7ac
>  #define S5P_FIMV_E_MV_VER_RANGE_V6		0xf7b0
> +#define S5P_FIMV_E_MV_RANGE_V6_MASK		0x3fff
>  
>  #define S5P_FIMV_E_VBV_BUFFER_SIZE_V6		0xf84c
>  #define S5P_FIMV_E_VBV_INIT_DELAY_V6		0xf850
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> index 6920b54..b90ee34 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> @@ -430,6 +430,8 @@ struct s5p_mfc_vp8_enc_params {
>  struct s5p_mfc_enc_params {
>  	u16 width;
>  	u16 height;
> +	u32 mv_h_range;
> +	u32 mv_v_range;
>  
>  	u16 gop_size;
>  	enum v4l2_mpeg_video_multi_slice_mode slice_mode;
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 4ff3b6c..704f30c1 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -208,6 +208,24 @@ static struct mfc_control controls[] = {
>  		.default_value = 0,
>  	},
>  	{
> +		.id = V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE,
> +		.type = V4L2_CTRL_TYPE_INTEGER,
> +		.name = "Horizontal MV Search Range",

Don't set the name here if the control is also defined in v4l2-ctrls.
That way the string from v4l2-ctrls is the leading definition.

Regards,

	Hans

> +		.minimum = 16,
> +		.maximum = 128,
> +		.step = 16,
> +		.default_value = 32,
> +	},
> +	{
> +		.id = V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE,
> +		.type = V4L2_CTRL_TYPE_INTEGER,
> +		.name = "Vertical MV Search Range",
> +		.minimum = 16,
> +		.maximum = 128,
> +		.step = 16,
> +		.default_value = 32,
> +	},
> +	{
>  		.id = V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE,
>  		.type = V4L2_CTRL_TYPE_INTEGER,
>  		.minimum = 0,
> @@ -1377,6 +1395,12 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl)
>  	case V4L2_CID_MPEG_VIDEO_VBV_SIZE:
>  		p->vbv_size = ctrl->val;
>  		break;
> +	case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE:
> +		p->mv_h_range = ctrl->val;
> +		break;
> +	case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE:
> +		p->mv_v_range = ctrl->val;
> +		break;
>  	case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE:
>  		p->codec.h264.cpb_size = ctrl->val;
>  		break;
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
> index 461358c..3c10188 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
> @@ -727,14 +727,10 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx)
>  	WRITEL(reg, S5P_FIMV_E_RC_CONFIG_V6);
>  
>  	/* setting for MV range [16, 256] */
> -	reg = 0;
> -	reg &= ~(0x3FFF);
> -	reg = 256;
> +	reg = (p->mv_h_range & S5P_FIMV_E_MV_RANGE_V6_MASK);
>  	WRITEL(reg, S5P_FIMV_E_MV_HOR_RANGE_V6);
>  
> -	reg = 0;
> -	reg &= ~(0x3FFF);
> -	reg = 256;
> +	reg = (p->mv_v_range & S5P_FIMV_E_MV_RANGE_V6_MASK);
>  	WRITEL(reg, S5P_FIMV_E_MV_VER_RANGE_V6);
>  
>  	WRITEL(0x0, S5P_FIMV_E_FRAME_INSERTION_V6);
> 


  reply	other threads:[~2014-01-30  7:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 10:43 [PATCH] [media] s5p-mfc: Add Horizontal and Vertical search range for Video Macro Blocks Amit Grover
2014-01-23  5:19 ` swaminathan
2014-01-23  5:42   ` Prabhakar Lad
2014-01-23 10:11 ` Kamil Debski
2014-01-23 10:21   ` Sylwester Nawrocki
2014-01-30  5:42     ` [PATCH v2 0/2] drivers/media: Add controls for Horizontal and Vertical MV Search Range Amit Grover
2014-01-30  5:42       ` [PATCH v2 1/2] drivers/media: v4l2: Add settings " Amit Grover
2014-01-30  7:36         ` Hans Verkuil
2014-01-30 15:22           ` Kamil Debski
2014-01-30  5:42       ` [PATCH v2 2/2] drivers/media: s5p-mfc: Add " Amit Grover
2014-01-30  7:39         ` Hans Verkuil [this message]
2014-01-30  6:02       ` [PATCH v2 0/2] drivers/media: Add controls for " Sachin Kamat
2014-02-04  9:59     ` [PATCH v3 " Amit Grover
2014-02-04  9:59       ` [PATCH 1/2] [media] v4l2: Add settings " Amit Grover
2014-02-04 10:13         ` Hans Verkuil
2014-02-06  8:13         ` Prabhakar Lad
2014-02-04  9:59       ` [PATCH 2/2] [media] s5p-mfc: Add " Amit Grover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52EA01AC.3000706@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=Rrob@landley.net \
    --cc=amit.grover@samsung.com \
    --cc=anatol.pomozov@gmail.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=arun.kk@samsung.com \
    --cc=austin.lobo@samsung.com \
    --cc=awalls@md.metrocast.net \
    --cc=hans.verkuil@cisco.com \
    --cc=jmccrohan@gmail.com \
    --cc=joe@perches.com \
    --cc=jtp.park@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=s.nawrocki@samsung.com \
    --cc=swaminath.p@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox