Skip to contentSkip to conversation

s5p-mfc: MFCv6 register definitions

PATCH Arun Kumar K 2 participants 2 messages Oct 1, 2012 – Oct 2, 2012 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi Sylwester,
Thank you for the comments.
Will make necessary changes and post updated patchset.

Regards
Arun

------- Original Message -------
Sender : Sylwester Nawrocki<[email protected]>
Date : Sep 29, 2012 21:05 (GMT+05:30)
Title : Re: [PATCH v7 5/6] [media] s5p-mfc: MFCv6 register definitions

Hi Arun,

I have a few minor comments.

Quoted 20 lines · Arun Kumar K

From: Jeongtae Park<[email protected]>

Adds register definitions for MFC v6.x firmware

---
  drivers/media/platform/s5p-mfc/regs-mfc-v6.h |  408 ++++++++++++++++++++++++++
  1 files changed, 408 insertions(+), 0 deletions(-)

create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v6.h

drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +0 -0
new file mode 100644
index 0000000..cce1841

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 4

Quoted 4 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
@@ -0,0 +1,408 @@
+/*
+ * Register definition file for Samsung MFC V6.x Interface (FIMV) driver
+ *
+ * Copyright (c) 2012 Samsung Electronics

I believe the proper notation is

Copyright (c) 2012 Samsung Electronics Co., Ltd.

Please make sure it's correct in all files added in this series.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 13

Quoted 9 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +9 -0
+ *		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_FIMV_V6_H
+#define _REGS_FIMV_V6_H

Please add

#include <linux/kernel.h>
#include <linux/sizes.h>

Quoted 6 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +6 -0
+#define S5P_FIMV_REG_SIZE_V6	(S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR)
+#define S5P_FIMV_REG_COUNT_V6	((S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR) / 4)
+
+/* Number of bits that the buffer address should be shifted for particular
+ * MFC buffers.  */
+#define S5P_FIMV_MEM_OFFSET_V6		0

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 29

Quoted 10 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +10 -0
+
+#define S5P_FIMV_START_ADDR_V6		0x0000
+#define S5P_FIMV_END_ADDR_V6		0xfd80
+
+#define S5P_FIMV_REG_CLEAR_BEGIN_V6	0xf000
+#define S5P_FIMV_REG_CLEAR_COUNT_V6	1024
+
+/* Codec Common Registers */
+#define S5P_FIMV_RISC_ON_V6			0x0000
+#define S5P_FIMV_RISC2HOST_INT_V6		0x003C

Could you make sure all hex numbers are in lower case in this file ?

...

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 32

Quoted 3 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +3 -0
+#define S5P_FIMV_NUM_TMV_BUFFERS_V6		2
+
+#define S5P_FIMV_MAX_FRAME_SIZE_V6			(2048 * 1024)

(2 * SZ_1M)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 37

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_NUM_PIXELS_IN_MB_ROW_V6		16
+#define S5P_FIMV_NUM_PIXELS_IN_MB_COL_V6		16
+
+/* Buffer size requirements defined by hardware */
+#define S5P_FIMV_TMV_BUFFER_SIZE_V6(w, h)	((w + 1) * (h + 1) * 8)

The arguments should be in parentheses in the expressions, i.e.

#define S5P_FIMV_TMV_BUFFER_SIZE_V6(w, h) (((w) + 1) * ((h) + 1) * 8)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 41

Quoted 4 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
+#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
+						(((((imw+63)/64) * 16) * \r
+						(((imh+63)/64) * 16)) + \r
+						((((mbw*mbh)+31)/32) * 16))

Could be rewritten as:

#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
	((ALIGN(imw, 64) *  ALIGN(imh, 64) * 256) + (ALIGN((mbw) * (mbh), 32) * 16))

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 46

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H264_DEC_V6(w, h)	((w * 192) + 64)
+#define S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_DEC_V6(w, h) \r
+						(w * (h * 64 + 144) + \r
+						((2048 + 15)/16 * h * 64) + \r
+						((2048 + 15)/16 * 256 + 8320))
	(w * (h * 64 + 144) + (2048/16 * h * 64) + (2048/16 * 256 + 8320))

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 51

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_VC1_DEC_V6(w, h)	(2096 * (w + h + 1))
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H263_DEC_V6(w, h)	(w * 400)
+#define S5P_FIMV_SCRATCH_BUF_SIZE_VP8_DEC_V6(w, h) \r
+						(w * 32 + h * 128 + \r
+						((w + 1) / 2) * 64 + 2112)

Unnecessarily broken into two lines.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 54

Quoted 3 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +3 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V6(w, h) \r
+						((w * 64) + ((w + 1) * 16) + \r
+						(4096 * 16))

Ditto.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 59

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_ENC_V6(w, h) \r
+						((w * 16) + ((w + 1) * 16))
+
+/* MFC Context buffer sizes */
+#define MFC_CTX_BUF_SIZE_V6		0x7000		/*  28KB */

Perhaps we could use the SZ_* macro definitions, e.g. (28 * SZ_1K) ?

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 60

Quoted 1 line
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +1 -0
+#define MFC_H264_DEC_CTX_BUF_SIZE_V6	0x200000	/* 1.6MB */

(1600 * SZ_1K) ...

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 67

Quoted 7 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +7 -0
+#define MFC_OTHER_DEC_CTX_BUF_SIZE_V6	0x5000		/*  20KB */
+#define MFC_H264_ENC_CTX_BUF_SIZE_V6	0x19000		/* 100KB */
+#define MFC_OTHER_ENC_CTX_BUF_SIZE_V6	0x3000		/*  12KB */
+
+/* MFCv6 variant defines */
+#define MAX_FW_SIZE_V6			0x100000	/* 1MB */
+#define MAX_CPB_SIZE_V6			0x300000	/* 3MB */

... (3 * SZ_1M)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 71

Quoted 4 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
+#define MFC_VERSION_V6			0x61
+#define MFC_NUM_PORTS_V6		1
+
+#endif /* _REGS_FIMV_V6_H */

Thanks,
Sylwester
<p>&nbsp;</p><p>&nbsp;</p>

#1 lore raw

Hi Arun and Sylwester,

Please make sure that below calculations are same.

Review

Quoted 4 lines
(quoted diff) +4 -0
+#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
+						(((((imw+63)/64) * 16) * \r
+						(((imh+63)/64) * 16)) + \r
+						((((mbw*mbh)+31)/32) * 16))
#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
	((ALIGN(imw, 64) *  ALIGN(imh, 64) * 256) + (ALIGN((mbw) * (mbh), 32) * 16))

Best Regards
/jtpark

Quoted 171 lines

-----Original Message-----
From: Arun Kumar K [mailto:[email protected]]
Sent: Monday, October 01, 2012 1:37 PM
To: Sylwester Nawrocki
Cc: [email protected]; Kamil Debski; Jeongtae Park; Jang-Hyuck Kim; peter Oh; NAVEEN KRISHNA CHATRADHI; Marek Szyprowski; Sylwester Nawrocki; [email protected]; SUNIL JOSHI
Subject: Re: [PATCH v7 5/6] [media] s5p-mfc: MFCv6 register definitions

Hi Sylwester,
Thank you for the comments.
Will make necessary changes and post updated patchset.

Regards
Arun

------- Original Message -------
Sender : Sylwester Nawrocki<[email protected]>
Date : Sep 29, 2012 21:05 (GMT+05:30)
Title : Re: [PATCH v7 5/6] [media] s5p-mfc: MFCv6 register definitions

Hi Arun,

I have a few minor comments.

drivers/media/platform/s5p-mfc/regs-mfc-

Quoted 15 lines · Arun Kumar K

From: Jeongtae Park<[email protected]>

Adds register definitions for MFC v6.x firmware

---
  drivers/media/platform/s5p-mfc/regs-mfc-v6.h |  408 ++++++++++++++++++++++++++
  1 files changed, 408 insertions(+), 0 deletions(-)

create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v6.h

drivers/media/platform/s5p-mfc/regs-mfc- renamed from drivers/media/platform/s5p-mfc/regs-mfc-v6.h +0 -0

v6.h

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 4

Quoted 9 lines

new file mode 100644
index 0000000..cce1841

drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
@@ -0,0 +1,408 @@
+/*
+ * Register definition file for Samsung MFC V6.x Interface (FIMV) driver
+ *
+ * Copyright (c) 2012 Samsung Electronics

I believe the proper notation is

Copyright (c) 2012 Samsung Electronics Co., Ltd.

Please make sure it's correct in all files added in this series.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 13

Quoted 9 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +9 -0
+ *		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_FIMV_V6_H
+#define _REGS_FIMV_V6_H

Please add

#include <linux/kernel.h>
#include <linux/sizes.h>

Quoted 6 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +6 -0
+#define S5P_FIMV_REG_SIZE_V6	(S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR)
+#define S5P_FIMV_REG_COUNT_V6	((S5P_FIMV_END_ADDR - S5P_FIMV_START_ADDR) / 4)
+
+/* Number of bits that the buffer address should be shifted for particular
+ * MFC buffers.  */
+#define S5P_FIMV_MEM_OFFSET_V6		0

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 29

Quoted 10 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +10 -0
+
+#define S5P_FIMV_START_ADDR_V6		0x0000
+#define S5P_FIMV_END_ADDR_V6		0xfd80
+
+#define S5P_FIMV_REG_CLEAR_BEGIN_V6	0xf000
+#define S5P_FIMV_REG_CLEAR_COUNT_V6	1024
+
+/* Codec Common Registers */
+#define S5P_FIMV_RISC_ON_V6			0x0000
+#define S5P_FIMV_RISC2HOST_INT_V6		0x003C

Could you make sure all hex numbers are in lower case in this file ?

...

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 32

Quoted 3 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +3 -0
+#define S5P_FIMV_NUM_TMV_BUFFERS_V6		2
+
+#define S5P_FIMV_MAX_FRAME_SIZE_V6			(2048 * 1024)

(2 * SZ_1M)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 37

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_NUM_PIXELS_IN_MB_ROW_V6		16
+#define S5P_FIMV_NUM_PIXELS_IN_MB_COL_V6		16
+
+/* Buffer size requirements defined by hardware */
+#define S5P_FIMV_TMV_BUFFER_SIZE_V6(w, h)	((w + 1) * (h + 1) * 8)

The arguments should be in parentheses in the expressions, i.e.

#define S5P_FIMV_TMV_BUFFER_SIZE_V6(w, h) (((w) + 1) * ((h) + 1) * 8)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 41

Quoted 4 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
+#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
+						(((((imw+63)/64) * 16) * \r
+						(((imh+63)/64) * 16)) + \r
+						((((mbw*mbh)+31)/32) * 16))

Could be rewritten as:

#define S5P_FIMV_ME_BUFFER_SIZE_V6(imw, imh, mbw, mbh) \r
	((ALIGN(imw, 64) *  ALIGN(imh, 64) * 256) + (ALIGN((mbw) * (mbh), 32) * 16))

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 46

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H264_DEC_V6(w, h)	((w * 192) + 64)
+#define S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_DEC_V6(w, h) \r
+						(w * (h * 64 + 144) + \r
+						((2048 + 15)/16 * h * 64) + \r
+						((2048 + 15)/16 * 256 + 8320))
	(w * (h * 64 + 144) + (2048/16 * h * 64) + (2048/16 * 256 + 8320))

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 51

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_VC1_DEC_V6(w, h)	(2096 * (w + h + 1))
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H263_DEC_V6(w, h)	(w * 400)
+#define S5P_FIMV_SCRATCH_BUF_SIZE_VP8_DEC_V6(w, h) \r
+						(w * 32 + h * 128 + \r
+						((w + 1) / 2) * 64 + 2112)

Unnecessarily broken into two lines.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 54

Quoted 3 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +3 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_H264_ENC_V6(w, h) \r
+						((w * 64) + ((w + 1) * 16) + \r
+						(4096 * 16))

Ditto.

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 59

Quoted 5 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +5 -0
+#define S5P_FIMV_SCRATCH_BUF_SIZE_MPEG4_ENC_V6(w, h) \r
+						((w * 16) + ((w + 1) * 16))
+
+/* MFC Context buffer sizes */
+#define MFC_CTX_BUF_SIZE_V6		0x7000		/*  28KB */

Perhaps we could use the SZ_* macro definitions, e.g. (28 * SZ_1K) ?

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 60

Quoted 1 line
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +1 -0
+#define MFC_H264_DEC_CTX_BUF_SIZE_V6	0x200000	/* 1.6MB */

(1600 * SZ_1K) ...

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 67

Quoted 7 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +7 -0
+#define MFC_OTHER_DEC_CTX_BUF_SIZE_V6	0x5000		/*  20KB */
+#define MFC_H264_ENC_CTX_BUF_SIZE_V6	0x19000		/* 100KB */
+#define MFC_OTHER_ENC_CTX_BUF_SIZE_V6	0x3000		/*  12KB */
+
+/* MFCv6 variant defines */
+#define MAX_FW_SIZE_V6			0x100000	/* 1MB */
+#define MAX_CPB_SIZE_V6			0x300000	/* 3MB */

... (3 * SZ_1M)

drivers/media/platform/s5p-mfc/regs-mfc-v6.h line 71

Quoted 4 lines
drivers/media/platform/s5p-mfc/regs-mfc-v6.h new file +4 -0
+#define MFC_VERSION_V6			0x61
+#define MFC_NUM_PORTS_V6		1
+
+#endif /* _REGS_FIMV_V6_H */

Thanks,
Sylwester
<p>&nbsp;</p><p>&nbsp;</p>