linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: smitha.t@samsung.com (Smitha T Murthy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/11] [media] s5p-mfc: Adding initial support for MFC v10.10
Date: Tue, 31 Jan 2017 14:42:15 +0530	[thread overview]
Message-ID: <1485853935.16927.22.camel@smitha-fedora> (raw)
In-Reply-To: <ec5c2602-627e-7a42-eda2-6a68b846fff8@samsung.com>

On Wed, 2017-01-18 at 16:10 +0100, Andrzej Hajda wrote:
> On 18.01.2017 11:02, Smitha T Murthy wrote:
> > Adding the support for MFC v10.10, with new register file and
> > necessary hw control, decoder, encoder and structural changes.
> >
> > CC: Rob Herring <robh+dt@kernel.org>
> > CC: devicetree at vger.kernel.org 
> > Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> > ---
> >  .../devicetree/bindings/media/s5p-mfc.txt          |    1 +
> >  drivers/media/platform/s5p-mfc/regs-mfc-v10.h      |   36 ++++++++++++++++
> >  drivers/media/platform/s5p-mfc/s5p_mfc.c           |   30 +++++++++++++
> >  drivers/media/platform/s5p-mfc/s5p_mfc_common.h    |    4 +-
> >  drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c      |    4 ++
> >  drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |   44 +++++++++++---------
> >  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c       |   21 +++++----
> >  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c    |    9 +++-
> >  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h    |    2 +
> >  9 files changed, 118 insertions(+), 33 deletions(-)
> >  create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> >
> > diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt b/Documentation/devicetree/bindings/media/s5p-mfc.txt
> > index 2c90128..b70c613 100644
> > --- a/Documentation/devicetree/bindings/media/s5p-mfc.txt
> > +++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt
> > @@ -13,6 +13,7 @@ Required properties:
> >  	(c) "samsung,mfc-v7" for MFC v7 present in Exynos5420 SoC
> >  	(d) "samsung,mfc-v8" for MFC v8 present in Exynos5800 SoC
> >  	(e) "samsung,exynos5433-mfc" for MFC v8 present in Exynos5433 SoC
> > +	(f) "samsung,mfc-v10" for MFC v10 present in a variant of Exynos7 SoC
> 
> Could you specify explicitly SoC version(s), Exynos7 is misleading.
> Btw are there plans to upstream platforms using this MFC?

MFCv10.10 is used in Exynos7880. There are other variants of MFCv10 used
in Exynos8890 and Exynos7870. I have no plans to upstream the platform
support for this SoC, may be other members of Samsung may take it up.
But I will mention the SoCs in the next version.

> 
> >  
> >    - reg : Physical base address of the IP registers and length of memory
> >  	  mapped region.
> > diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v10.h b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> > new file mode 100644
> > index 0000000..bd671a5
> > --- /dev/null
> > +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v10.h
> > @@ -0,0 +1,36 @@
> > +/*
> > + * Register definition file for Samsung MFC V10.x Interface (FIMV) driver
> > + *
> > + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
> > + *     http://www.samsung.com/
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#ifndef _REGS_MFC_V10_H
> > +#define _REGS_MFC_V10_H
> > +
> > +#include <linux/sizes.h>
> > +#include "regs-mfc-v8.h"
> > +
> > +/* MFCv10 register definitions*/
> > +#define S5P_FIMV_MFC_CLOCK_OFF_V10			0x7120
> > +#define S5P_FIMV_MFC_STATE_V10				0x7124
> > +
> > +/* MFCv10 Context buffer sizes */
> > +#define MFC_CTX_BUF_SIZE_V10		(30 * SZ_1K)	/* 30KB */
> > +#define MFC_H264_DEC_CTX_BUF_SIZE_V10	(2 * SZ_1M)	/* 2MB */
> > +#define MFC_OTHER_DEC_CTX_BUF_SIZE_V10	(20 * SZ_1K)	/* 20KB */
> > +#define MFC_H264_ENC_CTX_BUF_SIZE_V10	(100 * SZ_1K)	/* 100KB */
> > +#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10	(15 * SZ_1K)	/* 15KB */
> > +
> > +/* MFCv10 variant defines */
> > +#define MAX_FW_SIZE_V10		(SZ_1M)		/* 1MB */
> > +#define MAX_CPB_SIZE_V10	(3 * SZ_1M)	/* 3MB */
> > +#define MFC_VERSION_V10		0xA0
> > +#define MFC_NUM_PORTS_V10	1
> > +
> > +#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 bb0a588..a043cce 100644
> > --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> > @@ -1542,6 +1542,33 @@ static int s5p_mfc_resume(struct device *dev)
> >  	.num_clocks	= 3,
> >  };
> >  
> > +static struct s5p_mfc_buf_size_v6 mfc_buf_size_v10 = {
> > +	.dev_ctx        = MFC_CTX_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,
> > +	.other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V10,
> > +};
> > +
> > +static struct s5p_mfc_buf_size buf_size_v10 = {
> > +	.fw     = MAX_FW_SIZE_V10,
> > +	.cpb    = MAX_CPB_SIZE_V10,
> > +	.priv   = &mfc_buf_size_v10,
> > +};
> > +
> > +static struct s5p_mfc_buf_align mfc_buf_align_v10 = {
> > +	.base = 0,
> > +};
> > +
> > +static struct s5p_mfc_variant mfc_drvdata_v10 = {
> > +	.version        = MFC_VERSION_V10,
> > +	.version_bit    = MFC_V10_BIT,
> > +	.port_num       = MFC_NUM_PORTS_V10,
> > +	.buf_size       = &buf_size_v10,
> > +	.buf_align      = &mfc_buf_align_v10,
> > +	.fw_name[0]     = "s5p-mfc-v10.fw",
> 
> Is firmware file publicly available? Sent to firmware repository?

Firmware binary is not available publicly. I will check on sending it to
firmware repository.

> 
> > +};
> > +
> >  static const struct of_device_id exynos_mfc_match[] = {
> >  	{
> >  		.compatible = "samsung,mfc-v5",
> > @@ -1558,6 +1585,9 @@ static int s5p_mfc_resume(struct device *dev)
> >  	}, {
> >  		.compatible = "samsung,exynos5433-mfc",
> >  		.data = &mfc_drvdata_v8_5433,
> > +	}, {
> > +		.compatible = "samsung,mfc-v10",
> > +		.data = &mfc_drvdata_v10,
> >  	},
> >  	{},
> >  };
> > diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> > index b45d18c..1941c63 100644
> > --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> > @@ -23,7 +23,7 @@
> >  #include <media/v4l2-ioctl.h>
> >  #include <media/videobuf2-v4l2.h>
> >  #include "regs-mfc.h"
> > -#include "regs-mfc-v8.h"
> > +#include "regs-mfc-v10.h"
> >  
> >  #define S5P_MFC_NAME		"s5p-mfc"
> >  
> > @@ -723,11 +723,13 @@ struct mfc_control {
> >  #define IS_MFCV6_PLUS(dev)	(dev->variant->version >= 0x60 ? 1 : 0)
> >  #define IS_MFCV7_PLUS(dev)	(dev->variant->version >= 0x70 ? 1 : 0)
> >  #define IS_MFCV8_PLUS(dev)	(dev->variant->version >= 0x80 ? 1 : 0)
> > +#define IS_MFCV10(dev)		(dev->variant->version >= 0xA0 ? 1 : 0)
> >  
> >  #define MFC_V5_BIT	BIT(0)
> >  #define MFC_V6_BIT	BIT(1)
> >  #define MFC_V7_BIT	BIT(2)
> >  #define MFC_V8_BIT	BIT(3)
> > +#define MFC_V10_BIT	BIT(5)
> 
> I think you can use BIT(4) here.

I used BIT(5) in case someone upstreams MFCv9 they can use BIT(4) in
order to maintain the sequence order as before.

Thank you for the review.

Regards,
Smitha
> 
> Regards
> Andrzej
> 
> 

  reply	other threads:[~2017-01-31  9:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170118100714epcas1p274e2e68d14a788417fbde2c26c91bcb9@epcas1p2.samsung.com>
2017-01-18 10:01 ` [PATCH 00/11] Add MFC v10.10 support Smitha T Murthy
     [not found]   ` <CGME20170118100718epcas5p1f9aebb16fc61d41a13d09054fa96a14d@epcas5p1.samsung.com>
2017-01-18 10:01     ` [PATCH 01/11] [media] s5p-mfc: Rename IS_MFCV8 macro Smitha T Murthy
2017-01-18 14:51       ` Andrzej Hajda
2017-01-31  8:56         ` Smitha T Murthy
     [not found]   ` <CGME20170118100723epcas5p132e0ebfad38261bed95cffc47334f9dc@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 02/11] [media] s5p-mfc: Adding initial support for MFC v10.10 Smitha T Murthy
2017-01-18 15:10       ` Andrzej Hajda
2017-01-31  9:12         ` Smitha T Murthy [this message]
2017-01-21 20:28       ` Rob Herring
2017-02-06  8:37         ` Smitha T Murthy
     [not found]   ` <CGME20170118100726epcas1p2d443360ea389ccb0826a1b5c5512da55@epcas1p2.samsung.com>
2017-01-18 10:02     ` [PATCH 03/11] [media] s5p-mfc: Use min scratch buffer size Smitha T Murthy
2017-02-02  7:16       ` Andrzej Hajda
2017-02-06  8:38         ` Smitha T Murthy
     [not found]   ` <CGME20170118100731epcas5p16f07548a8a6c95f2ef539704e032a54d@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 04/11] [media] s5p-mfc: Support MFCv10.10 buffer requirements Smitha T Murthy
2017-02-02  8:30       ` Andrzej Hajda
2017-02-06  8:41         ` Smitha T Murthy
     [not found]   ` <CGME20170118100737epcas1p269ede3c99e71ce55b934945cd20181e1@epcas1p2.samsung.com>
2017-01-18 10:02     ` [PATCH 05/11] [media] s5p-mfc: Add support for HEVC decoder Smitha T Murthy
2017-02-02  7:58       ` Andrzej Hajda
2017-02-02  8:20         ` Andrzej Hajda
2017-02-06  8:39           ` Smitha T Murthy
2017-02-06  8:39         ` Smitha T Murthy
     [not found]   ` <CGME20170118100742epcas5p1bb390dffa4fe530d94573f41d8791ef7@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 06/11] [media] videodev2.h: Add v4l2 definition for HEVC Smitha T Murthy
2017-02-02  8:34       ` Andrzej Hajda
2017-02-06  8:41         ` Smitha T Murthy
     [not found]   ` <CGME20170118100756epcas1p2c8a93b383a4c85648b5e9efac8cea9c7@epcas1p2.samsung.com>
2017-01-18 10:02     ` [PATCH 08/11] [media] s5p-mfc: Add VP9 decoder support Smitha T Murthy
2017-02-02  8:39       ` Andrzej Hajda
2017-02-06  8:42         ` Smitha T Murthy
     [not found]   ` <CGME20170118100807epcas5p1a0af682c334aa9581f32cbf7f1f264c2@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 09/11] [media] s5p-mfc: Add support for HEVC encoder Smitha T Murthy
2017-02-02  8:55       ` Andrzej Hajda
2017-02-06  8:42         ` Smitha T Murthy
     [not found]   ` <CGME20170118100818epcas5p1c7153a6fe9d93f96269008f42f736b90@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 10/11] [media] v4l2: Add v4l2 control IDs " Smitha T Murthy
2017-02-06 14:54       ` Andrzej Hajda
2017-02-13  5:33         ` Smitha T Murthy
     [not found]   ` <CGME20170118100827epcas5p16023525ba778b58b8e9a31b8a764b382@epcas5p1.samsung.com>
2017-01-18 10:02     ` [PATCH 11/11] Documention: v4l: Documentation for HEVC CIDs Smitha T Murthy

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=1485853935.16927.22.camel@smitha-fedora \
    --to=smitha.t@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).