Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-26 Thread Arun Kumar K
Hi Sachin,

On Tue, Jun 25, 2013 at 4:54 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Arun,

 @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 (dev-variant-port_num ? 1 : 0) : 0) : 0)
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
 +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

 Considering the definition and pattern, wouldn't it be appropriate to
 call this  IS_MFCV7_PLUS?


We are still not sure about MFCv8 if it can re-use v7 stuff or not.

Regards
Arun
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-26 Thread Sachin Kamat
Hi Arun,

On 26 June 2013 12:18, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Sachin,

 On Tue, Jun 25, 2013 at 4:54 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Arun,

 @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 (dev-variant-port_num ? 1 : 0) : 0) : 0)
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 
 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
 +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

 Considering the definition and pattern, wouldn't it be appropriate to
 call this  IS_MFCV7_PLUS?


 We are still not sure about MFCv8 if it can re-use v7 stuff or not.


OK. In that case probably we can restrict the definition to
(dev-variant-version == 0x70 ? 1 : 0).


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-26 Thread Kamil Debski
Hi,

 -Original Message-
 From: Sachin Kamat [mailto:sachin.ka...@linaro.org]
 Sent: Wednesday, June 26, 2013 9:05 AM
 To: Arun Kumar K
 Cc: Arun Kumar K; LMML; Kamil Debski; jtp.p...@samsung.com; Sylwester
 Nawrocki; Hans Verkuil; avnd.ki...@samsung.com
 Subject: Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7
 
 Hi Arun,
 
 On 26 June 2013 12:18, Arun Kumar K arunkk.sams...@gmail.com wrote:
  Hi Sachin,
 
  On Tue, Jun 25, 2013 at 4:54 PM, Sachin Kamat
 sachin.ka...@linaro.org wrote:
  Hi Arun,
 
  @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx
 *ctx);
  (dev-variant-port_num ? 1 : 0) :
 0) : 0)
   #define IS_TWOPORT(dev)(dev-variant-port_num ==
 2 ? 1 : 0)
   #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 :
 0)
  +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 :
 0)
 
  Considering the definition and pattern, wouldn't it be appropriate
 to
  call this  IS_MFCV7_PLUS?
 
 
  We are still not sure about MFCv8 if it can re-use v7 stuff or not.
 
 
 OK. In that case probably we can restrict the definition to (dev-
 variant-version == 0x70 ? 1 : 0).
 
 

Guys, I think that simple ((dev-variant-version  0xF0) == 0x70) would
cover
every 7.x version. Same could apply to versions 6.x and 5.x. 
Then instead of using IS_MFCV6_PLUS(dev) one would use IS_MFCV6(dev) ||
IS_MFCV7(dev).
This is a bit longer, but if version 8 will be totally different from v7
then it is
much better to use v6||v7 instead of v6_plus.

Best wishes,
-- 
Kamil Debski
Linux Kernel Developer
Samsung RD Institute Poland


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-26 Thread Arun Kumar K
Hi Kamil,

On Wed, Jun 26, 2013 at 1:50 PM, Kamil Debski k.deb...@samsung.com wrote:
 Hi,

 -Original Message-
 From: Sachin Kamat [mailto:sachin.ka...@linaro.org]
 Sent: Wednesday, June 26, 2013 9:05 AM
 To: Arun Kumar K
 Cc: Arun Kumar K; LMML; Kamil Debski; jtp.p...@samsung.com; Sylwester
 Nawrocki; Hans Verkuil; avnd.ki...@samsung.com
 Subject: Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

 Hi Arun,

 On 26 June 2013 12:18, Arun Kumar K arunkk.sams...@gmail.com wrote:
  Hi Sachin,
 
  On Tue, Jun 25, 2013 at 4:54 PM, Sachin Kamat
 sachin.ka...@linaro.org wrote:
  Hi Arun,
 
  @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx
 *ctx);
  (dev-variant-port_num ? 1 : 0) :
 0) : 0)
   #define IS_TWOPORT(dev)(dev-variant-port_num ==
 2 ? 1 : 0)
   #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 :
 0)
  +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 :
 0)
 
  Considering the definition and pattern, wouldn't it be appropriate
 to
  call this  IS_MFCV7_PLUS?
 
 
  We are still not sure about MFCv8 if it can re-use v7 stuff or not.
 

 OK. In that case probably we can restrict the definition to (dev-
 variant-version == 0x70 ? 1 : 0).



 Guys, I think that simple ((dev-variant-version  0xF0) == 0x70) would
 cover
 every 7.x version. Same could apply to versions 6.x and 5.x.
 Then instead of using IS_MFCV6_PLUS(dev) one would use IS_MFCV6(dev) ||
 IS_MFCV7(dev).
 This is a bit longer, but if version 8 will be totally different from v7
 then it is
 much better to use v6||v7 instead of v6_plus.


If v8 was known to be different from v7, then we can go without second
thoughts about v6 || v7 check. But we cannot confirm that until v8 is
released. There is a good possibility of v6_plus macro holding good
for v8 also.
So as per current understanding, we can restrict v7 macro to only v7.x FW.
When v8 is released, we will change the name and usage of this macro if needed.
Is that ok?

Regards
Arun
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-25 Thread Arun Kumar K
Adds variant data and core support for the MFC v7 firmware

Signed-off-by: Arun Kumar K arun...@samsung.com
---
 .../devicetree/bindings/media/s5p-mfc.txt  |1 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c   |   32 
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h|2 ++
 3 files changed, 35 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt 
b/Documentation/devicetree/bindings/media/s5p-mfc.txt
index 67ec3d4..cb9c5bc 100644
--- a/Documentation/devicetree/bindings/media/s5p-mfc.txt
+++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt
@@ -10,6 +10,7 @@ Required properties:
   - compatible : value should be either one among the following
(a) samsung,mfc-v5 for MFC v5 present in Exynos4 SoCs
(b) samsung,mfc-v6 for MFC v6 present in Exynos5 SoCs
+   (b) samsung,mfc-v7 for MFC v7 present in Exynos5420 SoC
 
   - reg : Physical base address of the IP registers and length of memory
  mapped region.
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index d12faa6..d6be52f 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1391,6 +1391,32 @@ static struct s5p_mfc_variant mfc_drvdata_v6 = {
.fw_name= s5p-mfc-v6.fw,
 };
 
+struct s5p_mfc_buf_size_v6 mfc_buf_size_v7 = {
+   .dev_ctx= MFC_CTX_BUF_SIZE_V7,
+   .h264_dec_ctx   = MFC_H264_DEC_CTX_BUF_SIZE_V7,
+   .other_dec_ctx  = MFC_OTHER_DEC_CTX_BUF_SIZE_V7,
+   .h264_enc_ctx   = MFC_H264_ENC_CTX_BUF_SIZE_V7,
+   .other_enc_ctx  = MFC_OTHER_ENC_CTX_BUF_SIZE_V7,
+};
+
+struct s5p_mfc_buf_size buf_size_v7 = {
+   .fw = MAX_FW_SIZE_V7,
+   .cpb= MAX_CPB_SIZE_V7,
+   .priv   = mfc_buf_size_v7,
+};
+
+struct s5p_mfc_buf_align mfc_buf_align_v7 = {
+   .base = 0,
+};
+
+static struct s5p_mfc_variant mfc_drvdata_v7 = {
+   .version= MFC_VERSION_V7,
+   .port_num   = MFC_NUM_PORTS_V7,
+   .buf_size   = buf_size_v7,
+   .buf_align  = mfc_buf_align_v7,
+   .fw_name= s5p-mfc-v7.fw,
+};
+
 static struct platform_device_id mfc_driver_ids[] = {
{
.name = s5p-mfc,
@@ -1401,6 +1427,9 @@ static struct platform_device_id mfc_driver_ids[] = {
}, {
.name = s5p-mfc-v6,
.driver_data = (unsigned long)mfc_drvdata_v6,
+   }, {
+   .name = s5p-mfc-v7,
+   .driver_data = (unsigned long)mfc_drvdata_v7,
},
{},
 };
@@ -1413,6 +1442,9 @@ static const struct of_device_id exynos_mfc_match[] = {
}, {
.compatible = samsung,mfc-v6,
.data = mfc_drvdata_v6,
+   }, {
+   .compatible = samsung,mfc-v7,
+   .data = mfc_drvdata_v7,
},
{},
 };
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index d47016d..17545d7 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -24,6 +24,7 @@
 #include media/videobuf2-core.h
 #include regs-mfc.h
 #include regs-mfc-v6.h
+#include regs-mfc-v7.h
 
 /* Definitions related to MFC memory */
 
@@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
(dev-variant-port_num ? 1 : 0) : 0) : 0)
 #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 0)
 #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
+#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)
 
 #endif /* S5P_MFC_COMMON_H_ */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-25 Thread Sachin Kamat
Hi Arun,

 @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 (dev-variant-port_num ? 1 : 0) : 0) : 0)
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
 +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

Considering the definition and pattern, wouldn't it be appropriate to
call this  IS_MFCV7_PLUS?

---
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html