Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-11 Thread Smitha T Murthy
On Tue, 2017-04-11 at 11:00 +0200, Sylwester Nawrocki wrote:
> Hi,
> 
> On 04/03/2017 08:17 AM, Smitha T Murthy wrote:
> > On Mon, 2017-04-03 at 08:00 +0200, Julia Lawall wrote:
> >> See line 2101
> >>
> >> julia
> >>
> > Thank you for bringing it to my notice, I had not checked on this git.
> > I will upload the next version of patches soon corresponding to this
> > git.
> 
> In general please use the media master branch as a base for your patches
> (git://linuxtv.org/media_tree.git master). Or latest branch in my
> git repository, currently it's "for-v4.12/media/next-2" as can be seen
> here: https://git.linuxtv.org/snawrocki/samsung.git
> 
I have submitted the next version(v4) of mfcv10.10 patches based on
git://linuxtv.org/snawrocki/samsung.git for-v4.12/media/next. But I will
keep this in mind next time I submit fresh patches. Thank you for the
information :)

Regards,
Smitha



Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-11 Thread Sylwester Nawrocki

On 04/11/2017 11:23 AM, Julia Lawall wrote:

On Tue, 11 Apr 2017, Sylwester Nawrocki wrote:

Hi,

On 04/03/2017 08:17 AM, Smitha T Murthy wrote:

On Mon, 2017-04-03 at 08:00 +0200, Julia Lawall wrote:

See line 2101

julia


Thank you for bringing it to my notice, I had not checked on this git.
I will upload the next version of patches soon corresponding to this
git.

In general please use the media master branch as a base for your patches
(git://linuxtv.org/media_tree.git master). Or latest branch in my
git repository, currently it's "for-v4.12/media/next-2" as can be seen
here: https://git.linuxtv.org/snawrocki/samsung.git

>

I'm not making the patch.  It comes to me from kbuild.  If you would
prefer some tree not to be included, you can notify Fengguang about this:


Oops, my message was addressed to Smitha only, apologies for the confusion.
kbuild works fine. Thank you for your efforts.

--
Regards,
Sylwester


Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-11 Thread Julia Lawall


On Tue, 11 Apr 2017, Sylwester Nawrocki wrote:

> Hi,
>
> On 04/03/2017 08:17 AM, Smitha T Murthy wrote:
> > On Mon, 2017-04-03 at 08:00 +0200, Julia Lawall wrote:
> > > See line 2101
> > >
> > > julia
> > >
> > Thank you for bringing it to my notice, I had not checked on this git.
> > I will upload the next version of patches soon corresponding to this
> > git.
>
> In general please use the media master branch as a base for your patches
> (git://linuxtv.org/media_tree.git master). Or latest branch in my
> git repository, currently it's "for-v4.12/media/next-2" as can be seen
> here: https://git.linuxtv.org/snawrocki/samsung.git

I'm not making the patch.  It comes to me from kbuild.  If you would
prefer some tree not to be included, you can notify Fengguang about this:

fengguang...@intel.com

julia

>
> --
> Thanks,
> Sylwester
>


Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-11 Thread Sylwester Nawrocki

Hi,

On 04/03/2017 08:17 AM, Smitha T Murthy wrote:

On Mon, 2017-04-03 at 08:00 +0200, Julia Lawall wrote:

See line 2101

julia


Thank you for bringing it to my notice, I had not checked on this git.
I will upload the next version of patches soon corresponding to this
git.


In general please use the media master branch as a base for your patches
(git://linuxtv.org/media_tree.git master). Or latest branch in my
git repository, currently it's "for-v4.12/media/next-2" as can be seen
here: https://git.linuxtv.org/snawrocki/samsung.git

--
Thanks,
Sylwester


Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder

2017-04-03 Thread Smitha T Murthy
On Mon, 2017-04-03 at 10:59 +0200, Andrzej Hajda wrote:
> On 31.03.2017 11:06, Smitha T Murthy wrote:
> > Add HEVC encoder support and necessary registers, V4L2 CIDs,
> > and hevc encoder parameters
> >
> > Signed-off-by: Smitha T Murthy 
> > ---
> >  drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  28 +-
> >  drivers/media/platform/s5p-mfc/s5p_mfc.c|   1 +
> >  drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
> >  drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  57 ++-
> >  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c| 595 
> > 
> >  drivers/media/platform/s5p-mfc/s5p_mfc_opr.h|   8 +
> >  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 194 
> >  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |   8 +
> >  8 files changed, 892 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h 
> > b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> > index 6754477..7065b9d 100644
> > --- a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> > +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> > @@ -20,13 +20,35 @@
> >  #define S5P_FIMV_MFC_STATE_V10 0x7124
> >  #define S5P_FIMV_D_STATIC_BUFFER_ADDR_V10  0xF570
> >  #define S5P_FIMV_D_STATIC_BUFFER_SIZE_V10  0xF574
> > +#define S5P_FIMV_E_NUM_T_LAYER_V10 0xFBAC
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER0_V10  0xFBB0
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER1_V10  0xFBB4
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER2_V10  0xFBB8
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER3_V10  0xFBBC
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER4_V10  0xFBC0
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER5_V10  0xFBC4
> > +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER6_V10  0xFBC8
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0_V100xFD18
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER1_V100xFD1C
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER2_V100xFD20
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER3_V100xFD24
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER4_V100xFD28
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER5_V100xFD2C
> > +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER6_V100xFD30
> > +#define S5P_FIMV_E_HEVC_OPTIONS_V100xFDD4
> > +#define S5P_FIMV_E_HEVC_REFRESH_PERIOD_V10 0xFDD8
> > +#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET_V10   0xFDDC
> > +#define S5P_FIMV_E_HEVC_LF_BETA_OFFSET_DIV2_V100xFDE0
> > +#define S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V10  0xFDE4
> > +#define S5P_FIMV_E_HEVC_NAL_CONTROL_V100xFDE8
> >  
> >  /* MFCv10 Context buffer sizes */
> >  #define MFC_CTX_BUF_SIZE_V10   (30 * SZ_1K)
> >  #define MFC_H264_DEC_CTX_BUF_SIZE_V10  (2 * SZ_1M)
> >  #define MFC_OTHER_DEC_CTX_BUF_SIZE_V10 (20 * SZ_1K)
> >  #define MFC_H264_ENC_CTX_BUF_SIZE_V10  (100 * SZ_1K)
> > -#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10 (15 * SZ_1K)
> > +#define MFC_HEVC_ENC_CTX_BUF_SIZE_V10  (30 * SZ_1K)
> > +#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10  (15 * SZ_1K)
> >  
> >  /* MFCv10 variant defines */
> >  #define MAX_FW_SIZE_V10(SZ_1M)
> > @@ -58,5 +80,9 @@
> >  #define ENC_V100_VP8_ME_SIZE(x, y) \
> > ENC_V100_BASE_SIZE(x, y)
> >  
> > +#define ENC_V100_HEVC_ME_SIZE(x, y)\
> > +   (((x + 3) * (y + 3) * 32)   \
> > ++ ((y * 128) + 1280) * DIV_ROUND_UP(x, 4))
> > +
> >  #endif /*_REGS_MFC_V10_H*/
> >  
> > diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
> > b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> > index 399c547..b3862d1 100644
> > --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> > @@ -1554,6 +1554,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
> > .h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V10,
> > .other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V10,
> > .h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V10,
> > +   .hevc_enc_ctx   = MFC_HEVC_ENC_CTX_BUF_SIZE_V10,
> > .other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
> >  };
> >  
> > diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c 
> > b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> > index 102b47e..7521fce 100644
> > --- a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> > @@ -122,6 +122,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx 
> > *ctx)
> > case S5P_MFC_CODEC_VP8_ENC:
> > codec_type = S5P_FIMV_CODEC_VP8_ENC_V7;
> > break;
> > +   case S5P_MFC_CODEC_HEVC_ENC:
> > +   codec_type = S5P_FIMV_CODEC_HEVC_ENC;
> > +   break;
> > default:
> > codec_type = S5P_FIMV_CODEC_NONE_V6;
> > }
> > diff --git 

Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder

2017-04-03 Thread Andrzej Hajda
On 31.03.2017 11:06, Smitha T Murthy wrote:
> Add HEVC encoder support and necessary registers, V4L2 CIDs,
> and hevc encoder parameters
>
> Signed-off-by: Smitha T Murthy 
> ---
>  drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  28 +-
>  drivers/media/platform/s5p-mfc/s5p_mfc.c|   1 +
>  drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
>  drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  57 ++-
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c| 595 
> 
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr.h|   8 +
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 194 
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |   8 +
>  8 files changed, 892 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h 
> b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> index 6754477..7065b9d 100644
> --- a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> @@ -20,13 +20,35 @@
>  #define S5P_FIMV_MFC_STATE_V10   0x7124
>  #define S5P_FIMV_D_STATIC_BUFFER_ADDR_V100xF570
>  #define S5P_FIMV_D_STATIC_BUFFER_SIZE_V100xF574
> +#define S5P_FIMV_E_NUM_T_LAYER_V10   0xFBAC
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER0_V100xFBB0
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER1_V100xFBB4
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER2_V100xFBB8
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER3_V100xFBBC
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER4_V100xFBC0
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER5_V100xFBC4
> +#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER6_V100xFBC8
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0_V10  0xFD18
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER1_V10  0xFD1C
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER2_V10  0xFD20
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER3_V10  0xFD24
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER4_V10  0xFD28
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER5_V10  0xFD2C
> +#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER6_V10  0xFD30
> +#define S5P_FIMV_E_HEVC_OPTIONS_V10  0xFDD4
> +#define S5P_FIMV_E_HEVC_REFRESH_PERIOD_V10   0xFDD8
> +#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET_V10 0xFDDC
> +#define S5P_FIMV_E_HEVC_LF_BETA_OFFSET_DIV2_V10  0xFDE0
> +#define S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V100xFDE4
> +#define S5P_FIMV_E_HEVC_NAL_CONTROL_V10  0xFDE8
>  
>  /* MFCv10 Context buffer sizes */
>  #define MFC_CTX_BUF_SIZE_V10 (30 * SZ_1K)
>  #define MFC_H264_DEC_CTX_BUF_SIZE_V10(2 * SZ_1M)
>  #define MFC_OTHER_DEC_CTX_BUF_SIZE_V10   (20 * SZ_1K)
>  #define MFC_H264_ENC_CTX_BUF_SIZE_V10(100 * SZ_1K)
> -#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10   (15 * SZ_1K)
> +#define MFC_HEVC_ENC_CTX_BUF_SIZE_V10(30 * SZ_1K)
> +#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10  (15 * SZ_1K)
>  
>  /* MFCv10 variant defines */
>  #define MAX_FW_SIZE_V10  (SZ_1M)
> @@ -58,5 +80,9 @@
>  #define ENC_V100_VP8_ME_SIZE(x, y) \
>   ENC_V100_BASE_SIZE(x, y)
>  
> +#define ENC_V100_HEVC_ME_SIZE(x, y)  \
> + (((x + 3) * (y + 3) * 32)   \
> +  + ((y * 128) + 1280) * DIV_ROUND_UP(x, 4))
> +
>  #endif /*_REGS_MFC_V10_H*/
>  
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 399c547..b3862d1 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1554,6 +1554,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
>   .h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V10,
>   .other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V10,
>   .h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V10,
> + .hevc_enc_ctx   = MFC_HEVC_ENC_CTX_BUF_SIZE_V10,
>   .other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
>  };
>  
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> index 102b47e..7521fce 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
> @@ -122,6 +122,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx 
> *ctx)
>   case S5P_MFC_CODEC_VP8_ENC:
>   codec_type = S5P_FIMV_CODEC_VP8_ENC_V7;
>   break;
> + case S5P_MFC_CODEC_HEVC_ENC:
> + codec_type = S5P_FIMV_CODEC_HEVC_ENC;
> + break;
>   default:
>   codec_type = S5P_FIMV_CODEC_NONE_V6;
>   }
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> index 4082079..ad06e45 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> @@ -68,7 +68,7 @@ static 

Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-03 Thread Smitha T Murthy
On Mon, 2017-04-03 at 08:00 +0200, Julia Lawall wrote:
> See line 2101
> 
> julia
> 
Thank you for bringing it to my notice, I had not checked on this git.
I will upload the next version of patches soon corresponding to this
git.

Thanks,
Smitha
> - Forwarded message --
> Date: Mon, 3 Apr 2017 05:04:39 +0800
> From: kbuild test robot <fengguang...@intel.com>
> To: kbu...@01.org
> Cc: Julia Lawall <julia.law...@lip6.fr>
> Subject: Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder
> 
> Hi Smitha,
> 
> [auto build test WARNING on linuxtv-media/master]
> [also build test WARNING on v4.11-rc4 next-20170331]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Smitha-T-Murthy/Add-MFC-v10-10-support/20170403-033620
> base:   git://linuxtv.org/media_tree.git master
> :: branch date: 88 minutes ago
> :: commit date: 88 minutes ago
> 
> >> drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:2101:6-25: WARNING: Unsigned 
> >> expression compared with zero: p -> codec . hevc . level < 0
> 
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout bca072db65317d79554527391338ce8bc6fbde58
> vim +2101 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> 
> bca072db Smitha T Murthy 2017-03-31  2085 break;
> bca072db Smitha T Murthy 2017-03-31  2086 case 
> V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP:
> bca072db Smitha T Murthy 2017-03-31  2087 
> p->codec.hevc.rc_b_frame_qp = ctrl->val;
> bca072db Smitha T Murthy 2017-03-31  2088 break;
> bca072db Smitha T Murthy 2017-03-31  2089 case 
> V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION:
> bca072db Smitha T Murthy 2017-03-31  2090 
> p->codec.hevc.rc_framerate = ctrl->val;
> bca072db Smitha T Murthy 2017-03-31  2091 break;
> bca072db Smitha T Murthy 2017-03-31  2092 case 
> V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP:
> bca072db Smitha T Murthy 2017-03-31  2093 p->codec.hevc.rc_min_qp 
> = ctrl->val;
> bca072db Smitha T Murthy 2017-03-31  2094 break;
> bca072db Smitha T Murthy 2017-03-31  2095 case 
> V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP:
> bca072db Smitha T Murthy 2017-03-31  2096 p->codec.hevc.rc_max_qp 
> = ctrl->val;
> bca072db Smitha T Murthy 2017-03-31  2097 break;
> bca072db Smitha T Murthy 2017-03-31  2098 case 
> V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
> bca072db Smitha T Murthy 2017-03-31  2099 
> p->codec.hevc.level_v4l2 = ctrl->val;
> bca072db Smitha T Murthy 2017-03-31  2100 p->codec.hevc.level = 
> hevc_level(ctrl->val);
> bca072db Smitha T Murthy 2017-03-31 @2101 if (p->codec.hevc.level 
> < 0) {
> bca072db Smitha T Murthy 2017-03-31  2102 mfc_err("Level 
> number is wrong\n");
> bca072db Smitha T Murthy 2017-03-31  2103 ret = 
> p->codec.hevc.level;
> bca072db Smitha T Murthy 2017-03-31  2104 }
> bca072db Smitha T Murthy 2017-03-31  2105 break;
> bca072db Smitha T Murthy 2017-03-31  2106 case 
> V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
> bca072db Smitha T Murthy 2017-03-31  2107 switch (ctrl->val) {
> bca072db Smitha T Murthy 2017-03-31  2108 case 
> V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN:
> bca072db Smitha T Murthy 2017-03-31  2109 ctrl->val = 
> V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN;
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 
> 




Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder (fwd)

2017-04-03 Thread Julia Lawall
See line 2101

julia

- Forwarded message --
Date: Mon, 3 Apr 2017 05:04:39 +0800
From: kbuild test robot <fengguang...@intel.com>
To: kbu...@01.org
Cc: Julia Lawall <julia.law...@lip6.fr>
Subject: Re: [Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder

Hi Smitha,

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.11-rc4 next-20170331]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Smitha-T-Murthy/Add-MFC-v10-10-support/20170403-033620
base:   git://linuxtv.org/media_tree.git master
:: branch date: 88 minutes ago
:: commit date: 88 minutes ago

>> drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:2101:6-25: WARNING: Unsigned 
>> expression compared with zero: p -> codec . hevc . level < 0

git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout bca072db65317d79554527391338ce8bc6fbde58
vim +2101 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

bca072db Smitha T Murthy 2017-03-31  2085   break;
bca072db Smitha T Murthy 2017-03-31  2086   case 
V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP:
bca072db Smitha T Murthy 2017-03-31  2087   
p->codec.hevc.rc_b_frame_qp = ctrl->val;
bca072db Smitha T Murthy 2017-03-31  2088   break;
bca072db Smitha T Murthy 2017-03-31  2089   case 
V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION:
bca072db Smitha T Murthy 2017-03-31  2090   
p->codec.hevc.rc_framerate = ctrl->val;
bca072db Smitha T Murthy 2017-03-31  2091   break;
bca072db Smitha T Murthy 2017-03-31  2092   case 
V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP:
bca072db Smitha T Murthy 2017-03-31  2093   p->codec.hevc.rc_min_qp 
= ctrl->val;
bca072db Smitha T Murthy 2017-03-31  2094   break;
bca072db Smitha T Murthy 2017-03-31  2095   case 
V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP:
bca072db Smitha T Murthy 2017-03-31  2096   p->codec.hevc.rc_max_qp 
= ctrl->val;
bca072db Smitha T Murthy 2017-03-31  2097   break;
bca072db Smitha T Murthy 2017-03-31  2098   case 
V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
bca072db Smitha T Murthy 2017-03-31  2099   
p->codec.hevc.level_v4l2 = ctrl->val;
bca072db Smitha T Murthy 2017-03-31  2100   p->codec.hevc.level = 
hevc_level(ctrl->val);
bca072db Smitha T Murthy 2017-03-31 @2101   if (p->codec.hevc.level 
< 0) {
bca072db Smitha T Murthy 2017-03-31  2102   mfc_err("Level 
number is wrong\n");
bca072db Smitha T Murthy 2017-03-31  2103   ret = 
p->codec.hevc.level;
bca072db Smitha T Murthy 2017-03-31  2104   }
bca072db Smitha T Murthy 2017-03-31  2105   break;
bca072db Smitha T Murthy 2017-03-31  2106   case 
V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
bca072db Smitha T Murthy 2017-03-31  2107   switch (ctrl->val) {
bca072db Smitha T Murthy 2017-03-31  2108   case 
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN:
bca072db Smitha T Murthy 2017-03-31  2109   ctrl->val = 
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


[Patch v3 10/11] [media] s5p-mfc: Add support for HEVC encoder

2017-03-31 Thread Smitha T Murthy
Add HEVC encoder support and necessary registers, V4L2 CIDs,
and hevc encoder parameters

Signed-off-by: Smitha T Murthy 
---
 drivers/media/platform/s5p-mfc/regs-mfc-v10.h   |  28 +-
 drivers/media/platform/s5p-mfc/s5p_mfc.c|   1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |  57 ++-
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c| 595 
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h|   8 +
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 194 
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h |   8 +
 8 files changed, 892 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h 
b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
index 6754477..7065b9d 100644
--- a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
+++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
@@ -20,13 +20,35 @@
 #define S5P_FIMV_MFC_STATE_V10 0x7124
 #define S5P_FIMV_D_STATIC_BUFFER_ADDR_V10  0xF570
 #define S5P_FIMV_D_STATIC_BUFFER_SIZE_V10  0xF574
+#define S5P_FIMV_E_NUM_T_LAYER_V10 0xFBAC
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER0_V10  0xFBB0
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER1_V10  0xFBB4
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER2_V10  0xFBB8
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER3_V10  0xFBBC
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER4_V10  0xFBC0
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER5_V10  0xFBC4
+#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER6_V10  0xFBC8
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0_V100xFD18
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER1_V100xFD1C
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER2_V100xFD20
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER3_V100xFD24
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER4_V100xFD28
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER5_V100xFD2C
+#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER6_V100xFD30
+#define S5P_FIMV_E_HEVC_OPTIONS_V100xFDD4
+#define S5P_FIMV_E_HEVC_REFRESH_PERIOD_V10 0xFDD8
+#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET_V10   0xFDDC
+#define S5P_FIMV_E_HEVC_LF_BETA_OFFSET_DIV2_V100xFDE0
+#define S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V10  0xFDE4
+#define S5P_FIMV_E_HEVC_NAL_CONTROL_V100xFDE8
 
 /* MFCv10 Context buffer sizes */
 #define MFC_CTX_BUF_SIZE_V10   (30 * SZ_1K)
 #define MFC_H264_DEC_CTX_BUF_SIZE_V10  (2 * SZ_1M)
 #define MFC_OTHER_DEC_CTX_BUF_SIZE_V10 (20 * SZ_1K)
 #define MFC_H264_ENC_CTX_BUF_SIZE_V10  (100 * SZ_1K)
-#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10 (15 * SZ_1K)
+#define MFC_HEVC_ENC_CTX_BUF_SIZE_V10  (30 * SZ_1K)
+#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10  (15 * SZ_1K)
 
 /* MFCv10 variant defines */
 #define MAX_FW_SIZE_V10(SZ_1M)
@@ -58,5 +80,9 @@
 #define ENC_V100_VP8_ME_SIZE(x, y) \
ENC_V100_BASE_SIZE(x, y)
 
+#define ENC_V100_HEVC_ME_SIZE(x, y)\
+   (((x + 3) * (y + 3) * 32)   \
++ ((y * 128) + 1280) * DIV_ROUND_UP(x, 4))
+
 #endif /*_REGS_MFC_V10_H*/
 
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 399c547..b3862d1 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1554,6 +1554,7 @@ static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
.h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V10,
.other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V10,
.h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V10,
+   .hevc_enc_ctx   = MFC_HEVC_ENC_CTX_BUF_SIZE_V10,
.other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
 };
 
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
index 102b47e..7521fce 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v6.c
@@ -122,6 +122,9 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
case S5P_MFC_CODEC_VP8_ENC:
codec_type = S5P_FIMV_CODEC_VP8_ENC_V7;
break;
+   case S5P_MFC_CODEC_HEVC_ENC:
+   codec_type = S5P_FIMV_CODEC_HEVC_ENC;
+   break;
default:
codec_type = S5P_FIMV_CODEC_NONE_V6;
}
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 4082079..ad06e45 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -68,7 +68,7 @@ static inline dma_addr_t s5p_mfc_mem_cookie(void *a, void *b)
 #define MFC_ENC_CAP_PLANE_COUNT1
 #define MFC_ENC_OUT_PLANE_COUNT2
 #define STUFF_BYTE 4
-#define MFC_MAX_CTRLS  77
+#define MFC_MAX_CTRLS  128
 
 #define