* [PATCH v2 0/5] Renesas VSP1 driver
@ 2013-07-17 14:54 Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 1/5] media: Fix circular graph traversal Laurent Pinchart
` (4 more replies)
0 siblings, 5 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 14:54 UTC (permalink / raw)
To: linux-media; +Cc: linux-sh, Hans Verkuil, Sakari Ailus
Hello,
Here's the second version of the VSP1 engine (a Video Signal Processor found
in several Renesas R-Car SoCs) driver. Many thanks to Hans Verkuil for his
very quick review of v1.
The VSP1 is a video processing engine that includes a blender, scalers,
filters and statistics computation. Configurable data path routing logic
allows ordering the internal blocks in a flexible way, making this driver a
prime candidate for the media controller API.
Due to the configurable nature of the pipeline the driver doesn't use the V4L2
mem-to-mem framework, even though the device usually operates in memory to
memory mode.
Only the read pixel formatters, up/down scalers, write pixel formatters and
LCDC interface are supported at this stage.
The patch series starts with a fix for the media controller graph traversal
code, a documentation fix and new pixel format and media bus code definitions.
The last patch finally adds the VSP1 driver.
Changes since v1:
- Updated to the v3.11 media controller API changes
- Only add the LIF entity to the entities list when the LIF is present
- Added a MODULE_ALIAS()
- Fixed file descriptions in comment blocks
- Removed function prototypes for the unimplemented destroy functions
- Fixed a typo in the HST register name
- Fixed format propagation for the UDS entities
- Added v4l2_capability::device_caps support
- Prefix the device name with "platform:" in bus_info
- Zero the v4l2_pix_format priv field in the internal try format handler
- Use vb2_is_busy() instead of vb2_is_streaming() when setting the
format
- Use the vb2_ioctl_* handlers where possible
Laurent Pinchart (5):
media: Fix circular graph traversal
v4l: Fix V4L2_MBUS_FMT_YUV10_1X30 media bus pixel code value
v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses
v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats
v4l: Renesas R-Car VSP1 driver
Documentation/DocBook/media/v4l/pixfmt-nv16m.xml | 170 +++
Documentation/DocBook/media/v4l/pixfmt.xml | 1 +
Documentation/DocBook/media/v4l/subdev-formats.xml | 611 +++++------
Documentation/DocBook/media_api.tmpl | 6 +
drivers/media/media-entity.c | 17 +-
drivers/media/platform/Kconfig | 10 +
drivers/media/platform/Makefile | 2 +
drivers/media/platform/vsp1/Makefile | 5 +
drivers/media/platform/vsp1/vsp1.h | 73 ++
drivers/media/platform/vsp1/vsp1_drv.c | 487 +++++++++
drivers/media/platform/vsp1/vsp1_entity.c | 186 ++++
drivers/media/platform/vsp1/vsp1_entity.h | 68 ++
drivers/media/platform/vsp1/vsp1_lif.c | 237 ++++
drivers/media/platform/vsp1/vsp1_lif.h | 37 +
drivers/media/platform/vsp1/vsp1_regs.h | 581 ++++++++++
drivers/media/platform/vsp1/vsp1_rpf.c | 209 ++++
drivers/media/platform/vsp1/vsp1_rwpf.c | 124 +++
drivers/media/platform/vsp1/vsp1_rwpf.h | 53 +
drivers/media/platform/vsp1/vsp1_uds.c | 345 ++++++
drivers/media/platform/vsp1/vsp1_uds.h | 40 +
drivers/media/platform/vsp1/vsp1_video.c | 1129 ++++++++++++++++++++
drivers/media/platform/vsp1/vsp1_video.h | 144 +++
drivers/media/platform/vsp1/vsp1_wpf.c | 233 ++++
include/linux/platform_data/vsp1.h | 25 +
include/uapi/linux/v4l2-mediabus.h | 6 +-
include/uapi/linux/videodev2.h | 2 +
26 files changed, 4428 insertions(+), 373 deletions(-)
create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
create mode 100644 drivers/media/platform/vsp1/Makefile
create mode 100644 drivers/media/platform/vsp1/vsp1.h
create mode 100644 drivers/media/platform/vsp1/vsp1_drv.c
create mode 100644 drivers/media/platform/vsp1/vsp1_entity.c
create mode 100644 drivers/media/platform/vsp1/vsp1_entity.h
create mode 100644 drivers/media/platform/vsp1/vsp1_lif.c
create mode 100644 drivers/media/platform/vsp1/vsp1_lif.h
create mode 100644 drivers/media/platform/vsp1/vsp1_regs.h
create mode 100644 drivers/media/platform/vsp1/vsp1_rpf.c
create mode 100644 drivers/media/platform/vsp1/vsp1_rwpf.c
create mode 100644 drivers/media/platform/vsp1/vsp1_rwpf.h
create mode 100644 drivers/media/platform/vsp1/vsp1_uds.c
create mode 100644 drivers/media/platform/vsp1/vsp1_uds.h
create mode 100644 drivers/media/platform/vsp1/vsp1_video.c
create mode 100644 drivers/media/platform/vsp1/vsp1_video.h
create mode 100644 drivers/media/platform/vsp1/vsp1_wpf.c
create mode 100644 include/linux/platform_data/vsp1.h
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v2 1/5] media: Fix circular graph traversal
2013-07-17 14:54 [PATCH v2 0/5] Renesas VSP1 driver Laurent Pinchart
@ 2013-07-17 14:54 ` Laurent Pinchart
2013-07-17 19:47 ` Sakari Ailus
2013-07-17 14:54 ` [PATCH v2 2/5] v4l: Fix V4L2_MBUS_FMT_YUV10_1X30 media bus pixel code value Laurent Pinchart
` (3 subsequent siblings)
4 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 14:54 UTC (permalink / raw)
To: linux-media; +Cc: linux-sh, Hans Verkuil, Sakari Ailus
The graph traversal API (media_entity_graph_walk_*) will fail to
correctly walk the graph when circular links exist. Fix it by checking
whether an entity is already present in the stack before pushing it.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/media/media-entity.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index cb30ffb..c8aba5e 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -121,9 +121,9 @@ static struct media_entity *stack_pop(struct media_entity_graph *graph)
return entity;
}
-#define stack_peek(en) ((en)->stack[(en)->top - 1].entity)
-#define link_top(en) ((en)->stack[(en)->top].link)
-#define stack_top(en) ((en)->stack[(en)->top].entity)
+#define stack_peek(en, i) ((en)->stack[i].entity)
+#define link_top(en) ((en)->stack[(en)->top].link)
+#define stack_top(en) ((en)->stack[(en)->top].entity)
/**
* media_entity_graph_walk_start - Start walking the media graph at a given entity
@@ -159,6 +159,8 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
struct media_entity *
media_entity_graph_walk_next(struct media_entity_graph *graph)
{
+ unsigned int i;
+
if (stack_top(graph) = NULL)
return NULL;
@@ -181,8 +183,13 @@ media_entity_graph_walk_next(struct media_entity_graph *graph)
/* Get the entity in the other end of the link . */
next = media_entity_other(entity, link);
- /* Was it the entity we came here from? */
- if (next = stack_peek(graph)) {
+ /* Is the entity already in the path? */
+ for (i = 1; i < graph->top; ++i) {
+ if (next = stack_peek(graph, i))
+ break;
+ }
+
+ if (i < graph->top) {
link_top(graph)++;
continue;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 2/5] v4l: Fix V4L2_MBUS_FMT_YUV10_1X30 media bus pixel code value
2013-07-17 14:54 [PATCH v2 0/5] Renesas VSP1 driver Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 1/5] media: Fix circular graph traversal Laurent Pinchart
@ 2013-07-17 14:54 ` Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses Laurent Pinchart
` (2 subsequent siblings)
4 siblings, 0 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 14:54 UTC (permalink / raw)
To: linux-media; +Cc: linux-sh, Hans Verkuil, Sakari Ailus
The V4L2_MBUS_FMT_YUV10_1X30 code is documented as being equal to
0x2014, while the v4l2-mediabus.h header defines it as 0x2016. Fix the
documentation.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
Documentation/DocBook/media/v4l/subdev-formats.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
index adc6198..0c2b1f2 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -2574,7 +2574,7 @@
</row>
<row id="V4L2-MBUS-FMT-YUV10-1X30">
<entry>V4L2_MBUS_FMT_YUV10_1X30</entry>
- <entry>0x2014</entry>
+ <entry>0x2016</entry>
<entry></entry>
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
--
1.8.1.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses
2013-07-17 14:54 [PATCH v2 0/5] Renesas VSP1 driver Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 1/5] media: Fix circular graph traversal Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 2/5] v4l: Fix V4L2_MBUS_FMT_YUV10_1X30 media bus pixel code value Laurent Pinchart
@ 2013-07-17 14:54 ` Laurent Pinchart
2013-07-24 21:26 ` Sylwester Nawrocki
2013-07-17 14:54 ` [PATCH v2 4/5] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats Laurent Pinchart
[not found] ` <1374072882-14598-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
4 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 14:54 UTC (permalink / raw)
To: linux-media; +Cc: linux-sh, Hans Verkuil, Sakari Ailus
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
Documentation/DocBook/media/v4l/subdev-formats.xml | 609 +++++++++------------
Documentation/DocBook/media_api.tmpl | 6 +
include/uapi/linux/v4l2-mediabus.h | 6 +-
3 files changed, 254 insertions(+), 367 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 0c2b1f2..9100674 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -97,31 +97,39 @@
<colspec colname="id" align="left" />
<colspec colname="code" align="center"/>
<colspec colname="bit" />
- <colspec colnum="4" colname="b23" align="center" />
- <colspec colnum="5" colname="b22" align="center" />
- <colspec colnum="6" colname="b21" align="center" />
- <colspec colnum="7" colname="b20" align="center" />
- <colspec colnum="8" colname="b19" align="center" />
- <colspec colnum="9" colname="b18" align="center" />
- <colspec colnum="10" colname="b17" align="center" />
- <colspec colnum="11" colname="b16" align="center" />
- <colspec colnum="12" colname="b15" align="center" />
- <colspec colnum="13" colname="b14" align="center" />
- <colspec colnum="14" colname="b13" align="center" />
- <colspec colnum="15" colname="b12" align="center" />
- <colspec colnum="16" colname="b11" align="center" />
- <colspec colnum="17" colname="b10" align="center" />
- <colspec colnum="18" colname="b09" align="center" />
- <colspec colnum="19" colname="b08" align="center" />
- <colspec colnum="20" colname="b07" align="center" />
- <colspec colnum="21" colname="b06" align="center" />
- <colspec colnum="22" colname="b05" align="center" />
- <colspec colnum="23" colname="b04" align="center" />
- <colspec colnum="24" colname="b03" align="center" />
- <colspec colnum="25" colname="b02" align="center" />
- <colspec colnum="26" colname="b01" align="center" />
- <colspec colnum="27" colname="b00" align="center" />
- <spanspec namest="b23" nameend="b00" spanname="b0" />
+ <colspec colnum="4" colname="b31" align="center" />
+ <colspec colnum="5" colname="b20" align="center" />
+ <colspec colnum="6" colname="b29" align="center" />
+ <colspec colnum="7" colname="b28" align="center" />
+ <colspec colnum="8" colname="b27" align="center" />
+ <colspec colnum="9" colname="b26" align="center" />
+ <colspec colnum="10" colname="b25" align="center" />
+ <colspec colnum="11" colname="b24" align="center" />
+ <colspec colnum="12" colname="b23" align="center" />
+ <colspec colnum="13" colname="b22" align="center" />
+ <colspec colnum="14" colname="b21" align="center" />
+ <colspec colnum="15" colname="b20" align="center" />
+ <colspec colnum="16" colname="b19" align="center" />
+ <colspec colnum="17" colname="b18" align="center" />
+ <colspec colnum="18" colname="b17" align="center" />
+ <colspec colnum="19" colname="b16" align="center" />
+ <colspec colnum="20" colname="b15" align="center" />
+ <colspec colnum="21" colname="b14" align="center" />
+ <colspec colnum="22" colname="b13" align="center" />
+ <colspec colnum="23" colname="b12" align="center" />
+ <colspec colnum="24" colname="b11" align="center" />
+ <colspec colnum="25" colname="b10" align="center" />
+ <colspec colnum="26" colname="b09" align="center" />
+ <colspec colnum="27" colname="b08" align="center" />
+ <colspec colnum="28" colname="b07" align="center" />
+ <colspec colnum="29" colname="b06" align="center" />
+ <colspec colnum="30" colname="b05" align="center" />
+ <colspec colnum="31" colname="b04" align="center" />
+ <colspec colnum="32" colname="b03" align="center" />
+ <colspec colnum="33" colname="b02" align="center" />
+ <colspec colnum="34" colname="b01" align="center" />
+ <colspec colnum="35" colname="b00" align="center" />
+ <spanspec namest="b31" nameend="b00" spanname="b0" />
<thead>
<row>
<entry>Identifier</entry>
@@ -133,6 +141,14 @@
<entry></entry>
<entry></entry>
<entry>Bit</entry>
+ <entry>31</entry>
+ <entry>30</entry>
+ <entry>29</entry>
+ <entry>28</entry>
+ <entry>27</entry>
+ <entry>26</entry>
+ <entry>25</entry>
+ <entry>24</entry>
<entry>23</entry>
<entry>22</entry>
<entry>21</entry>
@@ -164,7 +180,7 @@
<entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE</entry>
<entry>0x1001</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>0</entry>
<entry>0</entry>
<entry>0</entry>
@@ -178,7 +194,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>3</subscript></entry>
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
@@ -192,7 +208,7 @@
<entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE</entry>
<entry>0x1002</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>3</subscript></entry>
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
@@ -206,7 +222,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>0</entry>
<entry>0</entry>
<entry>0</entry>
@@ -220,7 +236,7 @@
<entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</entry>
<entry>0x1003</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>0</entry>
<entry>r<subscript>4</subscript></entry>
<entry>r<subscript>3</subscript></entry>
@@ -234,7 +250,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -248,7 +264,7 @@
<entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE</entry>
<entry>0x1004</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -262,7 +278,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>0</entry>
<entry>r<subscript>4</subscript></entry>
<entry>r<subscript>3</subscript></entry>
@@ -276,7 +292,7 @@
<entry>V4L2_MBUS_FMT_BGR565_2X8_BE</entry>
<entry>0x1005</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>b<subscript>4</subscript></entry>
<entry>b<subscript>3</subscript></entry>
<entry>b<subscript>2</subscript></entry>
@@ -290,7 +306,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -304,7 +320,7 @@
<entry>V4L2_MBUS_FMT_BGR565_2X8_LE</entry>
<entry>0x1006</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -318,7 +334,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>b<subscript>4</subscript></entry>
<entry>b<subscript>3</subscript></entry>
<entry>b<subscript>2</subscript></entry>
@@ -332,7 +348,7 @@
<entry>V4L2_MBUS_FMT_RGB565_2X8_BE</entry>
<entry>0x1007</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>r<subscript>4</subscript></entry>
<entry>r<subscript>3</subscript></entry>
<entry>r<subscript>2</subscript></entry>
@@ -346,7 +362,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -360,7 +376,7 @@
<entry>V4L2_MBUS_FMT_RGB565_2X8_LE</entry>
<entry>0x1008</entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
<entry>g<subscript>0</subscript></entry>
@@ -374,7 +390,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-16;
+ &dash-ent-24;
<entry>r<subscript>4</subscript></entry>
<entry>r<subscript>3</subscript></entry>
<entry>r<subscript>2</subscript></entry>
@@ -388,12 +404,7 @@
<entry>V4L2_MBUS_FMT_RGB666_1X18</entry>
<entry>0x1009</entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-14;
<entry>r<subscript>5</subscript></entry>
<entry>r<subscript>4</subscript></entry>
<entry>r<subscript>3</subscript></entry>
@@ -417,6 +428,7 @@
<entry>V4L2_MBUS_FMT_RGB888_1X24</entry>
<entry>0x100a</entry>
<entry></entry>
+ &dash-ent-8;
<entry>r<subscript>7</subscript></entry>
<entry>r<subscript>6</subscript></entry>
<entry>r<subscript>5</subscript></entry>
@@ -446,9 +458,7 @@
<entry>V4L2_MBUS_FMT_RGB888_2X12_BE</entry>
<entry>0x100b</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-20;
<entry>r<subscript>7</subscript></entry>
<entry>r<subscript>6</subscript></entry>
<entry>r<subscript>5</subscript></entry>
@@ -466,9 +476,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-20;
<entry>g<subscript>3</subscript></entry>
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
@@ -486,9 +494,7 @@
<entry>V4L2_MBUS_FMT_RGB888_2X12_LE</entry>
<entry>0x100c</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-20;
<entry>g<subscript>3</subscript></entry>
<entry>g<subscript>2</subscript></entry>
<entry>g<subscript>1</subscript></entry>
@@ -506,9 +512,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-20;
<entry>r<subscript>7</subscript></entry>
<entry>r<subscript>6</subscript></entry>
<entry>r<subscript>5</subscript></entry>
@@ -522,6 +526,43 @@
<entry>g<subscript>5</subscript></entry>
<entry>g<subscript>4</subscript></entry>
</row>
+ <row id="V4L2-MBUS-FMT-ARGB888-1X24">
+ <entry>V4L2_MBUS_FMT_ARGB888_1X24</entry>
+ <entry>0x100d</entry>
+ <entry></entry>
+ <entry>a<subscript>7</subscript></entry>
+ <entry>a<subscript>6</subscript></entry>
+ <entry>a<subscript>5</subscript></entry>
+ <entry>a<subscript>4</subscript></entry>
+ <entry>a<subscript>3</subscript></entry>
+ <entry>a<subscript>2</subscript></entry>
+ <entry>a<subscript>1</subscript></entry>
+ <entry>a<subscript>0</subscript></entry>
+ <entry>r<subscript>7</subscript></entry>
+ <entry>r<subscript>6</subscript></entry>
+ <entry>r<subscript>5</subscript></entry>
+ <entry>r<subscript>4</subscript></entry>
+ <entry>r<subscript>3</subscript></entry>
+ <entry>r<subscript>2</subscript></entry>
+ <entry>r<subscript>1</subscript></entry>
+ <entry>r<subscript>0</subscript></entry>
+ <entry>g<subscript>7</subscript></entry>
+ <entry>g<subscript>6</subscript></entry>
+ <entry>g<subscript>5</subscript></entry>
+ <entry>g<subscript>4</subscript></entry>
+ <entry>g<subscript>3</subscript></entry>
+ <entry>g<subscript>2</subscript></entry>
+ <entry>g<subscript>1</subscript></entry>
+ <entry>g<subscript>0</subscript></entry>
+ <entry>b<subscript>7</subscript></entry>
+ <entry>b<subscript>6</subscript></entry>
+ <entry>b<subscript>5</subscript></entry>
+ <entry>b<subscript>4</subscript></entry>
+ <entry>b<subscript>3</subscript></entry>
+ <entry>b<subscript>2</subscript></entry>
+ <entry>b<subscript>1</subscript></entry>
+ <entry>b<subscript>0</subscript></entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -1149,6 +1190,7 @@
<listitem><para>y<subscript>x</subscript> for luma component bit number x</para></listitem>
<listitem><para>u<subscript>x</subscript> for blue chroma component bit number x</para></listitem>
<listitem><para>v<subscript>x</subscript> for red chroma component bit number x</para></listitem>
+ <listitem><para>a<subscript>x</subscript> for alpha component bit number x</para></listitem>
<listitem><para>- for non-available bits (for positions higher than the bus width)</para></listitem>
<listitem><para>d for dummy bits</para></listitem>
</itemizedlist>
@@ -1159,37 +1201,39 @@
<colspec colname="id" align="left" />
<colspec colname="code" align="center"/>
<colspec colname="bit" />
- <colspec colnum="4" colname="b29" align="center" />
- <colspec colnum="5" colname="b28" align="center" />
- <colspec colnum="6" colname="b27" align="center" />
- <colspec colnum="7" colname="b26" align="center" />
- <colspec colnum="8" colname="b25" align="center" />
- <colspec colnum="9" colname="b24" align="center" />
- <colspec colnum="10" colname="b23" align="center" />
- <colspec colnum="11" colname="b22" align="center" />
- <colspec colnum="12" colname="b21" align="center" />
- <colspec colnum="13" colname="b20" align="center" />
- <colspec colnum="14" colname="b19" align="center" />
- <colspec colnum="15" colname="b18" align="center" />
- <colspec colnum="16" colname="b17" align="center" />
- <colspec colnum="17" colname="b16" align="center" />
- <colspec colnum="18" colname="b15" align="center" />
- <colspec colnum="19" colname="b14" align="center" />
- <colspec colnum="20" colname="b13" align="center" />
- <colspec colnum="21" colname="b12" align="center" />
- <colspec colnum="22" colname="b11" align="center" />
- <colspec colnum="23" colname="b10" align="center" />
- <colspec colnum="24" colname="b09" align="center" />
- <colspec colnum="25" colname="b08" align="center" />
- <colspec colnum="26" colname="b07" align="center" />
- <colspec colnum="27" colname="b06" align="center" />
- <colspec colnum="28" colname="b05" align="center" />
- <colspec colnum="29" colname="b04" align="center" />
- <colspec colnum="30" colname="b03" align="center" />
- <colspec colnum="31" colname="b02" align="center" />
- <colspec colnum="32" colname="b01" align="center" />
- <colspec colnum="33" colname="b00" align="center" />
- <spanspec namest="b29" nameend="b00" spanname="b0" />
+ <colspec colnum="4" colname="b31" align="center" />
+ <colspec colnum="5" colname="b20" align="center" />
+ <colspec colnum="6" colname="b29" align="center" />
+ <colspec colnum="7" colname="b28" align="center" />
+ <colspec colnum="8" colname="b27" align="center" />
+ <colspec colnum="9" colname="b26" align="center" />
+ <colspec colnum="10" colname="b25" align="center" />
+ <colspec colnum="11" colname="b24" align="center" />
+ <colspec colnum="12" colname="b23" align="center" />
+ <colspec colnum="13" colname="b22" align="center" />
+ <colspec colnum="14" colname="b21" align="center" />
+ <colspec colnum="15" colname="b20" align="center" />
+ <colspec colnum="16" colname="b19" align="center" />
+ <colspec colnum="17" colname="b18" align="center" />
+ <colspec colnum="18" colname="b17" align="center" />
+ <colspec colnum="19" colname="b16" align="center" />
+ <colspec colnum="20" colname="b15" align="center" />
+ <colspec colnum="21" colname="b14" align="center" />
+ <colspec colnum="22" colname="b13" align="center" />
+ <colspec colnum="23" colname="b12" align="center" />
+ <colspec colnum="24" colname="b11" align="center" />
+ <colspec colnum="25" colname="b10" align="center" />
+ <colspec colnum="26" colname="b09" align="center" />
+ <colspec colnum="27" colname="b08" align="center" />
+ <colspec colnum="28" colname="b07" align="center" />
+ <colspec colnum="29" colname="b06" align="center" />
+ <colspec colnum="30" colname="b05" align="center" />
+ <colspec colnum="31" colname="b04" align="center" />
+ <colspec colnum="32" colname="b03" align="center" />
+ <colspec colnum="33" colname="b02" align="center" />
+ <colspec colnum="34" colname="b01" align="center" />
+ <colspec colnum="35" colname="b00" align="center" />
+ <spanspec namest="b31" nameend="b00" spanname="b0" />
<thead>
<row>
<entry>Identifier</entry>
@@ -1201,6 +1245,8 @@
<entry></entry>
<entry></entry>
<entry>Bit</entry>
+ <entry>31</entry>
+ <entry>30</entry>
<entry>29</entry>
<entry>28</entry>
<entry>27</entry>
@@ -1238,10 +1284,7 @@
<entry>V4L2_MBUS_FMT_Y8_1X8</entry>
<entry>0x2001</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1255,18 +1298,7 @@
<entry>V4L2_MBUS_FMT_UV8_1X8</entry>
<entry>0x2015</entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1280,18 +1312,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1305,10 +1326,7 @@
<entry>V4L2_MBUS_FMT_UYVY8_1_5X8</entry>
<entry>0x2002</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1322,10 +1340,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1339,10 +1354,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1356,10 +1368,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1373,10 +1382,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1390,10 +1396,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1407,10 +1410,7 @@
<entry>V4L2_MBUS_FMT_VYUY8_1_5X8</entry>
<entry>0x2003</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1424,10 +1424,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1441,10 +1438,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1458,10 +1452,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1475,10 +1466,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1492,10 +1480,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1509,10 +1494,7 @@
<entry>V4L2_MBUS_FMT_YUYV8_1_5X8</entry>
<entry>0x2004</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1526,10 +1508,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1543,10 +1522,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1560,10 +1536,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1577,10 +1550,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1594,10 +1564,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1611,10 +1578,7 @@
<entry>V4L2_MBUS_FMT_YVYU8_1_5X8</entry>
<entry>0x2005</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1628,10 +1592,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1645,10 +1606,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1662,10 +1620,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1679,10 +1634,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1696,10 +1648,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1713,10 +1662,7 @@
<entry>V4L2_MBUS_FMT_UYVY8_2X8</entry>
<entry>0x2006</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1730,10 +1676,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1747,10 +1690,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1764,10 +1704,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1781,10 +1718,7 @@
<entry>V4L2_MBUS_FMT_VYUY8_2X8</entry>
<entry>0x2007</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1798,10 +1732,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1815,10 +1746,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1832,10 +1760,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1849,10 +1774,7 @@
<entry>V4L2_MBUS_FMT_YUYV8_2X8</entry>
<entry>0x2008</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1866,10 +1788,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1883,10 +1802,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1900,10 +1816,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1917,10 +1830,7 @@
<entry>V4L2_MBUS_FMT_YVYU8_2X8</entry>
<entry>0x2009</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1934,10 +1844,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -1951,10 +1858,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -1968,10 +1872,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-24;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -1985,8 +1886,7 @@
<entry>V4L2_MBUS_FMT_Y10_1X10</entry>
<entry>0x200a</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2002,8 +1902,7 @@
<entry>V4L2_MBUS_FMT_YUYV10_2X10</entry>
<entry>0x200b</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2019,8 +1918,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>u<subscript>9</subscript></entry>
<entry>u<subscript>8</subscript></entry>
<entry>u<subscript>7</subscript></entry>
@@ -2036,8 +1934,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2053,8 +1950,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>v<subscript>9</subscript></entry>
<entry>v<subscript>8</subscript></entry>
<entry>v<subscript>7</subscript></entry>
@@ -2070,8 +1966,7 @@
<entry>V4L2_MBUS_FMT_YVYU10_2X10</entry>
<entry>0x200c</entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2087,8 +1982,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>v<subscript>9</subscript></entry>
<entry>v<subscript>8</subscript></entry>
<entry>v<subscript>7</subscript></entry>
@@ -2104,8 +1998,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2121,8 +2014,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- &dash-ent-10;
+ &dash-ent-22;
<entry>u<subscript>9</subscript></entry>
<entry>u<subscript>8</subscript></entry>
<entry>u<subscript>7</subscript></entry>
@@ -2138,15 +2030,7 @@
<entry>V4L2_MBUS_FMT_Y12_1X12</entry>
<entry>0x2013</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-20;
<entry>y<subscript>11</subscript></entry>
<entry>y<subscript>10</subscript></entry>
<entry>y<subscript>9</subscript></entry>
@@ -2164,11 +2048,7 @@
<entry>V4L2_MBUS_FMT_UYVY8_1X16</entry>
<entry>0x200f</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -2190,11 +2070,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -2216,11 +2092,7 @@
<entry>V4L2_MBUS_FMT_VYUY8_1X16</entry>
<entry>0x2010</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>v<subscript>7</subscript></entry>
<entry>v<subscript>6</subscript></entry>
<entry>v<subscript>5</subscript></entry>
@@ -2242,11 +2114,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>u<subscript>7</subscript></entry>
<entry>u<subscript>6</subscript></entry>
<entry>u<subscript>5</subscript></entry>
@@ -2268,11 +2136,7 @@
<entry>V4L2_MBUS_FMT_YUYV8_1X16</entry>
<entry>0x2011</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2294,11 +2158,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2320,11 +2180,7 @@
<entry>V4L2_MBUS_FMT_YVYU8_1X16</entry>
<entry>0x2012</entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2346,11 +2202,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2372,10 +2224,7 @@
<entry>V4L2_MBUS_FMT_YDYUYDYV8_1X16</entry>
<entry>0x2014</entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2397,10 +2246,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2422,10 +2268,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2447,10 +2290,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ &dash-ent-16;
<entry>y<subscript>7</subscript></entry>
<entry>y<subscript>6</subscript></entry>
<entry>y<subscript>5</subscript></entry>
@@ -2472,7 +2312,7 @@
<entry>V4L2_MBUS_FMT_YUYV10_1X20</entry>
<entry>0x200d</entry>
<entry></entry>
- &dash-ent-10;
+ &dash-ent-12;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2498,7 +2338,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
+ &dash-ent-12;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2524,7 +2364,7 @@
<entry>V4L2_MBUS_FMT_YVYU10_1X20</entry>
<entry>0x200e</entry>
<entry></entry>
- &dash-ent-10;
+ &dash-ent-12;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2550,7 +2390,7 @@
<entry></entry>
<entry></entry>
<entry></entry>
- &dash-ent-10;
+ &dash-ent-12;
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2576,6 +2416,8 @@
<entry>V4L2_MBUS_FMT_YUV10_1X30</entry>
<entry>0x2016</entry>
<entry></entry>
+ <entry>-</entry>
+ <entry>-</entry>
<entry>y<subscript>9</subscript></entry>
<entry>y<subscript>8</subscript></entry>
<entry>y<subscript>7</subscript></entry>
@@ -2607,6 +2449,43 @@
<entry>v<subscript>1</subscript></entry>
<entry>v<subscript>0</subscript></entry>
</row>
+ <row id="V4L2-MBUS-FMT-AYUV8-1X32">
+ <entry>V4L2_MBUS_FMT_AYUV8_1X32</entry>
+ <entry>0x2017</entry>
+ <entry></entry>
+ <entry>a<subscript>7</subscript></entry>
+ <entry>a<subscript>6</subscript></entry>
+ <entry>a<subscript>5</subscript></entry>
+ <entry>a<subscript>4</subscript></entry>
+ <entry>a<subscript>3</subscript></entry>
+ <entry>a<subscript>2</subscript></entry>
+ <entry>a<subscript>1</subscript></entry>
+ <entry>a<subscript>0</subscript></entry>
+ <entry>y<subscript>7</subscript></entry>
+ <entry>y<subscript>6</subscript></entry>
+ <entry>y<subscript>5</subscript></entry>
+ <entry>y<subscript>4</subscript></entry>
+ <entry>y<subscript>3</subscript></entry>
+ <entry>y<subscript>2</subscript></entry>
+ <entry>y<subscript>1</subscript></entry>
+ <entry>y<subscript>0</subscript></entry>
+ <entry>u<subscript>7</subscript></entry>
+ <entry>u<subscript>6</subscript></entry>
+ <entry>u<subscript>5</subscript></entry>
+ <entry>u<subscript>4</subscript></entry>
+ <entry>u<subscript>3</subscript></entry>
+ <entry>u<subscript>2</subscript></entry>
+ <entry>u<subscript>1</subscript></entry>
+ <entry>u<subscript>0</subscript></entry>
+ <entry>v<subscript>7</subscript></entry>
+ <entry>v<subscript>6</subscript></entry>
+ <entry>v<subscript>5</subscript></entry>
+ <entry>v<subscript>4</subscript></entry>
+ <entry>v<subscript>3</subscript></entry>
+ <entry>v<subscript>2</subscript></entry>
+ <entry>v<subscript>1</subscript></entry>
+ <entry>v<subscript>0</subscript></entry>
+ </row>
</tbody>
</tgroup>
</table>
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl
index 6a8b715..07e7eea 100644
--- a/Documentation/DocBook/media_api.tmpl
+++ b/Documentation/DocBook/media_api.tmpl
@@ -22,8 +22,14 @@
<!-- LinuxTV v4l-dvb repository. -->
<!ENTITY v4l-dvb "<ulink url='http://linuxtv.org/repo/'>http://linuxtv.org/repo/</ulink>">
+<!ENTITY dash-ent-8 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
<!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
+<!ENTITY dash-ent-12 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
+<!ENTITY dash-ent-14 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
<!ENTITY dash-ent-16 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
+<!ENTITY dash-ent-20 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
+<!ENTITY dash-ent-22 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
+<!ENTITY dash-ent-24 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
]>
<book id="media_api">
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 6ee63d0..a960125 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -37,7 +37,7 @@
enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_FIXED = 0x0001,
- /* RGB - next is 0x100d */
+ /* RGB - next is 0x100e */
V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
@@ -50,8 +50,9 @@ enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
+ V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
- /* YUV (including grey) - next is 0x2017 */
+ /* YUV (including grey) - next is 0x2018 */
V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
@@ -74,6 +75,7 @@ enum v4l2_mbus_pixelcode {
V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
+ V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
/* Bayer - next is 0x3019 */
V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 4/5] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats
2013-07-17 14:54 [PATCH v2 0/5] Renesas VSP1 driver Laurent Pinchart
` (2 preceding siblings ...)
2013-07-17 14:54 ` [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses Laurent Pinchart
@ 2013-07-17 14:54 ` Laurent Pinchart
2013-07-24 21:23 ` Sylwester Nawrocki
[not found] ` <1374072882-14598-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
4 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 14:54 UTC (permalink / raw)
To: linux-media; +Cc: linux-sh, Hans Verkuil, Sakari Ailus
NV16M and NV61M are planar YCbCr 4:2:2 and YCrCb 4:2:2 formats with a
luma plane followed by an interleaved chroma plane. The planes are not
required to be contiguous in memory, and the formats can only be used
with the multi-planar formats API.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
Documentation/DocBook/media/v4l/pixfmt-nv16m.xml | 170 +++++++++++++++++++++++
Documentation/DocBook/media/v4l/pixfmt.xml | 1 +
include/uapi/linux/videodev2.h | 2 +
3 files changed, 173 insertions(+)
create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
new file mode 100644
index 0000000..84a8bb3
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
@@ -0,0 +1,170 @@
+ <refentry>
+ <refmeta>
+ <refentrytitle>V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')</refentrytitle>
+ &manvol;
+ </refmeta>
+ <refnamediv>
+ <refname id="V4L2-PIX-FMT-NV16M"><constant>V4L2_PIX_FMT_NV16M</constant></refname>
+ <refname id="V4L2-PIX-FMT-NV61M"><constant>V4L2_PIX_FMT_NV61M</constant></refname>
+ <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV16</constant> and <constant>V4L2_PIX_FMT_NV61</constant> with planes
+ non contiguous in memory. </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+
+ <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
+The three components are separated into two sub-images or planes.
+<constant>V4L2_PIX_FMT_NV16M</constant> differs from <constant>V4L2_PIX_FMT_NV16
+</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
+plane do not necessarily immediately follows the luma plane.
+The luminance data occupies the first plane. The Y plane has one byte per pixel.
+In the second plane there is a chrominance data with alternating chroma samples.
+The CbCr plane is the same width and height, in bytes, as the Y plane.
+Each CbCr pair belongs to four pixels. For example,
+Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
+Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
+Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
+<constant>V4L2_PIX_FMT_NV61M</constant> is the same as <constant>V4L2_PIX_FMT_NV16M</constant>
+except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
+
+ <para><constant>V4L2_PIX_FMT_NV16M</constant> is intended to be
+used only in drivers and applications that support the multi-planar API,
+described in <xref linkend="planar-apis"/>. </para>
+
+ <example>
+ <title><constant>V4L2_PIX_FMT_NV16M</constant> 4 × 4 pixel image</title>
+
+ <formalpara>
+ <title>Byte Order.</title>
+ <para>Each cell is one byte.
+ <informaltable frame="none">
+ <tgroup cols="5" align="center">
+ <colspec align="left" colwidth="2*" />
+ <tbody valign="top">
+ <row>
+ <entry>start0 + 0:</entry>
+ <entry>Y'<subscript>00</subscript></entry>
+ <entry>Y'<subscript>01</subscript></entry>
+ <entry>Y'<subscript>02</subscript></entry>
+ <entry>Y'<subscript>03</subscript></entry>
+ </row>
+ <row>
+ <entry>start0 + 4:</entry>
+ <entry>Y'<subscript>10</subscript></entry>
+ <entry>Y'<subscript>11</subscript></entry>
+ <entry>Y'<subscript>12</subscript></entry>
+ <entry>Y'<subscript>13</subscript></entry>
+ </row>
+ <row>
+ <entry>start0 + 8:</entry>
+ <entry>Y'<subscript>20</subscript></entry>
+ <entry>Y'<subscript>21</subscript></entry>
+ <entry>Y'<subscript>22</subscript></entry>
+ <entry>Y'<subscript>23</subscript></entry>
+ </row>
+ <row>
+ <entry>start0 + 12:</entry>
+ <entry>Y'<subscript>30</subscript></entry>
+ <entry>Y'<subscript>31</subscript></entry>
+ <entry>Y'<subscript>32</subscript></entry>
+ <entry>Y'<subscript>33</subscript></entry>
+ </row>
+ <row>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>start1 + 0:</entry>
+ <entry>Cb<subscript>00</subscript></entry>
+ <entry>Cr<subscript>00</subscript></entry>
+ <entry>Cb<subscript>02</subscript></entry>
+ <entry>Cr<subscript>02</subscript></entry>
+ </row>
+ <row>
+ <entry>start1 + 4:</entry>
+ <entry>Cb<subscript>10</subscript></entry>
+ <entry>Cr<subscript>10</subscript></entry>
+ <entry>Cb<subscript>12</subscript></entry>
+ <entry>Cr<subscript>12</subscript></entry>
+ </row>
+ <row>
+ <entry>start1 + 8:</entry>
+ <entry>Cb<subscript>20</subscript></entry>
+ <entry>Cr<subscript>20</subscript></entry>
+ <entry>Cb<subscript>22</subscript></entry>
+ <entry>Cr<subscript>22</subscript></entry>
+ </row>
+ <row>
+ <entry>start1 + 12:</entry>
+ <entry>Cb<subscript>30</subscript></entry>
+ <entry>Cr<subscript>30</subscript></entry>
+ <entry>Cb<subscript>32</subscript></entry>
+ <entry>Cr<subscript>32</subscript></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>Color Sample Location.</title>
+ <para>
+ <informaltable frame="none">
+ <tgroup cols="7" align="center">
+ <tbody valign="top">
+ <row>
+ <entry></entry>
+ <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
+ <entry>2</entry><entry></entry><entry>3</entry>
+ </row>
+ <row>
+ <entry>0</entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry></entry><entry>C</entry><entry></entry><entry></entry>
+ <entry></entry><entry>C</entry><entry></entry>
+ </row>
+ <row>
+ <entry>1</entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry></entry><entry>C</entry><entry></entry><entry></entry>
+ <entry></entry><entry>C</entry><entry></entry>
+ </row>
+ <row>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry></entry><entry>C</entry><entry></entry><entry></entry>
+ <entry></entry><entry>C</entry><entry></entry>
+ </row>
+ <row>
+ <entry>3</entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
+ <entry>Y</entry><entry></entry><entry>Y</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry></entry><entry>C</entry><entry></entry><entry></entry>
+ <entry></entry><entry>C</entry><entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </formalpara>
+ </example>
+ </refsect1>
+ </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 99b8d2a..16db350 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -718,6 +718,7 @@ information.</para>
&sub-nv12m;
&sub-nv12mt;
&sub-nv16;
+ &sub-nv16m;
&sub-nv24;
&sub-m420;
</section>
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 95ef455..fec0c20 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -348,6 +348,8 @@ struct v4l2_pix_format {
/* two non contiguous planes - one Y, one Cr + Cb interleaved */
#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
+#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
+#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/5] media: Fix circular graph traversal
2013-07-17 14:54 ` [PATCH v2 1/5] media: Fix circular graph traversal Laurent Pinchart
@ 2013-07-17 19:47 ` Sakari Ailus
2013-07-17 23:06 ` Laurent Pinchart
0 siblings, 1 reply; 18+ messages in thread
From: Sakari Ailus @ 2013-07-17 19:47 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, linux-sh, Hans Verkuil
Hi Laurent,
On Wed, Jul 17, 2013 at 04:54:38PM +0200, Laurent Pinchart wrote:
> The graph traversal API (media_entity_graph_walk_*) will fail to
> correctly walk the graph when circular links exist. Fix it by checking
> whether an entity is already present in the stack before pushing it.
We never had any multiply connected graphs (ignoring direction, nor
supported them) before. So this is rather a patch that adds support for
those instead of fixing it. :-)
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/media/media-entity.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index cb30ffb..c8aba5e 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -121,9 +121,9 @@ static struct media_entity *stack_pop(struct media_entity_graph *graph)
> return entity;
> }
>
> -#define stack_peek(en) ((en)->stack[(en)->top - 1].entity)
> -#define link_top(en) ((en)->stack[(en)->top].link)
> -#define stack_top(en) ((en)->stack[(en)->top].entity)
> +#define stack_peek(en, i) ((en)->stack[i].entity)
> +#define link_top(en) ((en)->stack[(en)->top].link)
> +#define stack_top(en) ((en)->stack[(en)->top].entity)
>
> /**
> * media_entity_graph_walk_start - Start walking the media graph at a given entity
> @@ -159,6 +159,8 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
> struct media_entity *
> media_entity_graph_walk_next(struct media_entity_graph *graph)
> {
> + unsigned int i;
> +
> if (stack_top(graph) = NULL)
> return NULL;
>
> @@ -181,8 +183,13 @@ media_entity_graph_walk_next(struct media_entity_graph *graph)
> /* Get the entity in the other end of the link . */
> next = media_entity_other(entity, link);
>
> - /* Was it the entity we came here from? */
> - if (next = stack_peek(graph)) {
> + /* Is the entity already in the path? */
> + for (i = 1; i < graph->top; ++i) {
> + if (next = stack_peek(graph, i))
> + break;
> + }
> +
> + if (i < graph->top) {
> link_top(graph)++;
> continue;
> }
I think you should also ensure a node in the graph hasn't been enumerated in
the past; otherwise it's possible to do that multiple times in a multiply
connected graph.
How about using a bit field that contained as many bits as there were
entities? It's also faster to check for a single bit than loop over the
whole path for each entity, which certainly will start showing in execution
time with these link numbres.
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/5] media: Fix circular graph traversal
2013-07-17 19:47 ` Sakari Ailus
@ 2013-07-17 23:06 ` Laurent Pinchart
2013-07-18 10:22 ` Sakari Ailus
0 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-17 23:06 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Sakari,
On Wednesday 17 July 2013 22:47:03 Sakari Ailus wrote:
> On Wed, Jul 17, 2013 at 04:54:38PM +0200, Laurent Pinchart wrote:
> > The graph traversal API (media_entity_graph_walk_*) will fail to
> > correctly walk the graph when circular links exist. Fix it by checking
> > whether an entity is already present in the stack before pushing it.
>
> We never had any multiply connected graphs (ignoring direction, nor
> supported them) before. So this is rather a patch that adds support for
> those instead of fixing it. :-)
Good point, I'll add support for your comment to the commit message :-D
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >
> > drivers/media/media-entity.c | 17 ++++++++++++-----
> > 1 file changed, 12 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> > index cb30ffb..c8aba5e 100644
> > --- a/drivers/media/media-entity.c
> > +++ b/drivers/media/media-entity.c
> > @@ -121,9 +121,9 @@ static struct media_entity *stack_pop(struct
> > media_entity_graph *graph)
> > return entity;
> > }
> >
> > -#define stack_peek(en) ((en)->stack[(en)->top - 1].entity)
> > -#define link_top(en) ((en)->stack[(en)->top].link)
> > -#define stack_top(en) ((en)->stack[(en)->top].entity)
> > +#define stack_peek(en, i) ((en)->stack[i].entity)
> > +#define link_top(en) ((en)->stack[(en)->top].link)
> > +#define stack_top(en) ((en)->stack[(en)->top].entity)
> >
> > /**
> > * media_entity_graph_walk_start - Start walking the media graph at a
> > given entity>
> > @@ -159,6 +159,8 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
> >
> > struct media_entity *
> > media_entity_graph_walk_next(struct media_entity_graph *graph)
> > {
> > + unsigned int i;
> > +
> > if (stack_top(graph) = NULL)
> > return NULL;
> >
> > @@ -181,8 +183,13 @@ media_entity_graph_walk_next(struct
> > media_entity_graph *graph)>
> > /* Get the entity in the other end of the link . */
> > next = media_entity_other(entity, link);
> >
> > - /* Was it the entity we came here from? */
> > - if (next = stack_peek(graph)) {
> > + /* Is the entity already in the path? */
> > + for (i = 1; i < graph->top; ++i) {
> > + if (next = stack_peek(graph, i))
> > + break;
> > + }
> > +
> > + if (i < graph->top) {
> > link_top(graph)++;
> > continue;
> > }
>
> I think you should also ensure a node in the graph hasn't been enumerated in
> the past; otherwise it's possible to do that multiple times in a multiply
> connected graph.
I'm not sure to follow you here, could you please elaborate ?
> How about using a bit field that contained as many bits as there were
> entities? It's also faster to check for a single bit than loop over the
> whole path for each entity, which certainly will start showing in execution
> time with these link numbres.
That's possible, yes. We would then need to dynamically allocate the bit field
in the start function, and add a new media_entity_graph_walk_end() function (I
would then rename media_entity_graph_walk_start() to
media_entity_graph_walk_begin()) to free the bit field. If you think that's
worth it I can give it a try.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/5] media: Fix circular graph traversal
2013-07-17 23:06 ` Laurent Pinchart
@ 2013-07-18 10:22 ` Sakari Ailus
2013-07-24 14:09 ` Laurent Pinchart
0 siblings, 1 reply; 18+ messages in thread
From: Sakari Ailus @ 2013-07-18 10:22 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Laurent,
On Thu, Jul 18, 2013 at 01:06:40AM +0200, Laurent Pinchart wrote:
> On Wednesday 17 July 2013 22:47:03 Sakari Ailus wrote:
> > On Wed, Jul 17, 2013 at 04:54:38PM +0200, Laurent Pinchart wrote:
> > > The graph traversal API (media_entity_graph_walk_*) will fail to
> > > correctly walk the graph when circular links exist. Fix it by checking
> > > whether an entity is already present in the stack before pushing it.
> >
> > We never had any multiply connected graphs (ignoring direction, nor
> > supported them) before. So this is rather a patch that adds support for
> > those instead of fixing it. :-)
>
> Good point, I'll add support for your comment to the commit message :-D
>
> > > Signed-off-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > > ---
> > >
> > > drivers/media/media-entity.c | 17 ++++++++++++-----
> > > 1 file changed, 12 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> > > index cb30ffb..c8aba5e 100644
> > > --- a/drivers/media/media-entity.c
> > > +++ b/drivers/media/media-entity.c
> > > @@ -121,9 +121,9 @@ static struct media_entity *stack_pop(struct
> > > media_entity_graph *graph)
> > > return entity;
> > > }
> > >
> > > -#define stack_peek(en) ((en)->stack[(en)->top - 1].entity)
> > > -#define link_top(en) ((en)->stack[(en)->top].link)
> > > -#define stack_top(en) ((en)->stack[(en)->top].entity)
> > > +#define stack_peek(en, i) ((en)->stack[i].entity)
> > > +#define link_top(en) ((en)->stack[(en)->top].link)
> > > +#define stack_top(en) ((en)->stack[(en)->top].entity)
> > >
> > > /**
> > > * media_entity_graph_walk_start - Start walking the media graph at a
> > > given entity>
> > > @@ -159,6 +159,8 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
> > >
> > > struct media_entity *
> > > media_entity_graph_walk_next(struct media_entity_graph *graph)
> > > {
> > > + unsigned int i;
> > > +
> > > if (stack_top(graph) = NULL)
> > > return NULL;
> > >
> > > @@ -181,8 +183,13 @@ media_entity_graph_walk_next(struct
> > > media_entity_graph *graph)>
> > > /* Get the entity in the other end of the link . */
> > > next = media_entity_other(entity, link);
> > >
> > > - /* Was it the entity we came here from? */
> > > - if (next = stack_peek(graph)) {
> > > + /* Is the entity already in the path? */
> > > + for (i = 1; i < graph->top; ++i) {
> > > + if (next = stack_peek(graph, i))
> > > + break;
> > > + }
> > > +
> > > + if (i < graph->top) {
> > > link_top(graph)++;
> > > continue;
> > > }
> >
> > I think you should also ensure a node in the graph hasn't been enumerated in
> > the past; otherwise it's possible to do that multiple times in a multiply
> > connected graph.
>
> I'm not sure to follow you here, could you please elaborate ?
Depth-first search in a multiply connected graph must avoid finding again
the same nodes. As we didn't have multiply connected graphs, the only thing
that was necessary was to avoid going back exactly the same route that the
search came from.
In a multiply connected graph a node can be reached through multiple paths.
This means that instead of avoiding to go back where we came from (either
the previous node or the full stack), we must avoid finding again the same
nodes we've found previously.
> > How about using a bit field that contained as many bits as there were
> > entities? It's also faster to check for a single bit than loop over the
> > whole path for each entity, which certainly will start showing in execution
> > time with these link numbres.
>
> That's possible, yes. We would then need to dynamically allocate the bit field
> in the start function, and add a new media_entity_graph_walk_end() function (I
> would then rename media_entity_graph_walk_start() to
> media_entity_graph_walk_begin()) to free the bit field. If you think that's
> worth it I can give it a try.
Do you think we could define a maximum number of entities? It can be
increased if any driver happens to need more. I'd be more comfortable in
doing the allocation in the stack that way: the number will be relatively
small in any case, say, 32 or 64 bits for which kzalloc() would be overkill.
--
Cheers,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
[not found] ` <1374072882-14598-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
@ 2013-07-24 10:38 ` Katsuya MATSUBARA
2013-07-24 15:05 ` Laurent Pinchart
2013-07-24 22:48 ` Sakari Ailus
1 sibling, 1 reply; 18+ messages in thread
From: Katsuya MATSUBARA @ 2013-07-24 10:38 UTC (permalink / raw)
To: laurent.pinchart+renesas; +Cc: linux-media, linux-sh, hverkuil, sakari.ailus
Hi Laurent,
Thank you for your great work for VSP1.
Some comments below.
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Date: Wed, 17 Jul 2013 16:54:42 +0200
(snip)
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> +/*
> + * vsp1_drv.c -- R-Car VSP1 Driver
> + *
> + * Copyright (C) 2013 Renesas Corporation
> + *
> + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/videodev2.h>
> +
> +#include "vsp1.h"
> +#include "vsp1_lif.h"
> +#include "vsp1_rwpf.h"
> +#include "vsp1_uds.h"
> +
> +/* -----------------------------------------------------------------------------
> + * Interrupt Handling
> + */
> +
> +static irqreturn_t vsp1_irq_handler(int irq, void *data)
> +{
> + struct vsp1_device *vsp1 = data;
> + irqreturn_t ret = IRQ_NONE;
> + unsigned int i;
> +
> + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> + struct vsp1_rwpf *wpf = vsp1->wpf[i];
> + struct vsp1_pipeline *pipe;
> + u32 status;
> +
> + if (wpf = NULL)
> + continue;
> +
> + pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity);
> + status = vsp1_read(vsp1, VI6_WPF_IRQ_STA(i));
> + vsp1_write(vsp1, VI6_WPF_IRQ_STA(i), ~status);
The value set into the VI6_WPF_IRQ_STA register should be masked
with VI6_WFP_IRQ_STA_FRE since unused (upper) bits in the register
must be written with 0.
(snip)
> +static int vsp1_create_links(struct vsp1_device *vsp1, struct vsp1_entity *sink)
> +{
> + struct media_entity *entity = &sink->subdev.entity;
> + struct vsp1_entity *source;
> + unsigned int pad;
> + int ret;
> +
> + list_for_each_entry(source, &vsp1->entities, list_dev) {
> + u32 flags;
> +
> + if (source->type = sink->type)
> + continue;
> +
> + if (source->type = VSP1_ENTITY_LIF ||
> + source->type = VSP1_ENTITY_WPF)
> + continue;
> +
> + flags = source->type = VSP1_ENTITY_RPF &&
> + sink->type = VSP1_ENTITY_WPF &&
> + source->index = sink->index
> + ? MEDIA_LNK_FL_ENABLED : 0;
> +
> + for (pad = 0; pad < entity->num_pads; ++pad) {
> + if (!(entity->pads[pad].flags & MEDIA_PAD_FL_SINK))
> + continue;
> +
> + ret = media_entity_create_link(&source->subdev.entity,
> + source->source_pad,
> + entity, pad, flags);
> + if (ret < 0)
> + return ret;
This initialization enables some of links as the initial status.
I think link_setup() for each linked entity should be invoked here
to set up the sink value in the vsp_entity structure.
(snip)
> +++ b/drivers/media/platform/vsp1/vsp1_regs.h
> @@ -0,0 +1,581 @@
> +/*
> + * vsp1_regs.h -- R-Car VSP1 Registers Definitions
> + *
> + * Copyright (C) 2013 Renesas Electronics Corporation
> + *
> + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.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 __VSP1_REGS_H__
> +#define __VSP1_REGS_H__
> +
(snip)
> +/* -----------------------------------------------------------------------------
> + * HGO Control Registers
> + */
> +
> +#define VI6_HGO_OFFSET 0x3000
> +#define VI6_HGO_SIZE 0x3004
> +#define VI6_HGO_MODE 0x3008
> +#define VI6_HGO_LB_TH 0x300c
> +#define VI6_HGO_LBn_H (0x3010 + (n) * 8)
> +#define VI6_HGO_LBn_V (0x3014 + (n) * 8)
It looks like the 'n' argument is missing for VI6_HGO_LBn_H
and VI6_HGO_LBn_V.
> +#define VI6_HGO_R_HISTO 0x3030
> +#define VI6_HGO_R_MAXMIN 0x3130
> +#define VI6_HGO_R_SUM 0x3134
> +#define VI6_HGO_R_LB_DET 0x3138
> +#define VI6_HGO_G_HISTO 0x3140
> +#define VI6_HGO_G_MAXMIN 0x3240
> +#define VI6_HGO_G_SUM 0x3244
> +#define VI6_HGO_G_LB_DET 0x3248
> +#define VI6_HGO_B_HISTO 0x3250
> +#define VI6_HGO_B_MAXMIN 0x3350
> +#define VI6_HGO_B_SUM 0x3354
> +#define VI6_HGO_B_LB_DET 0x3358
> +#define VI6_HGO_REGRST 0x33fc
> +
> +/* -----------------------------------------------------------------------------
> + * HGT Control Registers
> + */
> +
> +#define VI6_HGT_OFFSET 0x3400
> +#define VI6_HGT_SIZE 0x3404
> +#define VI6_HGT_MODE 0x3408
> +#define VI6_HGT_HUE_AREA(n) (0x340c + (n) * 4)
> +#define VI6_HGT_LB_TH 0x3424
> +#define VI6_HGT_LBn_H (0x3438 + (n) * 8)
> +#define VI6_HGT_LBn_V (0x342c + (n) * 8)
The 'n' arguments for VI6_HGT_LBn_H and VI6_HGT_LBn_H are missing too.
(snip)
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -0,0 +1,1129 @@
> +/*
> + * vsp1_video.c -- R-Car VSP1 Video Node
> + *
> + * Copyright (C) 2013 Renesas Corporation
> + *
> + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + */
> +
(snip)
> +static int __vsp1_video_try_format(struct vsp1_video *video,
> + struct v4l2_pix_format_mplane *pix,
> + const struct vsp1_format_info **fmtinfo)
> +{
> + const struct vsp1_format_info *info;
> + unsigned int width = pix->width;
> + unsigned int height = pix->height;
> + unsigned int i;
> +
> + /* Retrieve format information and select the default format if the
> + * requested format isn't supported.
> + */
> + info = vsp1_get_format_info(pix->pixelformat);
> + if (info = NULL)
> + info = vsp1_get_format_info(VSP1_VIDEO_DEF_FORMAT);
> +
> + pix->pixelformat = info->fourcc;
> + pix->colorspace = V4L2_COLORSPACE_SRGB;
> + pix->field = V4L2_FIELD_NONE;
> + memset(pix->reserved, 0, sizeof(pix->reserved));
> +
> + /* Align the width and height for YUV 4:2:2 and 4:2:0 formats. */
> + width = round_down(width, info->hsub);
> + height = round_down(height, info->vsub);
> +
> + /* Clamp the width and height. */
> + pix->width = clamp(width, VSP1_VIDEO_MIN_WIDTH, VSP1_VIDEO_MAX_WIDTH);
> + pix->height = clamp(height, VSP1_VIDEO_MIN_HEIGHT,
> + VSP1_VIDEO_MAX_HEIGHT);
> +
> + /* Compute and clamp the stride and image size. */
> + for (i = 0; i < max(info->planes, 2U); ++i) {
> + unsigned int hsub = i > 0 ? info->hsub : 1;
> + unsigned int vsub = i > 0 ? info->vsub : 1;
> + unsigned int bpl;
> +
> + bpl = clamp_t(unsigned int, pix->plane_fmt[i].bytesperline,
> + pix->width / hsub * info->bpp[i] / 8,
> + round_down(65535U, 128));
> +
> + pix->plane_fmt[i].bytesperline = round_up(bpl, 128);
I am not sure why 'bytesperlines' should be aligned to 128 bytes.
VSP1 doesn't seem to have this limitation.
> + pix->plane_fmt[i].sizeimage = bpl * pix->height / vsub;
If the round up for bytesperlines is required, sizeimage should be
calculated with 'bytesperline' rather than 'bpl'.
Actually, I had been implementing a V4L2 MEM2MEM driver for VIO6,
which is an older version of the VSP1 used by many of the current
Renesas SoCs.
VSP1 should be compatible with VIO6, so I rebased my work onto your
implementation. I will post a patch to add support of VIO6 for your
code once it is finished.
Thanks,
---
Katsuya Matsubara / IGEL Co., Ltd
matsu@igel.co.jp
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/5] media: Fix circular graph traversal
2013-07-18 10:22 ` Sakari Ailus
@ 2013-07-24 14:09 ` Laurent Pinchart
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-24 14:09 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Sakari,
On Thursday 18 July 2013 13:22:09 Sakari Ailus wrote:
> On Thu, Jul 18, 2013 at 01:06:40AM +0200, Laurent Pinchart wrote:
> > On Wednesday 17 July 2013 22:47:03 Sakari Ailus wrote:
> > > On Wed, Jul 17, 2013 at 04:54:38PM +0200, Laurent Pinchart wrote:
> > > > The graph traversal API (media_entity_graph_walk_*) will fail to
> > > > correctly walk the graph when circular links exist. Fix it by checking
> > > > whether an entity is already present in the stack before pushing it.
> > >
> > > We never had any multiply connected graphs (ignoring direction, nor
> > > supported them) before. So this is rather a patch that adds support for
> > > those instead of fixing it. :-)
> >
> > Good point, I'll add support for your comment to the commit message :-D
> >
> > > > Signed-off-by: Laurent Pinchart
> > > > <laurent.pinchart+renesas@ideasonboard.com>
> > > > ---
> > > >
> > > > drivers/media/media-entity.c | 17 ++++++++++++-----
> > > > 1 file changed, 12 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/media/media-entity.c
> > > > b/drivers/media/media-entity.c
> > > > index cb30ffb..c8aba5e 100644
> > > > --- a/drivers/media/media-entity.c
> > > > +++ b/drivers/media/media-entity.c
> > > > @@ -121,9 +121,9 @@ static struct media_entity *stack_pop(struct
> > > > media_entity_graph *graph)
> > > >
> > > > return entity;
> > > >
> > > > }
> > > >
> > > > -#define stack_peek(en) ((en)->stack[(en)->top - 1].entity)
> > > > -#define link_top(en) ((en)->stack[(en)->top].link)
> > > > -#define stack_top(en) ((en)->stack[(en)->top].entity)
> > > > +#define stack_peek(en, i) ((en)->stack[i].entity)
> > > > +#define link_top(en) ((en)->stack[(en)->top].link)
> > > > +#define stack_top(en) ((en)->stack[(en)->top].entity)
> > > >
> > > > /**
> > > >
> > > > * media_entity_graph_walk_start - Start walking the media graph at a
> > > > given entity>
> > > >
> > > > @@ -159,6 +159,8 @@ EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
> > > >
> > > > struct media_entity *
> > > > media_entity_graph_walk_next(struct media_entity_graph *graph)
> > > > {
> > > >
> > > > + unsigned int i;
> > > > +
> > > >
> > > > if (stack_top(graph) = NULL)
> > > >
> > > > return NULL;
> > > >
> > > > @@ -181,8 +183,13 @@ media_entity_graph_walk_next(struct
> > > > media_entity_graph *graph)>
> > > >
> > > > /* Get the entity in the other end of the link . */
> > > > next = media_entity_other(entity, link);
> > > >
> > > > - /* Was it the entity we came here from? */
> > > > - if (next = stack_peek(graph)) {
> > > > + /* Is the entity already in the path? */
> > > > + for (i = 1; i < graph->top; ++i) {
> > > > + if (next = stack_peek(graph, i))
> > > > + break;
> > > > + }
> > > > +
> > > > + if (i < graph->top) {
> > > >
> > > > link_top(graph)++;
> > > > continue;
> > > >
> > > > }
> > >
> > > I think you should also ensure a node in the graph hasn't been
> > > enumerated in the past; otherwise it's possible to do that multiple
> > > times in a multiply connected graph.
> >
> > I'm not sure to follow you here, could you please elaborate ?
>
> Depth-first search in a multiply connected graph must avoid finding again
> the same nodes. As we didn't have multiply connected graphs, the only thing
> that was necessary was to avoid going back exactly the same route that the
> search came from.
>
> In a multiply connected graph a node can be reached through multiple paths.
> This means that instead of avoiding to go back where we came from (either
> the previous node or the full stack), we must avoid finding again the same
> nodes we've found previously.
Indeed, I somehow managed to overlook the issue. That's not really a problem
in my case, as circular graphs are not supported by my hardware, but a generic
solution is indeed needed.
> > > How about using a bit field that contained as many bits as there were
> > > entities? It's also faster to check for a single bit than loop over the
> > > whole path for each entity, which certainly will start showing in
> > > execution time with these link numbres.
> >
> > That's possible, yes. We would then need to dynamically allocate the bit
> > field in the start function, and add a new media_entity_graph_walk_end()
> > function (I would then rename media_entity_graph_walk_start() to
> > media_entity_graph_walk_begin()) to free the bit field. If you think
> > that's worth it I can give it a try.
>
> Do you think we could define a maximum number of entities? It can be
> increased if any driver happens to need more. I'd be more comfortable in
> doing the allocation in the stack that way: the number will be relatively
> small in any case, say, 32 or 64 bits for which kzalloc() would be overkill.
This should work for now, but I'm a bit concerned that it would break in the
future if we introduce dynamic entity (un)registration. In that case the
maximum number of entities could be capped, but the IDs will increase.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
2013-07-24 10:38 ` [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver Katsuya MATSUBARA
@ 2013-07-24 15:05 ` Laurent Pinchart
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-24 15:05 UTC (permalink / raw)
To: Katsuya MATSUBARA, linux-media; +Cc: linux-sh, hverkuil, sakari.ailus
[-- Attachment #1: Type: text/plain, Size: 8690 bytes --]
Hi Matsubara-san,
On Wednesday 24 July 2013 19:38:39 Katsuya MATSUBARA wrote:
> Hi Laurent,
>
> Thank you for your great work for VSP1.
> Some comments below.
Thank you for the review.
> From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Date: Wed, 17 Jul 2013 16:54:42 +0200
>
> (snip)
>
> > +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> > +/*
> > + * vsp1_drv.c -- R-Car VSP1 Driver
> > + *
> > + * Copyright (C) 2013 Renesas Corporation
> > + *
> > + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include <linux/clk.h>
> > +#include <linux/delay.h>
> > +#include <linux/device.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/module.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/videodev2.h>
> > +
> > +#include "vsp1.h"
> > +#include "vsp1_lif.h"
> > +#include "vsp1_rwpf.h"
> > +#include "vsp1_uds.h"
> > +
> > +/*
> > -------------------------------------------------------------------------
> > ---- + * Interrupt Handling
> > + */
> > +
> > +static irqreturn_t vsp1_irq_handler(int irq, void *data)
> > +{
> > + struct vsp1_device *vsp1 = data;
> > + irqreturn_t ret = IRQ_NONE;
> > + unsigned int i;
> > +
> > + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> > + struct vsp1_rwpf *wpf = vsp1->wpf[i];
> > + struct vsp1_pipeline *pipe;
> > + u32 status;
> > +
> > + if (wpf == NULL)
> > + continue;
> > +
> > + pipe = to_vsp1_pipeline(&wpf->entity.subdev.entity);
> > + status = vsp1_read(vsp1, VI6_WPF_IRQ_STA(i));
> > + vsp1_write(vsp1, VI6_WPF_IRQ_STA(i), ~status);
>
> The value set into the VI6_WPF_IRQ_STA register should be masked with
> VI6_WFP_IRQ_STA_FRE since unused (upper) bits in the register must be
> written with 0.
Good point. I'll fix that.
> > +static int vsp1_create_links(struct vsp1_device *vsp1, struct vsp1_entity
> > *sink) +{
> > + struct media_entity *entity = &sink->subdev.entity;
> > + struct vsp1_entity *source;
> > + unsigned int pad;
> > + int ret;
> > +
> > + list_for_each_entry(source, &vsp1->entities, list_dev) {
> > + u32 flags;
> > +
> > + if (source->type == sink->type)
> > + continue;
> > +
> > + if (source->type == VSP1_ENTITY_LIF ||
> > + source->type == VSP1_ENTITY_WPF)
> > + continue;
> > +
> > + flags = source->type == VSP1_ENTITY_RPF &&
> > + sink->type == VSP1_ENTITY_WPF &&
> > + source->index == sink->index
> > + ? MEDIA_LNK_FL_ENABLED : 0;
> > +
> > + for (pad = 0; pad < entity->num_pads; ++pad) {
> > + if (!(entity->pads[pad].flags & MEDIA_PAD_FL_SINK))
> > + continue;
> > +
> > + ret = media_entity_create_link(&source->subdev.entity,
> > + source->source_pad,
> > + entity, pad, flags);
> > + if (ret < 0)
> > + return ret;
>
> This initialization enables some of links as the initial status.
> I think link_setup() for each linked entity should be invoked here
> to set up the sink value in the vsp_entity structure.
>
> (snip)
>
> > +++ b/drivers/media/platform/vsp1/vsp1_regs.h
> > @@ -0,0 +1,581 @@
> > +/*
> > + * vsp1_regs.h -- R-Car VSP1 Registers Definitions
> > + *
> > + * Copyright (C) 2013 Renesas Electronics Corporation
> > + *
> > + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.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 __VSP1_REGS_H__
> > +#define __VSP1_REGS_H__
> > +
>
> (snip)
>
> > +/*
> > -------------------------------------------------------------------------
> > ---- + * HGO Control Registers
> > + */
> > +
> > +#define VI6_HGO_OFFSET 0x3000
> > +#define VI6_HGO_SIZE 0x3004
> > +#define VI6_HGO_MODE 0x3008
> > +#define VI6_HGO_LB_TH 0x300c
> > +#define VI6_HGO_LBn_H (0x3010 + (n) * 8)
> > +#define VI6_HGO_LBn_V (0x3014 + (n) * 8)
>
> It looks like the 'n' argument is missing for VI6_HGO_LBn_H
> and VI6_HGO_LBn_V.
Will fix as well.
> > +#define VI6_HGO_R_HISTO 0x3030
> > +#define VI6_HGO_R_MAXMIN 0x3130
> > +#define VI6_HGO_R_SUM 0x3134
> > +#define VI6_HGO_R_LB_DET 0x3138
> > +#define VI6_HGO_G_HISTO 0x3140
> > +#define VI6_HGO_G_MAXMIN 0x3240
> > +#define VI6_HGO_G_SUM 0x3244
> > +#define VI6_HGO_G_LB_DET 0x3248
> > +#define VI6_HGO_B_HISTO 0x3250
> > +#define VI6_HGO_B_MAXMIN 0x3350
> > +#define VI6_HGO_B_SUM 0x3354
> > +#define VI6_HGO_B_LB_DET 0x3358
> > +#define VI6_HGO_REGRST 0x33fc
> > +
> > +/*
> > -------------------------------------------------------------------------
> > ---- + * HGT Control Registers
> > + */
> > +
> > +#define VI6_HGT_OFFSET 0x3400
> > +#define VI6_HGT_SIZE 0x3404
> > +#define VI6_HGT_MODE 0x3408
> > +#define VI6_HGT_HUE_AREA(n) (0x340c + (n) * 4)
> > +#define VI6_HGT_LB_TH 0x3424
> > +#define VI6_HGT_LBn_H (0x3438 + (n) * 8)
> > +#define VI6_HGT_LBn_V (0x342c + (n) * 8)
>
> The 'n' arguments for VI6_HGT_LBn_H and VI6_HGT_LBn_H are missing too.
Will fix as well.
> (snip)
>
> > +++ b/drivers/media/platform/vsp1/vsp1_video.c
> > @@ -0,0 +1,1129 @@
> > +/*
> > + * vsp1_video.c -- R-Car VSP1 Video Node
> > + *
> > + * Copyright (C) 2013 Renesas Corporation
> > + *
> > + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
>
> (snip)
>
> > +static int __vsp1_video_try_format(struct vsp1_video *video,
> > + struct v4l2_pix_format_mplane *pix,
> > + const struct vsp1_format_info **fmtinfo)
> > +{
> > + const struct vsp1_format_info *info;
> > + unsigned int width = pix->width;
> > + unsigned int height = pix->height;
> > + unsigned int i;
> > +
> > + /* Retrieve format information and select the default format if the
> > + * requested format isn't supported.
> > + */
> > + info = vsp1_get_format_info(pix->pixelformat);
> > + if (info == NULL)
> > + info = vsp1_get_format_info(VSP1_VIDEO_DEF_FORMAT);
> > +
> > + pix->pixelformat = info->fourcc;
> > + pix->colorspace = V4L2_COLORSPACE_SRGB;
> > + pix->field = V4L2_FIELD_NONE;
> > + memset(pix->reserved, 0, sizeof(pix->reserved));
> > +
> > + /* Align the width and height for YUV 4:2:2 and 4:2:0 formats. */
> > + width = round_down(width, info->hsub);
> > + height = round_down(height, info->vsub);
> > +
> > + /* Clamp the width and height. */
> > + pix->width = clamp(width, VSP1_VIDEO_MIN_WIDTH,
VSP1_VIDEO_MAX_WIDTH);
> > + pix->height = clamp(height, VSP1_VIDEO_MIN_HEIGHT,
> > + VSP1_VIDEO_MAX_HEIGHT);
> > +
> > + /* Compute and clamp the stride and image size. */
> > + for (i = 0; i < max(info->planes, 2U); ++i) {
> > + unsigned int hsub = i > 0 ? info->hsub : 1;
> > + unsigned int vsub = i > 0 ? info->vsub : 1;
> > + unsigned int bpl;
> > +
> > + bpl = clamp_t(unsigned int, pix->plane_fmt[i].bytesperline,
> > + pix->width / hsub * info->bpp[i] / 8,
> > + round_down(65535U, 128));
> > +
> > + pix->plane_fmt[i].bytesperline = round_up(bpl, 128);
>
> I am not sure why 'bytesperlines' should be aligned to 128 bytes. VSP1
> doesn't seem to have this limitation.
If I recall correctly, strides lower than 128 pixels resulted in corruption in
the output image. Please see the attached file for an example. That was in the
beginning of VSP1 development so the problem might have been unrelated and
fixed by something completely different, it would be worth it retrying with
different alignment values.
> > + pix->plane_fmt[i].sizeimage = bpl * pix->height / vsub;
>
> If the round up for bytesperlines is required, sizeimage should be
> calculated with 'bytesperline' rather than 'bpl'.
Indeed, I will fix that.
> Actually, I had been implementing a V4L2 MEM2MEM driver for VIO6, which is
> an older version of the VSP1 used by many of the current Renesas SoCs.
>
> VSP1 should be compatible with VIO6, so I rebased my work onto your
> implementation. I will post a patch to add support of VIO6 for your code
> once it is finished.
That would be great, thank you. By the way, I plan to post patches to enable
HST, HSI, SRU and LUT support next week.
--
Regards,
Laurent Pinchart
[-- Attachment #2: frame-000007.png --]
[-- Type: image/png, Size: 8618 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 4/5] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats
2013-07-17 14:54 ` [PATCH v2 4/5] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats Laurent Pinchart
@ 2013-07-24 21:23 ` Sylwester Nawrocki
0 siblings, 0 replies; 18+ messages in thread
From: Sylwester Nawrocki @ 2013-07-24 21:23 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, linux-sh, Hans Verkuil, Sakari Ailus
Hi Laurent,
On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> NV16M and NV61M are planar YCbCr 4:2:2 and YCrCb 4:2:2 formats with a
> luma plane followed by an interleaved chroma plane. The planes are not
> required to be contiguous in memory, and the formats can only be used
> with the multi-planar formats API.
>
> Signed-off-by: Laurent Pinchart<laurent.pinchart+renesas@ideasonboard.com>
Looks good,
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Thanks,
Sylwester
> ---
> Documentation/DocBook/media/v4l/pixfmt-nv16m.xml | 170 +++++++++++++++++++++++
> Documentation/DocBook/media/v4l/pixfmt.xml | 1 +
> include/uapi/linux/videodev2.h | 2 +
> 3 files changed, 173 insertions(+)
> create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
> new file mode 100644
> index 0000000..84a8bb3
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml
> @@ -0,0 +1,170 @@
> +<refentry>
> +<refmeta>
> + <refentrytitle>V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')</refentrytitle>
> + &manvol;
> +</refmeta>
> +<refnamediv>
> + <refname id="V4L2-PIX-FMT-NV16M"><constant>V4L2_PIX_FMT_NV16M</constant></refname>
> + <refname id="V4L2-PIX-FMT-NV61M"><constant>V4L2_PIX_FMT_NV61M</constant></refname>
> + <refpurpose>Variation of<constant>V4L2_PIX_FMT_NV16</constant> and<constant>V4L2_PIX_FMT_NV61</constant> with planes
> + non contiguous in memory.</refpurpose>
> +</refnamediv>
> +<refsect1>
> + <title>Description</title>
> +
> + <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
> +The three components are separated into two sub-images or planes.
> +<constant>V4L2_PIX_FMT_NV16M</constant> differs from<constant>V4L2_PIX_FMT_NV16
> +</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
> +plane do not necessarily immediately follows the luma plane.
> +The luminance data occupies the first plane. The Y plane has one byte per pixel.
> +In the second plane there is a chrominance data with alternating chroma samples.
> +The CbCr plane is the same width and height, in bytes, as the Y plane.
> +Each CbCr pair belongs to four pixels. For example,
> +Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
> +Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
> +Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
> +<constant>V4L2_PIX_FMT_NV61M</constant> is the same as<constant>V4L2_PIX_FMT_NV16M</constant>
> +except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
> +
> + <para><constant>V4L2_PIX_FMT_NV16M</constant> is intended to be
> +used only in drivers and applications that support the multi-planar API,
> +described in<xref linkend="planar-apis"/>.</para>
> +
> + <example>
> + <title><constant>V4L2_PIX_FMT_NV16M</constant> 4× 4 pixel image</title>
> +
> + <formalpara>
> + <title>Byte Order.</title>
> + <para>Each cell is one byte.
> + <informaltable frame="none">
> + <tgroup cols="5" align="center">
> + <colspec align="left" colwidth="2*" />
> + <tbody valign="top">
> + <row>
> + <entry>start0 + 0:</entry>
> + <entry>Y'<subscript>00</subscript></entry>
> + <entry>Y'<subscript>01</subscript></entry>
> + <entry>Y'<subscript>02</subscript></entry>
> + <entry>Y'<subscript>03</subscript></entry>
> + </row>
> + <row>
> + <entry>start0 + 4:</entry>
> + <entry>Y'<subscript>10</subscript></entry>
> + <entry>Y'<subscript>11</subscript></entry>
> + <entry>Y'<subscript>12</subscript></entry>
> + <entry>Y'<subscript>13</subscript></entry>
> + </row>
> + <row>
> + <entry>start0 + 8:</entry>
> + <entry>Y'<subscript>20</subscript></entry>
> + <entry>Y'<subscript>21</subscript></entry>
> + <entry>Y'<subscript>22</subscript></entry>
> + <entry>Y'<subscript>23</subscript></entry>
> + </row>
> + <row>
> + <entry>start0 + 12:</entry>
> + <entry>Y'<subscript>30</subscript></entry>
> + <entry>Y'<subscript>31</subscript></entry>
> + <entry>Y'<subscript>32</subscript></entry>
> + <entry>Y'<subscript>33</subscript></entry>
> + </row>
> + <row>
> + <entry></entry>
> + </row>
> + <row>
> + <entry>start1 + 0:</entry>
> + <entry>Cb<subscript>00</subscript></entry>
> + <entry>Cr<subscript>00</subscript></entry>
> + <entry>Cb<subscript>02</subscript></entry>
> + <entry>Cr<subscript>02</subscript></entry>
> + </row>
> + <row>
> + <entry>start1 + 4:</entry>
> + <entry>Cb<subscript>10</subscript></entry>
> + <entry>Cr<subscript>10</subscript></entry>
> + <entry>Cb<subscript>12</subscript></entry>
> + <entry>Cr<subscript>12</subscript></entry>
> + </row>
> + <row>
> + <entry>start1 + 8:</entry>
> + <entry>Cb<subscript>20</subscript></entry>
> + <entry>Cr<subscript>20</subscript></entry>
> + <entry>Cb<subscript>22</subscript></entry>
> + <entry>Cr<subscript>22</subscript></entry>
> + </row>
> + <row>
> + <entry>start1 + 12:</entry>
> + <entry>Cb<subscript>30</subscript></entry>
> + <entry>Cr<subscript>30</subscript></entry>
> + <entry>Cb<subscript>32</subscript></entry>
> + <entry>Cr<subscript>32</subscript></entry>
> + </row>
> + </tbody>
> + </tgroup>
> + </informaltable>
> + </para>
> + </formalpara>
> +
> + <formalpara>
> + <title>Color Sample Location.</title>
> + <para>
> + <informaltable frame="none">
> + <tgroup cols="7" align="center">
> + <tbody valign="top">
> + <row>
> + <entry></entry>
> + <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
> + <entry>2</entry><entry></entry><entry>3</entry>
> + </row>
> + <row>
> + <entry>0</entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry>
> + </row>
> + <row>
> + <entry></entry>
> + <entry></entry><entry>C</entry><entry></entry><entry></entry>
> + <entry></entry><entry>C</entry><entry></entry>
> + </row>
> + <row>
> + <entry>1</entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry>
> + </row>
> + <row>
> + <entry></entry>
> + <entry></entry><entry>C</entry><entry></entry><entry></entry>
> + <entry></entry><entry>C</entry><entry></entry>
> + </row>
> + <row>
> + <entry></entry>
> + </row>
> + <row>
> + <entry>2</entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry>
> + </row>
> + <row>
> + <entry></entry>
> + <entry></entry><entry>C</entry><entry></entry><entry></entry>
> + <entry></entry><entry>C</entry><entry></entry>
> + </row>
> + <row>
> + <entry>3</entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
> + <entry>Y</entry><entry></entry><entry>Y</entry>
> + </row>
> + <row>
> + <entry></entry>
> + <entry></entry><entry>C</entry><entry></entry><entry></entry>
> + <entry></entry><entry>C</entry><entry></entry>
> + </row>
> + </tbody>
> + </tgroup>
> + </informaltable>
> + </para>
> + </formalpara>
> + </example>
> +</refsect1>
> +</refentry>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 99b8d2a..16db350 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -718,6 +718,7 @@ information.</para>
> &sub-nv12m;
> &sub-nv12mt;
> &sub-nv16;
> +&sub-nv16m;
> &sub-nv24;
> &sub-m420;
> </section>
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 95ef455..fec0c20 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -348,6 +348,8 @@ struct v4l2_pix_format {
> /* two non contiguous planes - one Y, one Cr + Cb interleaved */
> #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
> #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
> +#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
> +#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
> #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
> #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses
2013-07-17 14:54 ` [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses Laurent Pinchart
@ 2013-07-24 21:26 ` Sylwester Nawrocki
2013-07-25 11:44 ` Laurent Pinchart
0 siblings, 1 reply; 18+ messages in thread
From: Sylwester Nawrocki @ 2013-07-24 21:26 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, linux-sh, Hans Verkuil, Sakari Ailus
Hi Laurent,
On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> Signed-off-by: Laurent Pinchart<laurent.pinchart+renesas@ideasonboard.com>
>
> ---
> Documentation/DocBook/media/v4l/subdev-formats.xml | 609 +++++++++------------
> Documentation/DocBook/media_api.tmpl | 6 +
> include/uapi/linux/v4l2-mediabus.h | 6 +-
> 3 files changed, 254 insertions(+), 367 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
> index 0c2b1f2..9100674 100644
> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
> @@ -97,31 +97,39 @@
[...]
> + <row id="V4L2-MBUS-FMT-ARGB888-1X24">
> + <entry>V4L2_MBUS_FMT_ARGB888_1X24</entry>
This should be V4L2_MBUS_FMT_ARGB888_1X32, right ?
Fix this correction feel free to add:
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> + <entry>0x100d</entry>
> + <entry></entry>
[...]
> diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
> index 6ee63d0..a960125 100644
> --- a/include/uapi/linux/v4l2-mediabus.h
> +++ b/include/uapi/linux/v4l2-mediabus.h
> @@ -37,7 +37,7 @@
> enum v4l2_mbus_pixelcode {
> V4L2_MBUS_FMT_FIXED = 0x0001,
>
> - /* RGB - next is 0x100d */
> + /* RGB - next is 0x100e */
> V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
> V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
> V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
> @@ -50,8 +50,9 @@ enum v4l2_mbus_pixelcode {
> V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
> V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
> V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
> + V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
>
> - /* YUV (including grey) - next is 0x2017 */
> + /* YUV (including grey) - next is 0x2018 */
> V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
> V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
> V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
> @@ -74,6 +75,7 @@ enum v4l2_mbus_pixelcode {
> V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
> V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
> V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
> + V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
>
> /* Bayer - next is 0x3019 */
> V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
Thanks,
Sylwester
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
[not found] ` <1374072882-14598-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
2013-07-24 10:38 ` [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver Katsuya MATSUBARA
@ 2013-07-24 22:48 ` Sakari Ailus
2013-07-25 11:46 ` Laurent Pinchart
1 sibling, 1 reply; 18+ messages in thread
From: Sakari Ailus @ 2013-07-24 22:48 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, linux-sh, Hans Verkuil
Hi Laurent,
What a nice driver! A few minor comments below:
On Wed, Jul 17, 2013 at 04:54:42PM +0200, Laurent Pinchart wrote:
...
> +static void vsp1_device_init(struct vsp1_device *vsp1)
> +{
> + unsigned int i;
> + u32 status;
> +
> + /* Reset any channel that might be running. */
> + status = vsp1_read(vsp1, VI6_STATUS);
> +
> + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> + unsigned int timeout;
> +
> + if (!(status & VI6_STATUS_SYS_ACT(i)))
> + continue;
> +
> + vsp1_write(vsp1, VI6_SRESET, VI6_SRESET_SRTS(i));
> + for (timeout = 10; timeout > 0; --timeout) {
> + status = vsp1_read(vsp1, VI6_STATUS);
> + if (!(status & VI6_STATUS_SYS_ACT(i)))
> + break;
> +
> + usleep_range(1000, 2000);
> + }
> +
> + if (timeout)
> + dev_err(vsp1->dev, "failed to reset wpf.%u\n", i);
Have you seen this happening in practice? Do you expect the device to
function if resetting it fails?
> + }
> +
> + vsp1_write(vsp1, VI6_CLK_DCSWT, (8 << VI6_CLK_DCSWT_CSTPW_SHIFT) |
> + (8 << VI6_CLK_DCSWT_CSTRW_SHIFT));
> +
> + for (i = 0; i < VPS1_MAX_RPF; ++i)
> + vsp1_write(vsp1, VI6_DPR_RPF_ROUTE(i), VI6_DPR_NODE_UNUSED);
> +
> + for (i = 0; i < VPS1_MAX_UDS; ++i)
> + vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED);
> +
> + vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);
> + vsp1_write(vsp1, VI6_DPR_LUT_ROUTE, VI6_DPR_NODE_UNUSED);
> + vsp1_write(vsp1, VI6_DPR_CLU_ROUTE, VI6_DPR_NODE_UNUSED);
> + vsp1_write(vsp1, VI6_DPR_HST_ROUTE, VI6_DPR_NODE_UNUSED);
> + vsp1_write(vsp1, VI6_DPR_HSI_ROUTE, VI6_DPR_NODE_UNUSED);
> + vsp1_write(vsp1, VI6_DPR_BRU_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + vsp1_write(vsp1, VI6_DPR_HGO_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> + vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> +}
...
> +int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
> + unsigned int num_pads)
> +{
> + static const struct {
> + unsigned int id;
> + unsigned int reg;
> + } routes[] = {
> + { VI6_DPR_NODE_LIF, 0 },
> + { VI6_DPR_NODE_RPF(0), VI6_DPR_RPF_ROUTE(0) },
> + { VI6_DPR_NODE_RPF(1), VI6_DPR_RPF_ROUTE(1) },
> + { VI6_DPR_NODE_RPF(2), VI6_DPR_RPF_ROUTE(2) },
> + { VI6_DPR_NODE_RPF(3), VI6_DPR_RPF_ROUTE(3) },
> + { VI6_DPR_NODE_RPF(4), VI6_DPR_RPF_ROUTE(4) },
> + { VI6_DPR_NODE_UDS(0), VI6_DPR_UDS_ROUTE(0) },
> + { VI6_DPR_NODE_UDS(1), VI6_DPR_UDS_ROUTE(1) },
> + { VI6_DPR_NODE_UDS(2), VI6_DPR_UDS_ROUTE(2) },
> + { VI6_DPR_NODE_WPF(0), 0 },
> + { VI6_DPR_NODE_WPF(1), 0 },
> + { VI6_DPR_NODE_WPF(2), 0 },
> + { VI6_DPR_NODE_WPF(3), 0 },
> + };
> +
> + unsigned int i;
> + int ret;
> +
> + for (i = 0; i < ARRAY_SIZE(routes); ++i) {
> + if (routes[i].id = entity->id) {
> + entity->route = routes[i].reg;
> + break;
> + }
> + }
> +
> + if (i = ARRAY_SIZE(routes))
> + return -EINVAL;
> +
> + entity->vsp1 = vsp1;
> + entity->source_pad = num_pads - 1;
> +
> + /* Allocate formats and pads. */
> + entity->formats = devm_kzalloc(vsp1->dev,
> + num_pads * sizeof(*entity->formats),
> + GFP_KERNEL);
> + if (entity->formats = NULL)
> + return -ENOMEM;
> +
> + entity->pads = devm_kzalloc(vsp1->dev, num_pads * sizeof(*entity->pads),
> + GFP_KERNEL);
> + if (entity->pads = NULL)
> + return -ENOMEM;
> +
> + /* Initialize pads. */
> + for (i = 0; i < num_pads - 1; ++i)
> + entity->pads[i].flags = MEDIA_PAD_FL_SINK;
> +
> + entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE;
> +
> + /* Initialize the media entity. */
> + ret = media_entity_init(&entity->subdev.entity, num_pads,
> + entity->pads, 0);
How about return media_entity_init(...) instead?
> + if (ret < 0)
> + return ret;
> +
> + return 0;
> +}
...
> +static int lif_enum_mbus_code(struct v4l2_subdev *subdev,
> + struct v4l2_subdev_fh *fh,
> + struct v4l2_subdev_mbus_code_enum *code)
> +{
> + static const unsigned int codes[] = {
> + V4L2_MBUS_FMT_ARGB8888_1X32,
> + V4L2_MBUS_FMT_AYUV8_1X32,
> + };
> + struct v4l2_mbus_framefmt *format;
> +
> + if (code->pad = LIF_PAD_SINK) {
> + if (code->index >= ARRAY_SIZE(codes))
> + return -EINVAL;
> +
> + code->code = codes[code->index];
> + } else {
> + /* The LIF can't perform format conversion, the sink format is
> + * always identical to the source format.
> + */
> + if (code->index)
> + return -EINVAL;
> +
> + format = v4l2_subdev_get_try_format(fh, LIF_PAD_SINK);
> + code->code = format->code;
You don't really need "format". If you want to use it however you could
define it inside the parentheses.
> + }
> +
> + return 0;
> +}
...
> +static int uds_enum_mbus_code(struct v4l2_subdev *subdev,
> + struct v4l2_subdev_fh *fh,
> + struct v4l2_subdev_mbus_code_enum *code)
> +{
> + static const unsigned int codes[] = {
> + V4L2_MBUS_FMT_ARGB8888_1X32,
> + V4L2_MBUS_FMT_AYUV8_1X32,
> + };
> + struct v4l2_mbus_framefmt *format;
> +
> + if (code->pad = UDS_PAD_SINK) {
> + if (code->index >= ARRAY_SIZE(codes))
> + return -EINVAL;
> +
> + code->code = codes[code->index];
> + } else {
> + /* The UDS can't perform format conversion, the sink format is
> + * always identical to the source format.
> + */
> + if (code->index)
> + return -EINVAL;
> +
> + format = v4l2_subdev_get_try_format(fh, UDS_PAD_SINK);
> + code->code = format->code;
Same here.
> + }
> +
> + return 0;
> +}
...
> + /* Follow links downstream for each input and make sure the graph
> + * contains no loop and that all branches end at the output WPF.
> + */
I wonder if checking for loops should be done already in pipeline validation
done by the framework. That's fine to do later on IMHO, too.
> + for (i = 0; i < pipe->num_inputs; ++i) {
> + ret = vsp1_pipeline_validate_branch(pipe->inputs[i],
> + pipe->output);
> + if (ret < 0)
> + goto error;
> + }
> +
> + return 0;
> +
...
> +static void vsp1_video_buffer_queue(struct vb2_buffer *vb)
> +{
> + struct vsp1_video *video = vb2_get_drv_priv(vb->vb2_queue);
> + struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity);
> + struct vsp1_video_buffer *buf = to_vsp1_video_buffer(vb);
> + unsigned long flags;
> + bool empty;
> +
> + spin_lock_irqsave(&video->irqlock, flags);
> + empty = list_empty(&video->irqqueue);
> + list_add_tail(&buf->queue, &video->irqqueue);
> + spin_unlock_irqrestore(&video->irqlock, flags);
> +
> + if (empty) {
if (!empty)
return;
?
Up to you.
> + spin_lock_irqsave(&pipe->irqlock, flags);
> +
> + video->ops->queue(video, buf);
> + pipe->buffers_ready |= 1 << video->pipe_index;
> +
> + if (vb2_is_streaming(&video->queue) &&
> + vsp1_pipeline_ready(pipe))
> + vsp1_pipeline_run(pipe);
> +
> + spin_unlock_irqrestore(&pipe->irqlock, flags);
> + }
> +}
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses
2013-07-24 21:26 ` Sylwester Nawrocki
@ 2013-07-25 11:44 ` Laurent Pinchart
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-25 11:44 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil,
Sakari Ailus
Hi Sylwester,
On Wednesday 24 July 2013 23:26:32 Sylwester Nawrocki wrote:
> On 07/17/2013 04:54 PM, Laurent Pinchart wrote:
> > Signed-off-by: Laurent Pinchart<laurent.pinchart+renesas@ideasonboard.com>
> >
> > ---
> >
> > Documentation/DocBook/media/v4l/subdev-formats.xml | 609 ++++++-------
> > Documentation/DocBook/media_api.tmpl | 6 +
> > include/uapi/linux/v4l2-mediabus.h | 6 +-
> > 3 files changed, 254 insertions(+), 367 deletions(-)
> >
> > diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
> > b/Documentation/DocBook/media/v4l/subdev-formats.xml index
> > 0c2b1f2..9100674 100644
> > --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
> > +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
> > @@ -97,31 +97,39 @@
>
> [...]
>
> > + <row id="V4L2-MBUS-FMT-ARGB888-1X24">
> > + <entry>V4L2_MBUS_FMT_ARGB888_1X24</entry>
>
> This should be V4L2_MBUS_FMT_ARGB888_1X32, right ?
Oops, indeed.
>
> Fix this correction feel free to add:
>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Thank you.
> > + <entry>0x100d</entry>
> > + <entry></entry>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
2013-07-24 22:48 ` Sakari Ailus
@ 2013-07-25 11:46 ` Laurent Pinchart
2013-07-25 13:43 ` Sakari Ailus
0 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-25 11:46 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Sakari,
On Thursday 25 July 2013 01:48:58 Sakari Ailus wrote:
> Hi Laurent,
>
> What a nice driver! A few minor comments below:
Thank you :-)
> On Wed, Jul 17, 2013 at 04:54:42PM +0200, Laurent Pinchart wrote:
> ...
>
> > +static void vsp1_device_init(struct vsp1_device *vsp1)
> > +{
> > + unsigned int i;
> > + u32 status;
> > +
> > + /* Reset any channel that might be running. */
> > + status = vsp1_read(vsp1, VI6_STATUS);
> > +
> > + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> > + unsigned int timeout;
> > +
> > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > + continue;
> > +
> > + vsp1_write(vsp1, VI6_SRESET, VI6_SRESET_SRTS(i));
> > + for (timeout = 10; timeout > 0; --timeout) {
> > + status = vsp1_read(vsp1, VI6_STATUS);
> > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > + break;
> > +
> > + usleep_range(1000, 2000);
> > + }
> > +
> > + if (timeout)
> > + dev_err(vsp1->dev, "failed to reset wpf.%u\n", i);
>
> Have you seen this happening in practice? Do you expect the device to
> function if resetting it fails?
I've seen this happening during development when I had messed up register
values, but not otherwise. I don't expect the deviec to still function if
resetting the WPF fails, but I need to make sure that the busy loop exits.
> > + }
> > +
> > + vsp1_write(vsp1, VI6_CLK_DCSWT, (8 << VI6_CLK_DCSWT_CSTPW_SHIFT) |
> > + (8 << VI6_CLK_DCSWT_CSTRW_SHIFT));
> > +
> > + for (i = 0; i < VPS1_MAX_RPF; ++i)
> > + vsp1_write(vsp1, VI6_DPR_RPF_ROUTE(i), VI6_DPR_NODE_UNUSED);
> > +
> > + for (i = 0; i < VPS1_MAX_UDS; ++i)
> > + vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED);
> > +
> > + vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);
> > + vsp1_write(vsp1, VI6_DPR_LUT_ROUTE, VI6_DPR_NODE_UNUSED);
> > + vsp1_write(vsp1, VI6_DPR_CLU_ROUTE, VI6_DPR_NODE_UNUSED);
> > + vsp1_write(vsp1, VI6_DPR_HST_ROUTE, VI6_DPR_NODE_UNUSED);
> > + vsp1_write(vsp1, VI6_DPR_HSI_ROUTE, VI6_DPR_NODE_UNUSED);
> > + vsp1_write(vsp1, VI6_DPR_BRU_ROUTE, VI6_DPR_NODE_UNUSED);
> > +
> > + vsp1_write(vsp1, VI6_DPR_HGO_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> > + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> > + vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> > + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> > +}
>
> ...
>
> > +int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity
> > *entity,
> > + unsigned int num_pads)
> > +{
> > + static const struct {
> > + unsigned int id;
> > + unsigned int reg;
> > + } routes[] = {
> > + { VI6_DPR_NODE_LIF, 0 },
> > + { VI6_DPR_NODE_RPF(0), VI6_DPR_RPF_ROUTE(0) },
> > + { VI6_DPR_NODE_RPF(1), VI6_DPR_RPF_ROUTE(1) },
> > + { VI6_DPR_NODE_RPF(2), VI6_DPR_RPF_ROUTE(2) },
> > + { VI6_DPR_NODE_RPF(3), VI6_DPR_RPF_ROUTE(3) },
> > + { VI6_DPR_NODE_RPF(4), VI6_DPR_RPF_ROUTE(4) },
> > + { VI6_DPR_NODE_UDS(0), VI6_DPR_UDS_ROUTE(0) },
> > + { VI6_DPR_NODE_UDS(1), VI6_DPR_UDS_ROUTE(1) },
> > + { VI6_DPR_NODE_UDS(2), VI6_DPR_UDS_ROUTE(2) },
> > + { VI6_DPR_NODE_WPF(0), 0 },
> > + { VI6_DPR_NODE_WPF(1), 0 },
> > + { VI6_DPR_NODE_WPF(2), 0 },
> > + { VI6_DPR_NODE_WPF(3), 0 },
> > + };
> > +
> > + unsigned int i;
> > + int ret;
> > +
> > + for (i = 0; i < ARRAY_SIZE(routes); ++i) {
> > + if (routes[i].id = entity->id) {
> > + entity->route = routes[i].reg;
> > + break;
> > + }
> > + }
> > +
> > + if (i = ARRAY_SIZE(routes))
> > + return -EINVAL;
> > +
> > + entity->vsp1 = vsp1;
> > + entity->source_pad = num_pads - 1;
> > +
> > + /* Allocate formats and pads. */
> > + entity->formats = devm_kzalloc(vsp1->dev,
> > + num_pads * sizeof(*entity->formats),
> > + GFP_KERNEL);
> > + if (entity->formats = NULL)
> > + return -ENOMEM;
> > +
> > + entity->pads = devm_kzalloc(vsp1->dev, num_pads * sizeof(*entity-
>pads),
> > + GFP_KERNEL);
> > + if (entity->pads = NULL)
> > + return -ENOMEM;
> > +
> > + /* Initialize pads. */
> > + for (i = 0; i < num_pads - 1; ++i)
> > + entity->pads[i].flags = MEDIA_PAD_FL_SINK;
> > +
> > + entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE;
> > +
> > + /* Initialize the media entity. */
> > + ret = media_entity_init(&entity->subdev.entity, num_pads,
> > + entity->pads, 0);
>
> How about return media_entity_init(...) instead?
Will do.
> > + if (ret < 0)
> > + return ret;
> > +
> > + return 0;
> > +}
>
> ...
>
> > +static int lif_enum_mbus_code(struct v4l2_subdev *subdev,
> > + struct v4l2_subdev_fh *fh,
> > + struct v4l2_subdev_mbus_code_enum *code)
> > +{
> > + static const unsigned int codes[] = {
> > + V4L2_MBUS_FMT_ARGB8888_1X32,
> > + V4L2_MBUS_FMT_AYUV8_1X32,
> > + };
> > + struct v4l2_mbus_framefmt *format;
> > +
> > + if (code->pad = LIF_PAD_SINK) {
> > + if (code->index >= ARRAY_SIZE(codes))
> > + return -EINVAL;
> > +
> > + code->code = codes[code->index];
> > + } else {
> > + /* The LIF can't perform format conversion, the sink format is
> > + * always identical to the source format.
> > + */
> > + if (code->index)
> > + return -EINVAL;
> > +
> > + format = v4l2_subdev_get_try_format(fh, LIF_PAD_SINK);
> > + code->code = format->code;
>
> You don't really need "format". If you want to use it however you could
> define it inside the parentheses.
Will do.
> > + }
> > +
> > + return 0;
> > +}
>
> ...
>
> > +static int uds_enum_mbus_code(struct v4l2_subdev *subdev,
> > + struct v4l2_subdev_fh *fh,
> > + struct v4l2_subdev_mbus_code_enum *code)
> > +{
> > + static const unsigned int codes[] = {
> > + V4L2_MBUS_FMT_ARGB8888_1X32,
> > + V4L2_MBUS_FMT_AYUV8_1X32,
> > + };
> > + struct v4l2_mbus_framefmt *format;
> > +
> > + if (code->pad = UDS_PAD_SINK) {
> > + if (code->index >= ARRAY_SIZE(codes))
> > + return -EINVAL;
> > +
> > + code->code = codes[code->index];
> > + } else {
> > + /* The UDS can't perform format conversion, the sink format is
> > + * always identical to the source format.
> > + */
> > + if (code->index)
> > + return -EINVAL;
> > +
> > + format = v4l2_subdev_get_try_format(fh, UDS_PAD_SINK);
> > + code->code = format->code;
>
> Same here.
Will do too.
> > + }
> > +
> > + return 0;
> > +}
>
> ...
>
> > + /* Follow links downstream for each input and make sure the graph
> > + * contains no loop and that all branches end at the output WPF.
> > + */
>
> I wonder if checking for loops should be done already in pipeline validation
> done by the framework. That's fine to do later on IMHO, too.
It would have to be performed by the core, as the callbacks are local to
links. That's feasible (but should be optional, as some devices might support
circular graphs), feel free to submit a patch :-)
> > + for (i = 0; i < pipe->num_inputs; ++i) {
> > + ret = vsp1_pipeline_validate_branch(pipe->inputs[i],
> > + pipe->output);
> > + if (ret < 0)
> > + goto error;
> > + }
> > +
> > + return 0;
> > +
>
> ...
>
> > +static void vsp1_video_buffer_queue(struct vb2_buffer *vb)
> > +{
> > + struct vsp1_video *video = vb2_get_drv_priv(vb->vb2_queue);
> > + struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity);
> > + struct vsp1_video_buffer *buf = to_vsp1_video_buffer(vb);
> > + unsigned long flags;
> > + bool empty;
> > +
> > + spin_lock_irqsave(&video->irqlock, flags);
> > + empty = list_empty(&video->irqqueue);
> > + list_add_tail(&buf->queue, &video->irqqueue);
> > + spin_unlock_irqrestore(&video->irqlock, flags);
> > +
> > + if (empty) {
>
> if (!empty)
> return;
>
> ?
Will do.
> Up to you.
>
> > + spin_lock_irqsave(&pipe->irqlock, flags);
> > +
> > + video->ops->queue(video, buf);
> > + pipe->buffers_ready |= 1 << video->pipe_index;
> > +
> > + if (vb2_is_streaming(&video->queue) &&
> > + vsp1_pipeline_ready(pipe))
> > + vsp1_pipeline_run(pipe);
> > +
> > + spin_unlock_irqrestore(&pipe->irqlock, flags);
> > + }
> > +}
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
2013-07-25 11:46 ` Laurent Pinchart
@ 2013-07-25 13:43 ` Sakari Ailus
2013-07-31 15:13 ` Laurent Pinchart
0 siblings, 1 reply; 18+ messages in thread
From: Sakari Ailus @ 2013-07-25 13:43 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Laurent,
On Thu, Jul 25, 2013 at 01:46:54PM +0200, Laurent Pinchart wrote:
> > On Wed, Jul 17, 2013 at 04:54:42PM +0200, Laurent Pinchart wrote:
> > ...
> >
> > > +static void vsp1_device_init(struct vsp1_device *vsp1)
> > > +{
> > > + unsigned int i;
> > > + u32 status;
> > > +
> > > + /* Reset any channel that might be running. */
> > > + status = vsp1_read(vsp1, VI6_STATUS);
> > > +
> > > + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> > > + unsigned int timeout;
> > > +
> > > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > > + continue;
> > > +
> > > + vsp1_write(vsp1, VI6_SRESET, VI6_SRESET_SRTS(i));
> > > + for (timeout = 10; timeout > 0; --timeout) {
> > > + status = vsp1_read(vsp1, VI6_STATUS);
> > > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > > + break;
> > > +
> > > + usleep_range(1000, 2000);
> > > + }
> > > +
> > > + if (timeout)
> > > + dev_err(vsp1->dev, "failed to reset wpf.%u\n", i);
> >
> > Have you seen this happening in practice? Do you expect the device to
> > function if resetting it fails?
>
> I've seen this happening during development when I had messed up register
> values, but not otherwise. I don't expect the deviec to still function if
> resetting the WPF fails, but I need to make sure that the busy loop exits.
Shouldn't you also return an error in this case? The function currently
returns void.
...
> > > + /* Follow links downstream for each input and make sure the graph
> > > + * contains no loop and that all branches end at the output WPF.
> > > + */
> >
> > I wonder if checking for loops should be done already in pipeline validation
> > done by the framework. That's fine to do later on IMHO, too.
>
> It would have to be performed by the core, as the callbacks are local to
> links. That's feasible (but should be optional, as some devices might support
> circular graphs), feel free to submit a patch :-)
As a matter of fact I think I will. I'd like you to test it though since I
have no hardware with such media graph. :-)
But please don't expect to see that in time for your driver to get in. Let's
think about that later on.
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver
2013-07-25 13:43 ` Sakari Ailus
@ 2013-07-31 15:13 ` Laurent Pinchart
0 siblings, 0 replies; 18+ messages in thread
From: Laurent Pinchart @ 2013-07-31 15:13 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Laurent Pinchart, linux-media, linux-sh, Hans Verkuil
Hi Sakari,
On Thursday 25 July 2013 16:43:28 Sakari Ailus wrote:
> On Thu, Jul 25, 2013 at 01:46:54PM +0200, Laurent Pinchart wrote:
> > > On Wed, Jul 17, 2013 at 04:54:42PM +0200, Laurent Pinchart wrote:
> > > ...
> > >
> > > > +static void vsp1_device_init(struct vsp1_device *vsp1)
> > > > +{
> > > > + unsigned int i;
> > > > + u32 status;
> > > > +
> > > > + /* Reset any channel that might be running. */
> > > > + status = vsp1_read(vsp1, VI6_STATUS);
> > > > +
> > > > + for (i = 0; i < VPS1_MAX_WPF; ++i) {
> > > > + unsigned int timeout;
> > > > +
> > > > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > > > + continue;
> > > > +
> > > > + vsp1_write(vsp1, VI6_SRESET, VI6_SRESET_SRTS(i));
> > > > + for (timeout = 10; timeout > 0; --timeout) {
> > > > + status = vsp1_read(vsp1, VI6_STATUS);
> > > > + if (!(status & VI6_STATUS_SYS_ACT(i)))
> > > > + break;
> > > > +
> > > > + usleep_range(1000, 2000);
> > > > + }
> > > > +
> > > > + if (timeout)
> > > > + dev_err(vsp1->dev, "failed to reset wpf.%u\n", i);
> > >
> > > Have you seen this happening in practice? Do you expect the device to
> > > function if resetting it fails?
> >
> > I've seen this happening during development when I had messed up register
> > values, but not otherwise. I don't expect the deviec to still function if
> > resetting the WPF fails, but I need to make sure that the busy loop exits.
>
> Shouldn't you also return an error in this case? The function currently
> returns void.
I will fix that.
> ...
>
> > > > + /* Follow links downstream for each input and make sure the graph
> > > > + * contains no loop and that all branches end at the output WPF.
> > > > + */
> > >
> > > I wonder if checking for loops should be done already in pipeline
> > > validation done by the framework. That's fine to do later on IMHO, too.
> >
> > It would have to be performed by the core, as the callbacks are local to
> > links. That's feasible (but should be optional, as some devices might
> > support circular graphs), feel free to submit a patch :-)
>
> As a matter of fact I think I will. I'd like you to test it though since I
> have no hardware with such media graph. :-)
Sure :-)
> But please don't expect to see that in time for your driver to get in. Let's
> think about that later on.
OK.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2013-07-31 15:13 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-17 14:54 [PATCH v2 0/5] Renesas VSP1 driver Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 1/5] media: Fix circular graph traversal Laurent Pinchart
2013-07-17 19:47 ` Sakari Ailus
2013-07-17 23:06 ` Laurent Pinchart
2013-07-18 10:22 ` Sakari Ailus
2013-07-24 14:09 ` Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 2/5] v4l: Fix V4L2_MBUS_FMT_YUV10_1X30 media bus pixel code value Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 3/5] v4l: Add media format codes for ARGB8888 and AYUV8888 on 32-bit busses Laurent Pinchart
2013-07-24 21:26 ` Sylwester Nawrocki
2013-07-25 11:44 ` Laurent Pinchart
2013-07-17 14:54 ` [PATCH v2 4/5] v4l: Add V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV61M formats Laurent Pinchart
2013-07-24 21:23 ` Sylwester Nawrocki
[not found] ` <1374072882-14598-6-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
2013-07-24 10:38 ` [PATCH v2 5/5] v4l: Renesas R-Car VSP1 driver Katsuya MATSUBARA
2013-07-24 15:05 ` Laurent Pinchart
2013-07-24 22:48 ` Sakari Ailus
2013-07-25 11:46 ` Laurent Pinchart
2013-07-25 13:43 ` Sakari Ailus
2013-07-31 15:13 ` Laurent Pinchart
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).