aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2013-08-25 13:00:43 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-05 14:21:54 -0500
commit939f1377fbdb5d0d6d6ee1e234b8ab9328ca77ef (patch)
treece2000a7fd236cc36a437682028e0820cc9a3cf0
parentc6c092135d4f61b038a41685147c79e966c2399c (diff)
[media] v4l: Use full 32 bits for buffer flags
The buffer flags field is 32 bits but the defined only used 16. This is fine, but as more than 16 bits will be used in the very near future, define them as 32-bit numbers for consistency. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--Documentation/DocBook/media/v4l/io.xml30
-rw-r--r--include/uapi/linux/videodev2.h38
2 files changed, 38 insertions, 30 deletions
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index 89544e4495a9..5a2e97bbc6bf 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -990,7 +990,7 @@ should set this to 0.</entry>
990 <tbody valign="top"> 990 <tbody valign="top">
991 <row> 991 <row>
992 <entry><constant>V4L2_BUF_FLAG_MAPPED</constant></entry> 992 <entry><constant>V4L2_BUF_FLAG_MAPPED</constant></entry>
993 <entry>0x0001</entry> 993 <entry>0x00000001</entry>
994 <entry>The buffer resides in device memory and has been mapped 994 <entry>The buffer resides in device memory and has been mapped
995into the application's address space, see <xref linkend="mmap" /> for details. 995into the application's address space, see <xref linkend="mmap" /> for details.
996Drivers set or clear this flag when the 996Drivers set or clear this flag when the
@@ -1000,7 +1000,7 @@ Drivers set or clear this flag when the
1000 </row> 1000 </row>
1001 <row> 1001 <row>
1002 <entry><constant>V4L2_BUF_FLAG_QUEUED</constant></entry> 1002 <entry><constant>V4L2_BUF_FLAG_QUEUED</constant></entry>
1003 <entry>0x0002</entry> 1003 <entry>0x00000002</entry>
1004 <entry>Internally drivers maintain two buffer queues, an 1004 <entry>Internally drivers maintain two buffer queues, an
1005incoming and outgoing queue. When this flag is set, the buffer is 1005incoming and outgoing queue. When this flag is set, the buffer is
1006currently on the incoming queue. It automatically moves to the 1006currently on the incoming queue. It automatically moves to the
@@ -1013,7 +1013,7 @@ cleared.</entry>
1013 </row> 1013 </row>
1014 <row> 1014 <row>
1015 <entry><constant>V4L2_BUF_FLAG_DONE</constant></entry> 1015 <entry><constant>V4L2_BUF_FLAG_DONE</constant></entry>
1016 <entry>0x0004</entry> 1016 <entry>0x00000004</entry>
1017 <entry>When this flag is set, the buffer is currently on 1017 <entry>When this flag is set, the buffer is currently on
1018the outgoing queue, ready to be dequeued from the driver. Drivers set 1018the outgoing queue, ready to be dequeued from the driver. Drivers set
1019or clear this flag when the <constant>VIDIOC_QUERYBUF</constant> ioctl 1019or clear this flag when the <constant>VIDIOC_QUERYBUF</constant> ioctl
@@ -1027,7 +1027,7 @@ state, in the application domain to say so.</entry>
1027 </row> 1027 </row>
1028 <row> 1028 <row>
1029 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry> 1029 <entry><constant>V4L2_BUF_FLAG_ERROR</constant></entry>
1030 <entry>0x0040</entry> 1030 <entry>0x00000040</entry>
1031 <entry>When this flag is set, the buffer has been dequeued 1031 <entry>When this flag is set, the buffer has been dequeued
1032 successfully, although the data might have been corrupted. 1032 successfully, although the data might have been corrupted.
1033 This is recoverable, streaming may continue as normal and 1033 This is recoverable, streaming may continue as normal and
@@ -1037,7 +1037,7 @@ state, in the application domain to say so.</entry>
1037 </row> 1037 </row>
1038 <row> 1038 <row>
1039 <entry><constant>V4L2_BUF_FLAG_KEYFRAME</constant></entry> 1039 <entry><constant>V4L2_BUF_FLAG_KEYFRAME</constant></entry>
1040 <entry>0x0008</entry> 1040 <entry>0x00000008</entry>
1041 <entry>Drivers set or clear this flag when calling the 1041 <entry>Drivers set or clear this flag when calling the
1042<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video 1042<constant>VIDIOC_DQBUF</constant> ioctl. It may be set by video
1043capture devices when the buffer contains a compressed image which is a 1043capture devices when the buffer contains a compressed image which is a
@@ -1045,27 +1045,27 @@ key frame (or field), &ie; can be decompressed on its own.</entry>
1045 </row> 1045 </row>
1046 <row> 1046 <row>
1047 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry> 1047 <entry><constant>V4L2_BUF_FLAG_PFRAME</constant></entry>
1048 <entry>0x0010</entry> 1048 <entry>0x00000010</entry>
1049 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant> 1049 <entry>Similar to <constant>V4L2_BUF_FLAG_KEYFRAME</constant>
1050this flags predicted frames or fields which contain only differences to a 1050this flags predicted frames or fields which contain only differences to a
1051previous key frame.</entry> 1051previous key frame.</entry>
1052 </row> 1052 </row>
1053 <row> 1053 <row>
1054 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry> 1054 <entry><constant>V4L2_BUF_FLAG_BFRAME</constant></entry>
1055 <entry>0x0020</entry> 1055 <entry>0x00000020</entry>
1056 <entry>Similar to <constant>V4L2_BUF_FLAG_PFRAME</constant> 1056 <entry>Similar to <constant>V4L2_BUF_FLAG_PFRAME</constant>
1057 this is a bidirectional predicted frame or field. [ooc tbd]</entry> 1057 this is a bidirectional predicted frame or field. [ooc tbd]</entry>
1058 </row> 1058 </row>
1059 <row> 1059 <row>
1060 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry> 1060 <entry><constant>V4L2_BUF_FLAG_TIMECODE</constant></entry>
1061 <entry>0x0100</entry> 1061 <entry>0x00000100</entry>
1062 <entry>The <structfield>timecode</structfield> field is valid. 1062 <entry>The <structfield>timecode</structfield> field is valid.
1063Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> 1063Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
1064ioctl is called.</entry> 1064ioctl is called.</entry>
1065 </row> 1065 </row>
1066 <row> 1066 <row>
1067 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> 1067 <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
1068 <entry>0x0400</entry> 1068 <entry>0x00000400</entry>
1069 <entry>The buffer has been prepared for I/O and can be queued by the 1069 <entry>The buffer has been prepared for I/O and can be queued by the
1070application. Drivers set or clear this flag when the 1070application. Drivers set or clear this flag when the
1071<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link 1071<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link
@@ -1075,7 +1075,7 @@ application. Drivers set or clear this flag when the
1075 </row> 1075 </row>
1076 <row> 1076 <row>
1077 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry> 1077 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry>
1078 <entry>0x0800</entry> 1078 <entry>0x00000800</entry>
1079 <entry>Caches do not have to be invalidated for this buffer. 1079 <entry>Caches do not have to be invalidated for this buffer.
1080Typically applications shall use this flag if the data captured in the buffer 1080Typically applications shall use this flag if the data captured in the buffer
1081is not going to be touched by the CPU, instead the buffer will, probably, be 1081is not going to be touched by the CPU, instead the buffer will, probably, be
@@ -1084,7 +1084,7 @@ passed on to a DMA-capable hardware unit for further processing or output.
1084 </row> 1084 </row>
1085 <row> 1085 <row>
1086 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry> 1086 <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry>
1087 <entry>0x1000</entry> 1087 <entry>0x00001000</entry>
1088 <entry>Caches do not have to be cleaned for this buffer. 1088 <entry>Caches do not have to be cleaned for this buffer.
1089Typically applications shall use this flag for output buffers if the data 1089Typically applications shall use this flag for output buffers if the data
1090in this buffer has not been created by the CPU but by some DMA-capable unit, 1090in this buffer has not been created by the CPU but by some DMA-capable unit,
@@ -1092,7 +1092,7 @@ in which case caches have not been used.</entry>
1092 </row> 1092 </row>
1093 <row> 1093 <row>
1094 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry> 1094 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry>
1095 <entry>0xe000</entry> 1095 <entry>0x0000e000</entry>
1096 <entry>Mask for timestamp types below. To test the 1096 <entry>Mask for timestamp types below. To test the
1097 timestamp type, mask out bits not belonging to timestamp 1097 timestamp type, mask out bits not belonging to timestamp
1098 type by performing a logical and operation with buffer 1098 type by performing a logical and operation with buffer
@@ -1100,7 +1100,7 @@ in which case caches have not been used.</entry>
1100 </row> 1100 </row>
1101 <row> 1101 <row>
1102 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN</constant></entry> 1102 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN</constant></entry>
1103 <entry>0x0000</entry> 1103 <entry>0x00000000</entry>
1104 <entry>Unknown timestamp type. This type is used by 1104 <entry>Unknown timestamp type. This type is used by
1105 drivers before Linux 3.9 and may be either monotonic (see 1105 drivers before Linux 3.9 and may be either monotonic (see
1106 below) or realtime (wall clock). Monotonic clock has been 1106 below) or realtime (wall clock). Monotonic clock has been
@@ -1113,7 +1113,7 @@ in which case caches have not been used.</entry>
1113 </row> 1113 </row>
1114 <row> 1114 <row>
1115 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC</constant></entry> 1115 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC</constant></entry>
1116 <entry>0x2000</entry> 1116 <entry>0x00002000</entry>
1117 <entry>The buffer timestamp has been taken from the 1117 <entry>The buffer timestamp has been taken from the
1118 <constant>CLOCK_MONOTONIC</constant> clock. To access the 1118 <constant>CLOCK_MONOTONIC</constant> clock. To access the
1119 same clock outside V4L2, use 1119 same clock outside V4L2, use
@@ -1121,7 +1121,7 @@ in which case caches have not been used.</entry>
1121 </row> 1121 </row>
1122 <row> 1122 <row>
1123 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry> 1123 <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry>
1124 <entry>0x4000</entry> 1124 <entry>0x00004000</entry>
1125 <entry>The CAPTURE buffer timestamp has been taken from the 1125 <entry>The CAPTURE buffer timestamp has been taken from the
1126 corresponding OUTPUT buffer. This flag applies only to mem2mem devices.</entry> 1126 corresponding OUTPUT buffer. This flag applies only to mem2mem devices.</entry>
1127 </row> 1127 </row>
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 27fedfe4f33b..cb838765dd40 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -674,24 +674,32 @@ struct v4l2_buffer {
674}; 674};
675 675
676/* Flags for 'flags' field */ 676/* Flags for 'flags' field */
677#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */ 677/* Buffer is mapped (flag) */
678#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */ 678#define V4L2_BUF_FLAG_MAPPED 0x00000001
679#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */ 679/* Buffer is queued for processing */
680#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ 680#define V4L2_BUF_FLAG_QUEUED 0x00000002
681#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ 681/* Buffer is ready */
682#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ 682#define V4L2_BUF_FLAG_DONE 0x00000004
683/* Image is a keyframe (I-frame) */
684#define V4L2_BUF_FLAG_KEYFRAME 0x00000008
685/* Image is a P-frame */
686#define V4L2_BUF_FLAG_PFRAME 0x00000010
687/* Image is a B-frame */
688#define V4L2_BUF_FLAG_BFRAME 0x00000020
683/* Buffer is ready, but the data contained within is corrupted. */ 689/* Buffer is ready, but the data contained within is corrupted. */
684#define V4L2_BUF_FLAG_ERROR 0x0040 690#define V4L2_BUF_FLAG_ERROR 0x00000040
685#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 691/* timecode field is valid */
686#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ 692#define V4L2_BUF_FLAG_TIMECODE 0x00000100
693/* Buffer is prepared for queuing */
694#define V4L2_BUF_FLAG_PREPARED 0x00000400
687/* Cache handling flags */ 695/* Cache handling flags */
688#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 696#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
689#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 697#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000
690/* Timestamp type */ 698/* Timestamp type */
691#define V4L2_BUF_FLAG_TIMESTAMP_MASK 0xe000 699#define V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
692#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x0000 700#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000
693#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000 701#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
694#define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x4000 702#define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
695 703
696/** 704/**
697 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor 705 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor