History

media: core: Report the maximum possible number of buffers for the queue

Use one of the struct v4l2_create_buffers reserved bytes to report the maximum possible number of buffers for the queue. V4l2 framework set V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS flags in queue capabilities so userland can know when the field is valid. Does the same change in v4l2_create_buffers32 structure.

Benjamin Gaignard committed 3 years ago

Commit d055a761 parent c8385306 files · +26 −6Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/videodev2.h+6−1
@@ -1035,6 +1035,7 @@ struct v4l2_requestbuffers { · 1034 unmodified lines
10351035 #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
10361036 #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5)
10371037 #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS (1 << 6)
1038+#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS (1 << 7)
10381039
10391040 /**
10401041 * struct v4l2_plane - plane info for multi-planar buffers
@@ -2605,6 +2606,9 @@ struct v4l2_dbg_chip_info { · 1564 unmodified lines
26052606 * @flags: additional buffer management attributes (ignored unless the
26062607 * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
26072608 * and configured for MMAP streaming I/O).
2609+ * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set
2610+ * this field indicate the maximum possible number of buffers
2611+ * for this queue.
26082612 * @reserved: future extensions
26092613 */
26102614 struct v4l2_create_buffers {
@@ -2614,7 +2618,8 @@ struct v4l2_create_buffers { · 3 unmodified lines
26142618 struct v4l2_format format;
26152619 __u32 capabilities;
26162620 __u32 flags;
2617− __u32 reserved[6];
2621+ __u32 max_num_buffers;
2622+ __u32 reserved[5];
26182623 };
26192624
26202625 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t