Merge ~vicamo/ubuntu/+source/v4l2loopback/+git/v4l2loopback:bug-2114259/ftbfs-6.16/noble/mp into ubuntu/+source/v4l2loopback:ubuntu/noble-devel

Proposed by You-Sheng Yang
Status: Merged
Merge reported by: You-Sheng Yang
Merged at revision: bc1dbdec175d1afac2448b72030bd37caec3c6c7
Proposed branch: ~vicamo/ubuntu/+source/v4l2loopback/+git/v4l2loopback:bug-2114259/ftbfs-6.16/noble/mp
Merge into: ubuntu/+source/v4l2loopback:ubuntu/noble-devel
Diff against target: 183 lines (+149/-0)
5 files modified
debian/changelog (+9/-0)
debian/patches/Drop-from_timer-macro-usage.patch (+48/-0)
debian/patches/added-functionality-for-linux-6.15-626.patch (+52/-0)
debian/patches/only-use-timer_delete_sync-compat-macro-for-linux-6.2.0.patch (+37/-0)
debian/patches/series (+3/-0)
Reviewer Review Type Date Requested Status
Ubuntu Kernel DKMS Uploaders Pending
Review via email: mp+497750@code.launchpad.net

Commit message

* Failed to build against linux-6.16 (LP: #2114259)
  - added functionality for linux 6.15+ (#626)
  - only use `timer_delete_sync` compat macro for linux<6.2.0
  - Drop from_timer macro usage

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 70e0c43..538493a 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+v4l2loopback (0.12.7-2ubuntu5.1) noble; urgency=medium
7+
8+ * Failed to build against linux-6.16 (LP: #2114259)
9+ - added functionality for linux 6.15+ (#626)
10+ - only use `timer_delete_sync` compat macro for linux<6.2.0
11+ - Drop from_timer macro usage
12+
13+ -- You-Sheng Yang <vicamo@gmail.com> Thu, 18 Dec 2025 15:44:14 +0800
14+
15 v4l2loopback (0.12.7-2ubuntu5) noble; urgency=medium
16
17 * Support Linux 6.8 (LP: #2052801):
18diff --git a/debian/patches/Drop-from_timer-macro-usage.patch b/debian/patches/Drop-from_timer-macro-usage.patch
19new file mode 100644
20index 0000000..82703ae
21--- /dev/null
22+++ b/debian/patches/Drop-from_timer-macro-usage.patch
23@@ -0,0 +1,48 @@
24+From: Neil Armstrong <neil.armstrong@linaro.org>
25+Date: Tue, 10 Jun 2025 17:00:38 +0200
26+Subject: Drop from_timer macro usage
27+
28+The from_timer() macro is dropped for v6.16-rc1, just
29+use container_of() just like the from_timer() macro does.
30+
31+Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
32+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2114259
33+Origin: upstream, https://github.com/v4l2loopback/v4l2loopback/commit/196ae48c0f08dfcdcad0aded4917cf8a303bf237.patch
34+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
35+---
36+ v4l2loopback.c | 8 +++++---
37+ 1 file changed, 5 insertions(+), 3 deletions(-)
38+
39+diff --git a/v4l2loopback.c b/v4l2loopback.c
40+index d2247af..bbc4e6c 100644
41+--- a/v4l2loopback.c
42++++ b/v4l2loopback.c
43+@@ -45,7 +45,7 @@
44+ #define strscpy strlcpy
45+ #endif
46+
47+-#if defined(timer_setup) && defined(from_timer)
48++#if defined(timer_setup)
49+ #define HAVE_TIMER_SETUP
50+ #endif
51+
52+@@ -2675,7 +2675,8 @@ static void check_timers(struct v4l2_loopback_device *dev)
53+ #ifdef HAVE_TIMER_SETUP
54+ static void sustain_timer_clb(struct timer_list *t)
55+ {
56+- struct v4l2_loopback_device *dev = from_timer(dev, t, sustain_timer);
57++ struct v4l2_loopback_device *dev =
58++ container_of(t, struct v4l2_loopback_device, sustain_timer);
59+ #else
60+ static void sustain_timer_clb(unsigned long nr)
61+ {
62+@@ -2700,7 +2701,8 @@ static void sustain_timer_clb(unsigned long nr)
63+ #ifdef HAVE_TIMER_SETUP
64+ static void timeout_timer_clb(struct timer_list *t)
65+ {
66+- struct v4l2_loopback_device *dev = from_timer(dev, t, timeout_timer);
67++ struct v4l2_loopback_device *dev =
68++ container_of(t, struct v4l2_loopback_device, timeout_timer);
69+ #else
70+ static void timeout_timer_clb(unsigned long nr)
71+ {
72diff --git a/debian/patches/added-functionality-for-linux-6.15-626.patch b/debian/patches/added-functionality-for-linux-6.15-626.patch
73new file mode 100644
74index 0000000..604b511
75--- /dev/null
76+++ b/debian/patches/added-functionality-for-linux-6.15-626.patch
77@@ -0,0 +1,52 @@
78+From: Theodore Chiu <theochiu.me@gmail.com>
79+Date: Wed, 9 Apr 2025 14:16:51 -0400
80+Subject: added functionality for linux 6.15+ (#626)
81+
82+* added functionality for linux 6.15+
83+
84+* use macro for linux kernel version changes for timer
85+
86+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2114259
87+Origin: upstream, https://github.com/v4l2loopback/v4l2loopback/commit/3cf949864d25d9b5c776d78a780b0ea9badbebb7
88+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
89+---
90+ v4l2loopback.c | 12 ++++++++----
91+ 1 file changed, 8 insertions(+), 4 deletions(-)
92+
93+diff --git a/v4l2loopback.c b/v4l2loopback.c
94+index 9f0b0b4..9059d58 100644
95+--- a/v4l2loopback.c
96++++ b/v4l2loopback.c
97+@@ -44,6 +44,10 @@
98+ #define strscpy strlcpy
99+ #endif
100+
101++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0)
102++#define timer_delete_sync del_timer_sync
103++#endif
104++
105+ #if defined(timer_setup) && defined(from_timer)
106+ #define HAVE_TIMER_SETUP
107+ #endif
108+@@ -1580,8 +1584,8 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *b)
109+ static void buffer_written(struct v4l2_loopback_device *dev,
110+ struct v4l2l_buffer *buf)
111+ {
112+- del_timer_sync(&dev->sustain_timer);
113+- del_timer_sync(&dev->timeout_timer);
114++ timer_delete_sync(&dev->sustain_timer);
115++ timer_delete_sync(&dev->timeout_timer);
116+ spin_lock_bh(&dev->lock);
117+
118+ dev->bufpos2index[dev->write_position % dev->used_buffers] =
119+@@ -2105,8 +2109,8 @@ static int v4l2_loopback_close(struct file *file)
120+
121+ atomic_dec(&dev->open_count);
122+ if (dev->open_count.counter == 0) {
123+- del_timer_sync(&dev->sustain_timer);
124+- del_timer_sync(&dev->timeout_timer);
125++ timer_delete_sync(&dev->sustain_timer);
126++ timer_delete_sync(&dev->timeout_timer);
127+ }
128+ try_free_buffers(dev);
129+
130diff --git a/debian/patches/only-use-timer_delete_sync-compat-macro-for-linux-6.2.0.patch b/debian/patches/only-use-timer_delete_sync-compat-macro-for-linux-6.2.0.patch
131new file mode 100644
132index 0000000..5128e0d
133--- /dev/null
134+++ b/debian/patches/only-use-timer_delete_sync-compat-macro-for-linux-6.2.0.patch
135@@ -0,0 +1,37 @@
136+From: =?utf-8?q?IOhannes_m_zm=C3=B6lnig?= <zmoelnig@umlautT.umlaeute.mur.at>
137+Date: Wed, 9 Apr 2025 20:21:49 +0200
138+Subject: only use `timer_delete_sync` compat macro for linux<6.2.0
139+
140+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2114259
141+Origin: upstream, https://github.com/v4l2loopback/v4l2loopback/commit/20a4b78244dc3cb35b3d32fa8455a3c93d0e5b7f
142+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
143+---
144+ v4l2loopback.c | 8 ++++----
145+ 1 file changed, 4 insertions(+), 4 deletions(-)
146+
147+diff --git a/v4l2loopback.c b/v4l2loopback.c
148+index 9059d58..d66fb55 100644
149+--- a/v4l2loopback.c
150++++ b/v4l2loopback.c
151+@@ -44,10 +44,6 @@
152+ #define strscpy strlcpy
153+ #endif
154+
155+-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0)
156+-#define timer_delete_sync del_timer_sync
157+-#endif
158+-
159+ #if defined(timer_setup) && defined(from_timer)
160+ #define HAVE_TIMER_SETUP
161+ #endif
162+@@ -56,6 +52,10 @@
163+ #define VFL_TYPE_VIDEO VFL_TYPE_GRABBER
164+ #endif
165+
166++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
167++#define timer_delete_sync del_timer_sync
168++#endif
169++
170+ #define V4L2LOOPBACK_VERSION_CODE KERNEL_VERSION(0, 12, 7)
171+
172+ MODULE_DESCRIPTION("V4L2 loopback video device");
173diff --git a/debian/patches/series b/debian/patches/series
174index c089734..7e04e75 100644
175--- a/debian/patches/series
176+++ b/debian/patches/series
177@@ -3,3 +3,6 @@ dkms.patch
178 0006-UBUNTU-SAUCE-event-support-V4L2_EVENT_PRI_CLIENT_USA.patch
179 0007-v4l2loopback-Fixup-bytesused-field-when-writer-sends.patch
180 0008-handle-strlcpy.patch
181+added-functionality-for-linux-6.15-626.patch
182+only-use-timer_delete_sync-compat-macro-for-linux-6.2.0.patch
183+Drop-from_timer-macro-usage.patch

Subscribers

People subscribed via source and target branches