Skip to content

Commit 274af8f

Browse files
committed
Rename min_buffers_needed field in vb2_queue
The field 'min_buffers_needed' in vb2_queue was renamed to 'min_queued_buffers' in Linux kernel v6.8. As a result, the field name needs to be updated when building the driver on newer kernel versions. For backward compatibility, #if and #else macros have been added to select the correct field name based on the kernel version.
1 parent d39b6ea commit 274af8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

videobuf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ int vcam_out_videobuf2_setup(struct vcam_device *dev)
135135
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
136136
q->ops = &vcam_vb2_ops;
137137
q->mem_ops = &vb2_vmalloc_memops;
138+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0)
139+
q->min_queued_buffers = 2;
140+
#else
138141
q->min_buffers_needed = 2;
142+
#endif
139143
q->lock = &dev->vcam_mutex;
140144

141145
return vb2_queue_init(q);

0 commit comments

Comments
 (0)