diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-04-15 08:15:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 13:45:07 -0400 |
commit | 36c0f8b32c4bd4f668cedfba6d97afaa84f055fb (patch) | |
tree | fb65309d392241a0ae6733346b38145be971274f | |
parent | 2548fee63d9eb43299dacd0ca30dd9d8f407d795 (diff) |
[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs
Make this a proper typed array. Drop the old allocate context code since
that is no longer used.
Note that the memops functions now get a struct device pointer instead of
the struct device ** that was there initially (actually a void pointer to
a struct containing only a struct device pointer).
This code is now a lot cleaner.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
88 files changed, 128 insertions, 208 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index cc4bd3e53b58..f124f3af0de1 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c | |||
@@ -645,7 +645,7 @@ static void sur40_disconnect(struct usb_interface *interface) | |||
645 | */ | 645 | */ |
646 | static int sur40_queue_setup(struct vb2_queue *q, | 646 | static int sur40_queue_setup(struct vb2_queue *q, |
647 | unsigned int *nbuffers, unsigned int *nplanes, | 647 | unsigned int *nbuffers, unsigned int *nplanes, |
648 | unsigned int sizes[], void *alloc_ctxs[]) | 648 | unsigned int sizes[], struct device *alloc_devs[]) |
649 | { | 649 | { |
650 | if (q->num_buffers + *nbuffers < 3) | 650 | if (q->num_buffers + *nbuffers < 3) |
651 | *nbuffers = 3 - q->num_buffers; | 651 | *nbuffers = 3 - q->num_buffers; |
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 47a480a7d46c..6e22af36b637 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c | |||
@@ -452,7 +452,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh, | |||
452 | /* Videobuf2 operations */ | 452 | /* Videobuf2 operations */ |
453 | static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, | 453 | static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, |
454 | unsigned int *nbuffers, | 454 | unsigned int *nbuffers, |
455 | unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) | 455 | unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[]) |
456 | { | 456 | { |
457 | struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); | 457 | struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); |
458 | struct platform_device *pdev = dev->pdev; | 458 | struct platform_device *pdev = dev->pdev; |
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 6c19cdfcf3b1..d05672fe9ff9 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c | |||
@@ -45,7 +45,7 @@ static const struct v4l2_dv_timings cea1080p60 = V4L2_DV_BT_CEA_1920X1080P60; | |||
45 | 45 | ||
46 | static int cobalt_queue_setup(struct vb2_queue *q, | 46 | static int cobalt_queue_setup(struct vb2_queue *q, |
47 | unsigned int *num_buffers, unsigned int *num_planes, | 47 | unsigned int *num_buffers, unsigned int *num_planes, |
48 | unsigned int sizes[], void *alloc_ctxs[]) | 48 | unsigned int sizes[], struct device *alloc_devs[]) |
49 | { | 49 | { |
50 | struct cobalt_stream *s = q->drv_priv; | 50 | struct cobalt_stream *s = q->drv_priv; |
51 | unsigned size = s->stride * s->height; | 51 | unsigned size = s->stride * s->height; |
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index 0174d08d0c27..efec2d1a7afd 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c | |||
@@ -1140,7 +1140,7 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder) | |||
1140 | 1140 | ||
1141 | static int queue_setup(struct vb2_queue *q, | 1141 | static int queue_setup(struct vb2_queue *q, |
1142 | unsigned int *num_buffers, unsigned int *num_planes, | 1142 | unsigned int *num_buffers, unsigned int *num_planes, |
1143 | unsigned int sizes[], void *alloc_ctxs[]) | 1143 | unsigned int sizes[], struct device *alloc_devs[]) |
1144 | { | 1144 | { |
1145 | struct cx23885_dev *dev = q->drv_priv; | 1145 | struct cx23885_dev *dev = q->drv_priv; |
1146 | 1146 | ||
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 6ad07f5b5749..95aaa2e2afeb 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
@@ -94,7 +94,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
94 | 94 | ||
95 | static int queue_setup(struct vb2_queue *q, | 95 | static int queue_setup(struct vb2_queue *q, |
96 | unsigned int *num_buffers, unsigned int *num_planes, | 96 | unsigned int *num_buffers, unsigned int *num_planes, |
97 | unsigned int sizes[], void *alloc_ctxs[]) | 97 | unsigned int sizes[], struct device *alloc_devs[]) |
98 | { | 98 | { |
99 | struct cx23885_tsport *port = q->drv_priv; | 99 | struct cx23885_tsport *port = q->drv_priv; |
100 | 100 | ||
diff --git a/drivers/media/pci/cx23885/cx23885-vbi.c b/drivers/media/pci/cx23885/cx23885-vbi.c index 2de9485013e1..75e7fa7b1121 100644 --- a/drivers/media/pci/cx23885/cx23885-vbi.c +++ b/drivers/media/pci/cx23885/cx23885-vbi.c | |||
@@ -122,7 +122,7 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev, | |||
122 | 122 | ||
123 | static int queue_setup(struct vb2_queue *q, | 123 | static int queue_setup(struct vb2_queue *q, |
124 | unsigned int *num_buffers, unsigned int *num_planes, | 124 | unsigned int *num_buffers, unsigned int *num_planes, |
125 | unsigned int sizes[], void *alloc_ctxs[]) | 125 | unsigned int sizes[], struct device *alloc_devs[]) |
126 | { | 126 | { |
127 | struct cx23885_dev *dev = q->drv_priv; | 127 | struct cx23885_dev *dev = q->drv_priv; |
128 | unsigned lines = VBI_PAL_LINE_COUNT; | 128 | unsigned lines = VBI_PAL_LINE_COUNT; |
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 3ff86d6dbc60..6d735222a958 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c | |||
@@ -335,7 +335,7 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev, | |||
335 | 335 | ||
336 | static int queue_setup(struct vb2_queue *q, | 336 | static int queue_setup(struct vb2_queue *q, |
337 | unsigned int *num_buffers, unsigned int *num_planes, | 337 | unsigned int *num_buffers, unsigned int *num_planes, |
338 | unsigned int sizes[], void *alloc_ctxs[]) | 338 | unsigned int sizes[], struct device *alloc_devs[]) |
339 | { | 339 | { |
340 | struct cx23885_dev *dev = q->drv_priv; | 340 | struct cx23885_dev *dev = q->drv_priv; |
341 | 341 | ||
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c index 45fc23e11b0c..adcd09be347d 100644 --- a/drivers/media/pci/cx25821/cx25821-video.c +++ b/drivers/media/pci/cx25821/cx25821-video.c | |||
@@ -143,7 +143,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status) | |||
143 | 143 | ||
144 | static int cx25821_queue_setup(struct vb2_queue *q, | 144 | static int cx25821_queue_setup(struct vb2_queue *q, |
145 | unsigned int *num_buffers, unsigned int *num_planes, | 145 | unsigned int *num_buffers, unsigned int *num_planes, |
146 | unsigned int sizes[], void *alloc_ctxs[]) | 146 | unsigned int sizes[], struct device *alloc_devs[]) |
147 | { | 147 | { |
148 | struct cx25821_channel *chan = q->drv_priv; | 148 | struct cx25821_channel *chan = q->drv_priv; |
149 | unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3; | 149 | unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3; |
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index 7c026c1ca1fe..04fe9af2a802 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
@@ -639,7 +639,7 @@ static int blackbird_stop_codec(struct cx8802_dev *dev) | |||
639 | 639 | ||
640 | static int queue_setup(struct vb2_queue *q, | 640 | static int queue_setup(struct vb2_queue *q, |
641 | unsigned int *num_buffers, unsigned int *num_planes, | 641 | unsigned int *num_buffers, unsigned int *num_planes, |
642 | unsigned int sizes[], void *alloc_ctxs[]) | 642 | unsigned int sizes[], struct device *alloc_devs[]) |
643 | { | 643 | { |
644 | struct cx8802_dev *dev = q->drv_priv; | 644 | struct cx8802_dev *dev = q->drv_priv; |
645 | 645 | ||
diff --git a/drivers/media/pci/cx88/cx88-dvb.c b/drivers/media/pci/cx88/cx88-dvb.c index 4d91d1697419..5bb63e7a5691 100644 --- a/drivers/media/pci/cx88/cx88-dvb.c +++ b/drivers/media/pci/cx88/cx88-dvb.c | |||
@@ -84,7 +84,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
84 | 84 | ||
85 | static int queue_setup(struct vb2_queue *q, | 85 | static int queue_setup(struct vb2_queue *q, |
86 | unsigned int *num_buffers, unsigned int *num_planes, | 86 | unsigned int *num_buffers, unsigned int *num_planes, |
87 | unsigned int sizes[], void *alloc_ctxs[]) | 87 | unsigned int sizes[], struct device *alloc_devs[]) |
88 | { | 88 | { |
89 | struct cx8802_dev *dev = q->drv_priv; | 89 | struct cx8802_dev *dev = q->drv_priv; |
90 | 90 | ||
diff --git a/drivers/media/pci/cx88/cx88-vbi.c b/drivers/media/pci/cx88/cx88-vbi.c index 2479f7deccbf..d3237cf8ffa3 100644 --- a/drivers/media/pci/cx88/cx88-vbi.c +++ b/drivers/media/pci/cx88/cx88-vbi.c | |||
@@ -109,7 +109,7 @@ int cx8800_restart_vbi_queue(struct cx8800_dev *dev, | |||
109 | 109 | ||
110 | static int queue_setup(struct vb2_queue *q, | 110 | static int queue_setup(struct vb2_queue *q, |
111 | unsigned int *num_buffers, unsigned int *num_planes, | 111 | unsigned int *num_buffers, unsigned int *num_planes, |
112 | unsigned int sizes[], void *alloc_ctxs[]) | 112 | unsigned int sizes[], struct device *alloc_devs[]) |
113 | { | 113 | { |
114 | struct cx8800_dev *dev = q->drv_priv; | 114 | struct cx8800_dev *dev = q->drv_priv; |
115 | 115 | ||
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 9764d6fb382e..5dc1e3f08d50 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
@@ -431,7 +431,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
431 | 431 | ||
432 | static int queue_setup(struct vb2_queue *q, | 432 | static int queue_setup(struct vb2_queue *q, |
433 | unsigned int *num_buffers, unsigned int *num_planes, | 433 | unsigned int *num_buffers, unsigned int *num_planes, |
434 | unsigned int sizes[], void *alloc_ctxs[]) | 434 | unsigned int sizes[], struct device *alloc_devs[]) |
435 | { | 435 | { |
436 | struct cx8800_dev *dev = q->drv_priv; | 436 | struct cx8800_dev *dev = q->drv_priv; |
437 | struct cx88_core *core = dev->core; | 437 | struct cx88_core *core = dev->core; |
diff --git a/drivers/media/pci/dt3155/dt3155.c b/drivers/media/pci/dt3155/dt3155.c index ec8f58a710c7..6a219694b225 100644 --- a/drivers/media/pci/dt3155/dt3155.c +++ b/drivers/media/pci/dt3155/dt3155.c | |||
@@ -133,7 +133,7 @@ static int wait_i2c_reg(void __iomem *addr) | |||
133 | static int | 133 | static int |
134 | dt3155_queue_setup(struct vb2_queue *vq, | 134 | dt3155_queue_setup(struct vb2_queue *vq, |
135 | unsigned int *nbuffers, unsigned int *num_planes, | 135 | unsigned int *nbuffers, unsigned int *num_planes, |
136 | unsigned int sizes[], void *alloc_ctxs[]) | 136 | unsigned int sizes[], struct device *alloc_devs[]) |
137 | 137 | ||
138 | { | 138 | { |
139 | struct dt3155_priv *pd = vb2_get_drv_priv(vq); | 139 | struct dt3155_priv *pd = vb2_get_drv_priv(vq); |
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c index d278d4e151a0..5e3f41b7b3fe 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c | |||
@@ -293,7 +293,7 @@ static int netup_unidvb_queue_setup(struct vb2_queue *vq, | |||
293 | unsigned int *nbuffers, | 293 | unsigned int *nbuffers, |
294 | unsigned int *nplanes, | 294 | unsigned int *nplanes, |
295 | unsigned int sizes[], | 295 | unsigned int sizes[], |
296 | void *alloc_ctxs[]) | 296 | struct device *alloc_devs[]) |
297 | { | 297 | { |
298 | struct netup_dma *dma = vb2_get_drv_priv(vq); | 298 | struct netup_dma *dma = vb2_get_drv_priv(vq); |
299 | 299 | ||
diff --git a/drivers/media/pci/saa7134/saa7134-ts.c b/drivers/media/pci/saa7134/saa7134-ts.c index 8c68a934e22b..7eaf36a41db9 100644 --- a/drivers/media/pci/saa7134/saa7134-ts.c +++ b/drivers/media/pci/saa7134/saa7134-ts.c | |||
@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare); | |||
118 | 118 | ||
119 | int saa7134_ts_queue_setup(struct vb2_queue *q, | 119 | int saa7134_ts_queue_setup(struct vb2_queue *q, |
120 | unsigned int *nbuffers, unsigned int *nplanes, | 120 | unsigned int *nbuffers, unsigned int *nplanes, |
121 | unsigned int sizes[], void *alloc_ctxs[]) | 121 | unsigned int sizes[], struct device *alloc_devs[]) |
122 | { | 122 | { |
123 | struct saa7134_dmaqueue *dmaq = q->drv_priv; | 123 | struct saa7134_dmaqueue *dmaq = q->drv_priv; |
124 | struct saa7134_dev *dev = dmaq->dev; | 124 | struct saa7134_dev *dev = dmaq->dev; |
diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c b/drivers/media/pci/saa7134/saa7134-vbi.c index e9bffb3569ba..cf9a31e0a390 100644 --- a/drivers/media/pci/saa7134/saa7134-vbi.c +++ b/drivers/media/pci/saa7134/saa7134-vbi.c | |||
@@ -140,7 +140,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) | |||
140 | 140 | ||
141 | static int queue_setup(struct vb2_queue *q, | 141 | static int queue_setup(struct vb2_queue *q, |
142 | unsigned int *nbuffers, unsigned int *nplanes, | 142 | unsigned int *nbuffers, unsigned int *nplanes, |
143 | unsigned int sizes[], void *alloc_ctxs[]) | 143 | unsigned int sizes[], struct device *alloc_devs[]) |
144 | { | 144 | { |
145 | struct saa7134_dmaqueue *dmaq = q->drv_priv; | 145 | struct saa7134_dmaqueue *dmaq = q->drv_priv; |
146 | struct saa7134_dev *dev = dmaq->dev; | 146 | struct saa7134_dev *dev = dmaq->dev; |
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 965ade72f5c5..8a6ebd087889 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c | |||
@@ -963,7 +963,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) | |||
963 | 963 | ||
964 | static int queue_setup(struct vb2_queue *q, | 964 | static int queue_setup(struct vb2_queue *q, |
965 | unsigned int *nbuffers, unsigned int *nplanes, | 965 | unsigned int *nbuffers, unsigned int *nplanes, |
966 | unsigned int sizes[], void *alloc_ctxs[]) | 966 | unsigned int sizes[], struct device *alloc_devs[]) |
967 | { | 967 | { |
968 | struct saa7134_dmaqueue *dmaq = q->drv_priv; | 968 | struct saa7134_dmaqueue *dmaq = q->drv_priv; |
969 | struct saa7134_dev *dev = dmaq->dev; | 969 | struct saa7134_dev *dev = dmaq->dev; |
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h index 41c01588af37..3849083526a7 100644 --- a/drivers/media/pci/saa7134/saa7134.h +++ b/drivers/media/pci/saa7134/saa7134.h | |||
@@ -853,7 +853,7 @@ int saa7134_ts_buffer_init(struct vb2_buffer *vb2); | |||
853 | int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2); | 853 | int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2); |
854 | int saa7134_ts_queue_setup(struct vb2_queue *q, | 854 | int saa7134_ts_queue_setup(struct vb2_queue *q, |
855 | unsigned int *nbuffers, unsigned int *nplanes, | 855 | unsigned int *nbuffers, unsigned int *nplanes, |
856 | unsigned int sizes[], void *alloc_ctxs[]); | 856 | unsigned int sizes[], struct device *alloc_devs[]); |
857 | int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count); | 857 | int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count); |
858 | void saa7134_ts_stop_streaming(struct vb2_queue *vq); | 858 | void saa7134_ts_stop_streaming(struct vb2_queue *vq); |
859 | 859 | ||
diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c index f48ef3392576..8b1cde57c817 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | |||
@@ -664,7 +664,7 @@ static int solo_ring_thread(void *data) | |||
664 | static int solo_enc_queue_setup(struct vb2_queue *q, | 664 | static int solo_enc_queue_setup(struct vb2_queue *q, |
665 | unsigned int *num_buffers, | 665 | unsigned int *num_buffers, |
666 | unsigned int *num_planes, unsigned int sizes[], | 666 | unsigned int *num_planes, unsigned int sizes[], |
667 | void *alloc_ctxs[]) | 667 | struct device *alloc_devs[]) |
668 | { | 668 | { |
669 | sizes[0] = FRAME_BUF_SIZE; | 669 | sizes[0] = FRAME_BUF_SIZE; |
670 | *num_planes = 1; | 670 | *num_planes = 1; |
diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2.c b/drivers/media/pci/solo6x10/solo6x10-v4l2.c index 11cf03be106f..b4be47969b6b 100644 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2.c +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2.c | |||
@@ -315,7 +315,7 @@ static void solo_stop_thread(struct solo_dev *solo_dev) | |||
315 | 315 | ||
316 | static int solo_queue_setup(struct vb2_queue *q, | 316 | static int solo_queue_setup(struct vb2_queue *q, |
317 | unsigned int *num_buffers, unsigned int *num_planes, | 317 | unsigned int *num_buffers, unsigned int *num_planes, |
318 | unsigned int sizes[], void *alloc_ctxs[]) | 318 | unsigned int sizes[], struct device *alloc_devs[]) |
319 | { | 319 | { |
320 | struct solo_dev *solo_dev = vb2_get_drv_priv(q); | 320 | struct solo_dev *solo_dev = vb2_get_drv_priv(q); |
321 | 321 | ||
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 2844df23ada2..aeb2b4e2db35 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c | |||
@@ -265,7 +265,7 @@ static void vip_active_buf_next(struct sta2x11_vip *vip) | |||
265 | /* Videobuf2 Operations */ | 265 | /* Videobuf2 Operations */ |
266 | static int queue_setup(struct vb2_queue *vq, | 266 | static int queue_setup(struct vb2_queue *vq, |
267 | unsigned int *nbuffers, unsigned int *nplanes, | 267 | unsigned int *nbuffers, unsigned int *nplanes, |
268 | unsigned int sizes[], void *alloc_ctxs[]) | 268 | unsigned int sizes[], struct device *alloc_devs[]) |
269 | { | 269 | { |
270 | struct sta2x11_vip *vip = vb2_get_drv_priv(vq); | 270 | struct sta2x11_vip *vip = vb2_get_drv_priv(vq); |
271 | 271 | ||
diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c index c675f9abbb24..5e8212845c87 100644 --- a/drivers/media/pci/tw68/tw68-video.c +++ b/drivers/media/pci/tw68/tw68-video.c | |||
@@ -378,7 +378,7 @@ static int tw68_buffer_count(unsigned int size, unsigned int count) | |||
378 | 378 | ||
379 | static int tw68_queue_setup(struct vb2_queue *q, | 379 | static int tw68_queue_setup(struct vb2_queue *q, |
380 | unsigned int *num_buffers, unsigned int *num_planes, | 380 | unsigned int *num_buffers, unsigned int *num_planes, |
381 | unsigned int sizes[], void *alloc_ctxs[]) | 381 | unsigned int sizes[], struct device *alloc_devs[]) |
382 | { | 382 | { |
383 | struct tw68_dev *dev = vb2_get_drv_priv(q); | 383 | struct tw68_dev *dev = vb2_get_drv_priv(q); |
384 | unsigned tot_bufs = q->num_buffers + *num_buffers; | 384 | unsigned tot_bufs = q->num_buffers + *num_buffers; |
diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c index d380a8d8e462..973fa951644b 100644 --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c | |||
@@ -401,7 +401,7 @@ static const struct tw686x_format *format_by_fourcc(unsigned int fourcc) | |||
401 | 401 | ||
402 | static int tw686x_queue_setup(struct vb2_queue *vq, | 402 | static int tw686x_queue_setup(struct vb2_queue *vq, |
403 | unsigned int *nbuffers, unsigned int *nplanes, | 403 | unsigned int *nbuffers, unsigned int *nplanes, |
404 | unsigned int sizes[], void *alloc_ctxs[]) | 404 | unsigned int sizes[], struct device *alloc_devs[]) |
405 | { | 405 | { |
406 | struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); | 406 | struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); |
407 | unsigned int szimage = | 407 | unsigned int szimage = |
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c index d22b09db9fd0..b33b9e35e60e 100644 --- a/drivers/media/platform/am437x/am437x-vpfe.c +++ b/drivers/media/platform/am437x/am437x-vpfe.c | |||
@@ -1901,14 +1901,14 @@ static void vpfe_calculate_offsets(struct vpfe_device *vpfe) | |||
1901 | * @nbuffers: ptr to number of buffers requested by application | 1901 | * @nbuffers: ptr to number of buffers requested by application |
1902 | * @nplanes:: contains number of distinct video planes needed to hold a frame | 1902 | * @nplanes:: contains number of distinct video planes needed to hold a frame |
1903 | * @sizes[]: contains the size (in bytes) of each plane. | 1903 | * @sizes[]: contains the size (in bytes) of each plane. |
1904 | * @alloc_ctxs: ptr to allocation context | 1904 | * @alloc_devs: ptr to allocation context |
1905 | * | 1905 | * |
1906 | * This callback function is called when reqbuf() is called to adjust | 1906 | * This callback function is called when reqbuf() is called to adjust |
1907 | * the buffer count and buffer size | 1907 | * the buffer count and buffer size |
1908 | */ | 1908 | */ |
1909 | static int vpfe_queue_setup(struct vb2_queue *vq, | 1909 | static int vpfe_queue_setup(struct vb2_queue *vq, |
1910 | unsigned int *nbuffers, unsigned int *nplanes, | 1910 | unsigned int *nbuffers, unsigned int *nplanes, |
1911 | unsigned int sizes[], void *alloc_ctxs[]) | 1911 | unsigned int sizes[], struct device *alloc_devs[]) |
1912 | { | 1912 | { |
1913 | struct vpfe_device *vpfe = vb2_get_drv_priv(vq); | 1913 | struct vpfe_device *vpfe = vb2_get_drv_priv(vq); |
1914 | unsigned size = vpfe->fmt.fmt.pix.sizeimage; | 1914 | unsigned size = vpfe->fmt.fmt.pix.sizeimage; |
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 1e2442876d26..8eb03397d736 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c | |||
@@ -201,7 +201,7 @@ static void bcap_free_sensor_formats(struct bcap_device *bcap_dev) | |||
201 | 201 | ||
202 | static int bcap_queue_setup(struct vb2_queue *vq, | 202 | static int bcap_queue_setup(struct vb2_queue *vq, |
203 | unsigned int *nbuffers, unsigned int *nplanes, | 203 | unsigned int *nbuffers, unsigned int *nplanes, |
204 | unsigned int sizes[], void *alloc_ctxs[]) | 204 | unsigned int sizes[], struct device *alloc_devs[]) |
205 | { | 205 | { |
206 | struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); | 206 | struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); |
207 | 207 | ||
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 3d57c352cefa..3e9b7c817684 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c | |||
@@ -1139,7 +1139,7 @@ static void set_default_params(struct coda_ctx *ctx) | |||
1139 | */ | 1139 | */ |
1140 | static int coda_queue_setup(struct vb2_queue *vq, | 1140 | static int coda_queue_setup(struct vb2_queue *vq, |
1141 | unsigned int *nbuffers, unsigned int *nplanes, | 1141 | unsigned int *nbuffers, unsigned int *nplanes, |
1142 | unsigned int sizes[], void *alloc_ctxs[]) | 1142 | unsigned int sizes[], struct device *alloc_devs[]) |
1143 | { | 1143 | { |
1144 | struct coda_ctx *ctx = vb2_get_drv_priv(vq); | 1144 | struct coda_ctx *ctx = vb2_get_drv_priv(vq); |
1145 | struct coda_q_data *q_data; | 1145 | struct coda_q_data *q_data; |
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 2a4c2914d077..0b1709e96673 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c | |||
@@ -230,7 +230,7 @@ static int vpbe_buffer_prepare(struct vb2_buffer *vb) | |||
230 | static int | 230 | static int |
231 | vpbe_buffer_queue_setup(struct vb2_queue *vq, | 231 | vpbe_buffer_queue_setup(struct vb2_queue *vq, |
232 | unsigned int *nbuffers, unsigned int *nplanes, | 232 | unsigned int *nbuffers, unsigned int *nplanes, |
233 | unsigned int sizes[], void *alloc_ctxs[]) | 233 | unsigned int sizes[], struct device *alloc_devs[]) |
234 | 234 | ||
235 | { | 235 | { |
236 | /* Get the file handle object and layer object */ | 236 | /* Get the file handle object and layer object */ |
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index d5afab0dd9e5..5104cc0ee40e 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -107,14 +107,14 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) | |||
107 | * @nbuffers: ptr to number of buffers requested by application | 107 | * @nbuffers: ptr to number of buffers requested by application |
108 | * @nplanes:: contains number of distinct video planes needed to hold a frame | 108 | * @nplanes:: contains number of distinct video planes needed to hold a frame |
109 | * @sizes[]: contains the size (in bytes) of each plane. | 109 | * @sizes[]: contains the size (in bytes) of each plane. |
110 | * @alloc_ctxs: ptr to allocation context | 110 | * @alloc_devs: ptr to allocation context |
111 | * | 111 | * |
112 | * This callback function is called when reqbuf() is called to adjust | 112 | * This callback function is called when reqbuf() is called to adjust |
113 | * the buffer count and buffer size | 113 | * the buffer count and buffer size |
114 | */ | 114 | */ |
115 | static int vpif_buffer_queue_setup(struct vb2_queue *vq, | 115 | static int vpif_buffer_queue_setup(struct vb2_queue *vq, |
116 | unsigned int *nbuffers, unsigned int *nplanes, | 116 | unsigned int *nbuffers, unsigned int *nplanes, |
117 | unsigned int sizes[], void *alloc_ctxs[]) | 117 | unsigned int sizes[], struct device *alloc_devs[]) |
118 | { | 118 | { |
119 | struct channel_obj *ch = vb2_get_drv_priv(vq); | 119 | struct channel_obj *ch = vb2_get_drv_priv(vq); |
120 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 120 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 5d77884b120a..75b27233ec2f 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
@@ -102,14 +102,14 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) | |||
102 | * @nbuffers: ptr to number of buffers requested by application | 102 | * @nbuffers: ptr to number of buffers requested by application |
103 | * @nplanes:: contains number of distinct video planes needed to hold a frame | 103 | * @nplanes:: contains number of distinct video planes needed to hold a frame |
104 | * @sizes[]: contains the size (in bytes) of each plane. | 104 | * @sizes[]: contains the size (in bytes) of each plane. |
105 | * @alloc_ctxs: ptr to allocation context | 105 | * @alloc_devs: ptr to allocation context |
106 | * | 106 | * |
107 | * This callback function is called when reqbuf() is called to adjust | 107 | * This callback function is called when reqbuf() is called to adjust |
108 | * the buffer count and buffer size | 108 | * the buffer count and buffer size |
109 | */ | 109 | */ |
110 | static int vpif_buffer_queue_setup(struct vb2_queue *vq, | 110 | static int vpif_buffer_queue_setup(struct vb2_queue *vq, |
111 | unsigned int *nbuffers, unsigned int *nplanes, | 111 | unsigned int *nbuffers, unsigned int *nplanes, |
112 | unsigned int sizes[], void *alloc_ctxs[]) | 112 | unsigned int sizes[], struct device *alloc_devs[]) |
113 | { | 113 | { |
114 | struct channel_obj *ch = vb2_get_drv_priv(vq); | 114 | struct channel_obj *ch = vb2_get_drv_priv(vq); |
115 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 115 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h index 5c48329381fa..7ad7b9dc2243 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/exynos-gsc/gsc-core.h | |||
@@ -327,7 +327,6 @@ struct gsc_driverdata { | |||
327 | * @irq_queue: interrupt handler waitqueue | 327 | * @irq_queue: interrupt handler waitqueue |
328 | * @m2m: memory-to-memory V4L2 device information | 328 | * @m2m: memory-to-memory V4L2 device information |
329 | * @state: flags used to synchronize m2m and capture mode operation | 329 | * @state: flags used to synchronize m2m and capture mode operation |
330 | * @alloc_ctx: videobuf2 memory allocator context | ||
331 | * @vdev: video device for G-Scaler instance | 330 | * @vdev: video device for G-Scaler instance |
332 | */ | 331 | */ |
333 | struct gsc_dev { | 332 | struct gsc_dev { |
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c index 622709c45413..ec6494cbdd45 100644 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c | |||
@@ -213,7 +213,7 @@ put_device: | |||
213 | 213 | ||
214 | static int gsc_m2m_queue_setup(struct vb2_queue *vq, | 214 | static int gsc_m2m_queue_setup(struct vb2_queue *vq, |
215 | unsigned int *num_buffers, unsigned int *num_planes, | 215 | unsigned int *num_buffers, unsigned int *num_planes, |
216 | unsigned int sizes[], void *allocators[]) | 216 | unsigned int sizes[], struct device *alloc_devs[]) |
217 | { | 217 | { |
218 | struct gsc_ctx *ctx = vb2_get_drv_priv(vq); | 218 | struct gsc_ctx *ctx = vb2_get_drv_priv(vq); |
219 | struct gsc_frame *frame; | 219 | struct gsc_frame *frame; |
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 512b254914bc..fdec499fbbda 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c | |||
@@ -340,7 +340,7 @@ int fimc_capture_resume(struct fimc_dev *fimc) | |||
340 | 340 | ||
341 | static int queue_setup(struct vb2_queue *vq, | 341 | static int queue_setup(struct vb2_queue *vq, |
342 | unsigned int *num_buffers, unsigned int *num_planes, | 342 | unsigned int *num_buffers, unsigned int *num_planes, |
343 | unsigned int sizes[], void *allocators[]) | 343 | unsigned int sizes[], struct device *alloc_devs[]) |
344 | { | 344 | { |
345 | struct fimc_ctx *ctx = vq->drv_priv; | 345 | struct fimc_ctx *ctx = vq->drv_priv; |
346 | struct fimc_frame *frame = &ctx->d_frame; | 346 | struct fimc_frame *frame = &ctx->d_frame; |
diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c index abc338962d80..400ce0cb0c0d 100644 --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | static int isp_video_capture_queue_setup(struct vb2_queue *vq, | 41 | static int isp_video_capture_queue_setup(struct vb2_queue *vq, |
42 | unsigned int *num_buffers, unsigned int *num_planes, | 42 | unsigned int *num_buffers, unsigned int *num_planes, |
43 | unsigned int sizes[], void *allocators[]) | 43 | unsigned int sizes[], struct device *alloc_devs[]) |
44 | { | 44 | { |
45 | struct fimc_isp *isp = vb2_get_drv_priv(vq); | 45 | struct fimc_isp *isp = vb2_get_drv_priv(vq); |
46 | struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt; | 46 | struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt; |
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index f5a27a90e9d1..a0f149fb88e1 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c | |||
@@ -357,7 +357,7 @@ static void stop_streaming(struct vb2_queue *q) | |||
357 | 357 | ||
358 | static int queue_setup(struct vb2_queue *vq, | 358 | static int queue_setup(struct vb2_queue *vq, |
359 | unsigned int *num_buffers, unsigned int *num_planes, | 359 | unsigned int *num_buffers, unsigned int *num_planes, |
360 | unsigned int sizes[], void *allocators[]) | 360 | unsigned int sizes[], struct device *alloc_devs[]) |
361 | { | 361 | { |
362 | struct fimc_lite *fimc = vq->drv_priv; | 362 | struct fimc_lite *fimc = vq->drv_priv; |
363 | struct flite_frame *frame = &fimc->out_frame; | 363 | struct flite_frame *frame = &fimc->out_frame; |
diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c index f4f76225ffed..b1309e114edb 100644 --- a/drivers/media/platform/exynos4-is/fimc-m2m.c +++ b/drivers/media/platform/exynos4-is/fimc-m2m.c | |||
@@ -174,7 +174,7 @@ static void fimc_job_abort(void *priv) | |||
174 | 174 | ||
175 | static int fimc_queue_setup(struct vb2_queue *vq, | 175 | static int fimc_queue_setup(struct vb2_queue *vq, |
176 | unsigned int *num_buffers, unsigned int *num_planes, | 176 | unsigned int *num_buffers, unsigned int *num_planes, |
177 | unsigned int sizes[], void *allocators[]) | 177 | unsigned int sizes[], struct device *alloc_devs[]) |
178 | { | 178 | { |
179 | struct fimc_ctx *ctx = vb2_get_drv_priv(vq); | 179 | struct fimc_ctx *ctx = vb2_get_drv_priv(vq); |
180 | struct fimc_frame *f; | 180 | struct fimc_frame *f; |
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index 15110ea89c56..0fcb5c78031d 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c | |||
@@ -798,7 +798,7 @@ struct vb2_dc_conf { | |||
798 | 798 | ||
799 | static int deinterlace_queue_setup(struct vb2_queue *vq, | 799 | static int deinterlace_queue_setup(struct vb2_queue *vq, |
800 | unsigned int *nbuffers, unsigned int *nplanes, | 800 | unsigned int *nbuffers, unsigned int *nplanes, |
801 | unsigned int sizes[], void *alloc_ctxs[]) | 801 | unsigned int sizes[], struct device *alloc_devs[]) |
802 | { | 802 | { |
803 | struct deinterlace_ctx *ctx = vb2_get_drv_priv(vq); | 803 | struct deinterlace_ctx *ctx = vb2_get_drv_priv(vq); |
804 | struct deinterlace_q_data *q_data; | 804 | struct deinterlace_q_data *q_data; |
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index 8a1f12d08c0c..9171174521b2 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c | |||
@@ -1051,7 +1051,7 @@ static int mcam_read_setup(struct mcam_camera *cam) | |||
1051 | static int mcam_vb_queue_setup(struct vb2_queue *vq, | 1051 | static int mcam_vb_queue_setup(struct vb2_queue *vq, |
1052 | unsigned int *nbufs, | 1052 | unsigned int *nbufs, |
1053 | unsigned int *num_planes, unsigned int sizes[], | 1053 | unsigned int *num_planes, unsigned int sizes[], |
1054 | void *alloc_ctxs[]) | 1054 | struct device *alloc_devs[]) |
1055 | { | 1055 | { |
1056 | struct mcam_camera *cam = vb2_get_drv_priv(vq); | 1056 | struct mcam_camera *cam = vb2_get_drv_priv(vq); |
1057 | int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2; | 1057 | int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2; |
diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c index 88b3d982a2da..c639406fe72e 100644 --- a/drivers/media/platform/mx2_emmaprp.c +++ b/drivers/media/platform/mx2_emmaprp.c | |||
@@ -689,7 +689,7 @@ static const struct v4l2_ioctl_ops emmaprp_ioctl_ops = { | |||
689 | */ | 689 | */ |
690 | static int emmaprp_queue_setup(struct vb2_queue *vq, | 690 | static int emmaprp_queue_setup(struct vb2_queue *vq, |
691 | unsigned int *nbuffers, unsigned int *nplanes, | 691 | unsigned int *nbuffers, unsigned int *nplanes, |
692 | unsigned int sizes[], void *alloc_ctxs[]) | 692 | unsigned int sizes[], struct device *alloc_devs[]) |
693 | { | 693 | { |
694 | struct emmaprp_ctx *ctx = vb2_get_drv_priv(vq); | 694 | struct emmaprp_ctx *ctx = vb2_get_drv_priv(vq); |
695 | struct emmaprp_q_data *q_data; | 695 | struct emmaprp_q_data *q_data; |
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index 486b8754110f..7d9f35976d18 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c | |||
@@ -331,7 +331,7 @@ isp_video_check_format(struct isp_video *video, struct isp_video_fh *vfh) | |||
331 | 331 | ||
332 | static int isp_video_queue_setup(struct vb2_queue *queue, | 332 | static int isp_video_queue_setup(struct vb2_queue *queue, |
333 | unsigned int *count, unsigned int *num_planes, | 333 | unsigned int *count, unsigned int *num_planes, |
334 | unsigned int sizes[], void *alloc_ctxs[]) | 334 | unsigned int sizes[], struct device *alloc_devs[]) |
335 | { | 335 | { |
336 | struct isp_video_fh *vfh = vb2_get_drv_priv(queue); | 336 | struct isp_video_fh *vfh = vb2_get_drv_priv(queue); |
337 | struct isp_video *video = vfh->video; | 337 | struct isp_video *video = vfh->video; |
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 4c5c529aafa7..496aa97b6400 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c | |||
@@ -974,7 +974,7 @@ static void return_all_buffers(struct rvin_dev *vin, | |||
974 | 974 | ||
975 | static int rvin_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, | 975 | static int rvin_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, |
976 | unsigned int *nplanes, unsigned int sizes[], | 976 | unsigned int *nplanes, unsigned int sizes[], |
977 | void *alloc_ctxs[]) | 977 | struct device *alloc_devs[]) |
978 | 978 | ||
979 | { | 979 | { |
980 | struct rvin_dev *vin = vb2_get_drv_priv(vq); | 980 | struct rvin_dev *vin = vb2_get_drv_priv(vq); |
diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c index d81c41035bb6..16782ceb29c3 100644 --- a/drivers/media/platform/rcar_jpu.c +++ b/drivers/media/platform/rcar_jpu.c | |||
@@ -1014,7 +1014,7 @@ error_free: | |||
1014 | */ | 1014 | */ |
1015 | static int jpu_queue_setup(struct vb2_queue *vq, | 1015 | static int jpu_queue_setup(struct vb2_queue *vq, |
1016 | unsigned int *nbuffers, unsigned int *nplanes, | 1016 | unsigned int *nbuffers, unsigned int *nplanes, |
1017 | unsigned int sizes[], void *alloc_ctxs[]) | 1017 | unsigned int sizes[], struct device *alloc_devs[]) |
1018 | { | 1018 | { |
1019 | struct jpu_ctx *ctx = vb2_get_drv_priv(vq); | 1019 | struct jpu_ctx *ctx = vb2_get_drv_priv(vq); |
1020 | struct jpu_q_data *q_data; | 1020 | struct jpu_q_data *q_data; |
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index 5eb5df1c6f75..0413a861a59a 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c | |||
@@ -437,7 +437,7 @@ static void stop_streaming(struct vb2_queue *vq) | |||
437 | 437 | ||
438 | static int queue_setup(struct vb2_queue *vq, | 438 | static int queue_setup(struct vb2_queue *vq, |
439 | unsigned int *num_buffers, unsigned int *num_planes, | 439 | unsigned int *num_buffers, unsigned int *num_planes, |
440 | unsigned int sizes[], void *allocators[]) | 440 | unsigned int sizes[], struct device *alloc_devs[]) |
441 | { | 441 | { |
442 | struct camif_vp *vp = vb2_get_drv_priv(vq); | 442 | struct camif_vp *vp = vb2_get_drv_priv(vq); |
443 | struct camif_frame *frame = &vp->out_frame; | 443 | struct camif_frame *frame = &vp->out_frame; |
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c index 2aeb950ba91f..391dd7a7b362 100644 --- a/drivers/media/platform/s5p-g2d/g2d.c +++ b/drivers/media/platform/s5p-g2d/g2d.c | |||
@@ -103,7 +103,7 @@ static struct g2d_frame *get_frame(struct g2d_ctx *ctx, | |||
103 | 103 | ||
104 | static int g2d_queue_setup(struct vb2_queue *vq, | 104 | static int g2d_queue_setup(struct vb2_queue *vq, |
105 | unsigned int *nbuffers, unsigned int *nplanes, | 105 | unsigned int *nbuffers, unsigned int *nplanes, |
106 | unsigned int sizes[], void *alloc_ctxs[]) | 106 | unsigned int sizes[], struct device *alloc_devs[]) |
107 | { | 107 | { |
108 | struct g2d_ctx *ctx = vb2_get_drv_priv(vq); | 108 | struct g2d_ctx *ctx = vb2_get_drv_priv(vq); |
109 | struct g2d_frame *f = get_frame(ctx, vq->type); | 109 | struct g2d_frame *f = get_frame(ctx, vq->type); |
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index d8842c482f0c..785e6936c881 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c | |||
@@ -2436,7 +2436,7 @@ static struct v4l2_m2m_ops exynos4_jpeg_m2m_ops = { | |||
2436 | 2436 | ||
2437 | static int s5p_jpeg_queue_setup(struct vb2_queue *vq, | 2437 | static int s5p_jpeg_queue_setup(struct vb2_queue *vq, |
2438 | unsigned int *nbuffers, unsigned int *nplanes, | 2438 | unsigned int *nbuffers, unsigned int *nplanes, |
2439 | unsigned int sizes[], void *alloc_ctxs[]) | 2439 | unsigned int sizes[], struct device *alloc_devs[]) |
2440 | { | 2440 | { |
2441 | struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(vq); | 2441 | struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(vq); |
2442 | struct s5p_jpeg_q_data *q_data = NULL; | 2442 | struct s5p_jpeg_q_data *q_data = NULL; |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index ae98a5568b69..47c997d9e8cb 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | |||
@@ -890,7 +890,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_dec_ioctl_ops = { | |||
890 | static int s5p_mfc_queue_setup(struct vb2_queue *vq, | 890 | static int s5p_mfc_queue_setup(struct vb2_queue *vq, |
891 | unsigned int *buf_count, | 891 | unsigned int *buf_count, |
892 | unsigned int *plane_count, unsigned int psize[], | 892 | unsigned int *plane_count, unsigned int psize[], |
893 | void *allocators[]) | 893 | struct device *alloc_devs[]) |
894 | { | 894 | { |
895 | struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); | 895 | struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); |
896 | struct s5p_mfc_dev *dev = ctx->dev; | 896 | struct s5p_mfc_dev *dev = ctx->dev; |
@@ -931,14 +931,14 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, | |||
931 | psize[1] = ctx->chroma_size; | 931 | psize[1] = ctx->chroma_size; |
932 | 932 | ||
933 | if (IS_MFCV6_PLUS(dev)) | 933 | if (IS_MFCV6_PLUS(dev)) |
934 | allocators[0] = &ctx->dev->mem_dev_l; | 934 | alloc_devs[0] = ctx->dev->mem_dev_l; |
935 | else | 935 | else |
936 | allocators[0] = &ctx->dev->mem_dev_r; | 936 | alloc_devs[0] = ctx->dev->mem_dev_r; |
937 | allocators[1] = &ctx->dev->mem_dev_l; | 937 | alloc_devs[1] = ctx->dev->mem_dev_l; |
938 | } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && | 938 | } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && |
939 | ctx->state == MFCINST_INIT) { | 939 | ctx->state == MFCINST_INIT) { |
940 | psize[0] = ctx->dec_src_buf_size; | 940 | psize[0] = ctx->dec_src_buf_size; |
941 | allocators[0] = &ctx->dev->mem_dev_l; | 941 | alloc_devs[0] = ctx->dev->mem_dev_l; |
942 | } else { | 942 | } else { |
943 | mfc_err("This video node is dedicated to decoding. Decoding not initialized\n"); | 943 | mfc_err("This video node is dedicated to decoding. Decoding not initialized\n"); |
944 | return -EINVAL; | 944 | return -EINVAL; |
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index b95796a0cc33..fcc2e054c61f 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | |||
@@ -1812,7 +1812,7 @@ static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb) | |||
1812 | 1812 | ||
1813 | static int s5p_mfc_queue_setup(struct vb2_queue *vq, | 1813 | static int s5p_mfc_queue_setup(struct vb2_queue *vq, |
1814 | unsigned int *buf_count, unsigned int *plane_count, | 1814 | unsigned int *buf_count, unsigned int *plane_count, |
1815 | unsigned int psize[], void *allocators[]) | 1815 | unsigned int psize[], struct device *alloc_devs[]) |
1816 | { | 1816 | { |
1817 | struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); | 1817 | struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); |
1818 | struct s5p_mfc_dev *dev = ctx->dev; | 1818 | struct s5p_mfc_dev *dev = ctx->dev; |
@@ -1832,7 +1832,7 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, | |||
1832 | if (*buf_count > MFC_MAX_BUFFERS) | 1832 | if (*buf_count > MFC_MAX_BUFFERS) |
1833 | *buf_count = MFC_MAX_BUFFERS; | 1833 | *buf_count = MFC_MAX_BUFFERS; |
1834 | psize[0] = ctx->enc_dst_buf_size; | 1834 | psize[0] = ctx->enc_dst_buf_size; |
1835 | allocators[0] = &ctx->dev->mem_dev_l; | 1835 | alloc_devs[0] = ctx->dev->mem_dev_l; |
1836 | } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { | 1836 | } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { |
1837 | if (ctx->src_fmt) | 1837 | if (ctx->src_fmt) |
1838 | *plane_count = ctx->src_fmt->num_planes; | 1838 | *plane_count = ctx->src_fmt->num_planes; |
@@ -1848,11 +1848,11 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, | |||
1848 | psize[1] = ctx->chroma_size; | 1848 | psize[1] = ctx->chroma_size; |
1849 | 1849 | ||
1850 | if (IS_MFCV6_PLUS(dev)) { | 1850 | if (IS_MFCV6_PLUS(dev)) { |
1851 | allocators[0] = &ctx->dev->mem_dev_l; | 1851 | alloc_devs[0] = ctx->dev->mem_dev_l; |
1852 | allocators[1] = &ctx->dev->mem_dev_l; | 1852 | alloc_devs[1] = ctx->dev->mem_dev_l; |
1853 | } else { | 1853 | } else { |
1854 | allocators[0] = &ctx->dev->mem_dev_r; | 1854 | alloc_devs[0] = ctx->dev->mem_dev_r; |
1855 | allocators[1] = &ctx->dev->mem_dev_r; | 1855 | alloc_devs[1] = ctx->dev->mem_dev_r; |
1856 | } | 1856 | } |
1857 | } else { | 1857 | } else { |
1858 | mfc_err("invalid queue type: %d\n", vq->type); | 1858 | mfc_err("invalid queue type: %d\n", vq->type); |
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index 6c4d1b91f325..ee74e2b44d69 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c | |||
@@ -874,7 +874,7 @@ static const struct v4l2_file_operations mxr_fops = { | |||
874 | 874 | ||
875 | static int queue_setup(struct vb2_queue *vq, | 875 | static int queue_setup(struct vb2_queue *vq, |
876 | unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], | 876 | unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], |
877 | void *alloc_ctxs[]) | 877 | struct device *alloc_devs[]) |
878 | { | 878 | { |
879 | struct mxr_layer *layer = vb2_get_drv_priv(vq); | 879 | struct mxr_layer *layer = vb2_get_drv_priv(vq); |
880 | const struct mxr_format *fmt = layer->fmt; | 880 | const struct mxr_format *fmt = layer->fmt; |
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index afd21c9f1a02..15a562af13c7 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c | |||
@@ -865,7 +865,7 @@ static const struct v4l2_ioctl_ops sh_veu_ioctl_ops = { | |||
865 | 865 | ||
866 | static int sh_veu_queue_setup(struct vb2_queue *vq, | 866 | static int sh_veu_queue_setup(struct vb2_queue *vq, |
867 | unsigned int *nbuffers, unsigned int *nplanes, | 867 | unsigned int *nbuffers, unsigned int *nplanes, |
868 | unsigned int sizes[], void *alloc_ctxs[]) | 868 | unsigned int sizes[], struct device *alloc_devs[]) |
869 | { | 869 | { |
870 | struct sh_veu_dev *veu = vb2_get_drv_priv(vq); | 870 | struct sh_veu_dev *veu = vb2_get_drv_priv(vq); |
871 | struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type); | 871 | struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type); |
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c index 59830a491592..e1f39b4cf1cd 100644 --- a/drivers/media/platform/sh_vou.c +++ b/drivers/media/platform/sh_vou.c | |||
@@ -244,7 +244,7 @@ static void sh_vou_stream_config(struct sh_vou_device *vou_dev) | |||
244 | /* Locking: caller holds fop_lock mutex */ | 244 | /* Locking: caller holds fop_lock mutex */ |
245 | static int sh_vou_queue_setup(struct vb2_queue *vq, | 245 | static int sh_vou_queue_setup(struct vb2_queue *vq, |
246 | unsigned int *nbuffers, unsigned int *nplanes, | 246 | unsigned int *nbuffers, unsigned int *nplanes, |
247 | unsigned int sizes[], void *alloc_ctxs[]) | 247 | unsigned int sizes[], struct device *alloc_devs[]) |
248 | { | 248 | { |
249 | struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); | 249 | struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); |
250 | struct v4l2_pix_format *pix = &vou_dev->pix; | 250 | struct v4l2_pix_format *pix = &vou_dev->pix; |
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index 899b93ad1e4f..30211f6b4483 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c | |||
@@ -303,7 +303,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) | |||
303 | ------------------------------------------------------------------*/ | 303 | ------------------------------------------------------------------*/ |
304 | static int queue_setup(struct vb2_queue *vq, | 304 | static int queue_setup(struct vb2_queue *vq, |
305 | unsigned int *nbuffers, unsigned int *nplanes, | 305 | unsigned int *nbuffers, unsigned int *nplanes, |
306 | unsigned int sizes[], void *alloc_ctxs[]) | 306 | unsigned int sizes[], struct device *alloc_devs[]) |
307 | { | 307 | { |
308 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); | 308 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); |
309 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 309 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index dadc5b3e1bb2..9c137522c660 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c | |||
@@ -533,7 +533,7 @@ struct rcar_vin_cam { | |||
533 | static int rcar_vin_videobuf_setup(struct vb2_queue *vq, | 533 | static int rcar_vin_videobuf_setup(struct vb2_queue *vq, |
534 | unsigned int *count, | 534 | unsigned int *count, |
535 | unsigned int *num_planes, | 535 | unsigned int *num_planes, |
536 | unsigned int sizes[], void *alloc_ctxs[]) | 536 | unsigned int sizes[], struct device *alloc_devs[]) |
537 | { | 537 | { |
538 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); | 538 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); |
539 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 539 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c index 8f87fbec6f51..02b519dde42a 100644 --- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c | |||
@@ -210,7 +210,7 @@ static int sh_mobile_ceu_soft_reset(struct sh_mobile_ceu_dev *pcdev) | |||
210 | */ | 210 | */ |
211 | static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq, | 211 | static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq, |
212 | unsigned int *count, unsigned int *num_planes, | 212 | unsigned int *count, unsigned int *num_planes, |
213 | unsigned int sizes[], void *alloc_ctxs[]) | 213 | unsigned int sizes[], struct device *alloc_devs[]) |
214 | { | 214 | { |
215 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); | 215 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); |
216 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 216 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index b3e8b5afeb61..3b1ac687d0df 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c | |||
@@ -439,7 +439,7 @@ static void bdisp_ctrls_delete(struct bdisp_ctx *ctx) | |||
439 | 439 | ||
440 | static int bdisp_queue_setup(struct vb2_queue *vq, | 440 | static int bdisp_queue_setup(struct vb2_queue *vq, |
441 | unsigned int *nb_buf, unsigned int *nb_planes, | 441 | unsigned int *nb_buf, unsigned int *nb_planes, |
442 | unsigned int sizes[], void *alloc_ctxs[]) | 442 | unsigned int sizes[], struct device *alloc_devs[]) |
443 | { | 443 | { |
444 | struct bdisp_ctx *ctx = vb2_get_drv_priv(vq); | 444 | struct bdisp_ctx *ctx = vb2_get_drv_priv(vq); |
445 | struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type); | 445 | struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type); |
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 51ebf32c659c..e967fcfdc1d8 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c | |||
@@ -1225,7 +1225,7 @@ static int cal_enum_frameintervals(struct file *file, void *priv, | |||
1225 | */ | 1225 | */ |
1226 | static int cal_queue_setup(struct vb2_queue *vq, | 1226 | static int cal_queue_setup(struct vb2_queue *vq, |
1227 | unsigned int *nbuffers, unsigned int *nplanes, | 1227 | unsigned int *nbuffers, unsigned int *nplanes, |
1228 | unsigned int sizes[], void *alloc_ctxs[]) | 1228 | unsigned int sizes[], struct device *alloc_devs[]) |
1229 | { | 1229 | { |
1230 | struct cal_ctx *ctx = vb2_get_drv_priv(vq); | 1230 | struct cal_ctx *ctx = vb2_get_drv_priv(vq); |
1231 | unsigned size = ctx->v_fmt.fmt.pix.sizeimage; | 1231 | unsigned size = ctx->v_fmt.fmt.pix.sizeimage; |
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index 3fefd8ad37af..55a1458ac783 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c | |||
@@ -1796,7 +1796,7 @@ static const struct v4l2_ioctl_ops vpe_ioctl_ops = { | |||
1796 | */ | 1796 | */ |
1797 | static int vpe_queue_setup(struct vb2_queue *vq, | 1797 | static int vpe_queue_setup(struct vb2_queue *vq, |
1798 | unsigned int *nbuffers, unsigned int *nplanes, | 1798 | unsigned int *nbuffers, unsigned int *nplanes, |
1799 | unsigned int sizes[], void *alloc_ctxs[]) | 1799 | unsigned int sizes[], struct device *alloc_devs[]) |
1800 | { | 1800 | { |
1801 | int i; | 1801 | int i; |
1802 | struct vpe_ctx *ctx = vb2_get_drv_priv(vq); | 1802 | struct vpe_ctx *ctx = vb2_get_drv_priv(vq); |
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index c4b5fab83666..6b17015048ae 100644 --- a/drivers/media/platform/vim2m.c +++ b/drivers/media/platform/vim2m.c | |||
@@ -711,7 +711,7 @@ static const struct v4l2_ioctl_ops vim2m_ioctl_ops = { | |||
711 | 711 | ||
712 | static int vim2m_queue_setup(struct vb2_queue *vq, | 712 | static int vim2m_queue_setup(struct vb2_queue *vq, |
713 | unsigned int *nbuffers, unsigned int *nplanes, | 713 | unsigned int *nbuffers, unsigned int *nplanes, |
714 | unsigned int sizes[], void *alloc_ctxs[]) | 714 | unsigned int sizes[], struct device *alloc_devs[]) |
715 | { | 715 | { |
716 | struct vim2m_ctx *ctx = vb2_get_drv_priv(vq); | 716 | struct vim2m_ctx *ctx = vb2_get_drv_priv(vq); |
717 | struct vim2m_q_data *q_data; | 717 | struct vim2m_q_data *q_data; |
@@ -731,11 +731,6 @@ static int vim2m_queue_setup(struct vb2_queue *vq, | |||
731 | *nplanes = 1; | 731 | *nplanes = 1; |
732 | sizes[0] = size; | 732 | sizes[0] = size; |
733 | 733 | ||
734 | /* | ||
735 | * videobuf2-vmalloc allocator is context-less so no need to set | ||
736 | * alloc_ctxs array. | ||
737 | */ | ||
738 | |||
739 | dprintk(ctx->dev, "get %d buffer(s) of size %d each.\n", count, size); | 734 | dprintk(ctx->dev, "get %d buffer(s) of size %d each.\n", count, size); |
740 | 735 | ||
741 | return 0; | 736 | return 0; |
diff --git a/drivers/media/platform/vivid/vivid-sdr-cap.c b/drivers/media/platform/vivid/vivid-sdr-cap.c index 1428e31a2875..ebd7b9c4dd83 100644 --- a/drivers/media/platform/vivid/vivid-sdr-cap.c +++ b/drivers/media/platform/vivid/vivid-sdr-cap.c | |||
@@ -213,7 +213,7 @@ static int vivid_thread_sdr_cap(void *data) | |||
213 | 213 | ||
214 | static int sdr_cap_queue_setup(struct vb2_queue *vq, | 214 | static int sdr_cap_queue_setup(struct vb2_queue *vq, |
215 | unsigned *nbuffers, unsigned *nplanes, | 215 | unsigned *nbuffers, unsigned *nplanes, |
216 | unsigned sizes[], void *alloc_ctxs[]) | 216 | unsigned sizes[], struct device *alloc_devs[]) |
217 | { | 217 | { |
218 | /* 2 = max 16-bit sample returned */ | 218 | /* 2 = max 16-bit sample returned */ |
219 | sizes[0] = SDR_CAP_SAMPLES_PER_BUF * 2; | 219 | sizes[0] = SDR_CAP_SAMPLES_PER_BUF * 2; |
diff --git a/drivers/media/platform/vivid/vivid-vbi-cap.c b/drivers/media/platform/vivid/vivid-vbi-cap.c index cda45a582bfe..d66ef95dd2b5 100644 --- a/drivers/media/platform/vivid/vivid-vbi-cap.c +++ b/drivers/media/platform/vivid/vivid-vbi-cap.c | |||
@@ -137,7 +137,7 @@ void vivid_sliced_vbi_cap_process(struct vivid_dev *dev, | |||
137 | 137 | ||
138 | static int vbi_cap_queue_setup(struct vb2_queue *vq, | 138 | static int vbi_cap_queue_setup(struct vb2_queue *vq, |
139 | unsigned *nbuffers, unsigned *nplanes, | 139 | unsigned *nbuffers, unsigned *nplanes, |
140 | unsigned sizes[], void *alloc_ctxs[]) | 140 | unsigned sizes[], struct device *alloc_devs[]) |
141 | { | 141 | { |
142 | struct vivid_dev *dev = vb2_get_drv_priv(vq); | 142 | struct vivid_dev *dev = vb2_get_drv_priv(vq); |
143 | bool is_60hz = dev->std_cap & V4L2_STD_525_60; | 143 | bool is_60hz = dev->std_cap & V4L2_STD_525_60; |
diff --git a/drivers/media/platform/vivid/vivid-vbi-out.c b/drivers/media/platform/vivid/vivid-vbi-out.c index 3c5a469e6f49..d2989195cf03 100644 --- a/drivers/media/platform/vivid/vivid-vbi-out.c +++ b/drivers/media/platform/vivid/vivid-vbi-out.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | static int vbi_out_queue_setup(struct vb2_queue *vq, | 30 | static int vbi_out_queue_setup(struct vb2_queue *vq, |
31 | unsigned *nbuffers, unsigned *nplanes, | 31 | unsigned *nbuffers, unsigned *nplanes, |
32 | unsigned sizes[], void *alloc_ctxs[]) | 32 | unsigned sizes[], struct device *alloc_devs[]) |
33 | { | 33 | { |
34 | struct vivid_dev *dev = vb2_get_drv_priv(vq); | 34 | struct vivid_dev *dev = vb2_get_drv_priv(vq); |
35 | bool is_60hz = dev->std_out & V4L2_STD_525_60; | 35 | bool is_60hz = dev->std_out & V4L2_STD_525_60; |
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c index fdca33fc20b0..52ea6d74b70b 100644 --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c | |||
@@ -97,7 +97,7 @@ static const struct v4l2_discrete_probe webcam_probe = { | |||
97 | 97 | ||
98 | static int vid_cap_queue_setup(struct vb2_queue *vq, | 98 | static int vid_cap_queue_setup(struct vb2_queue *vq, |
99 | unsigned *nbuffers, unsigned *nplanes, | 99 | unsigned *nbuffers, unsigned *nplanes, |
100 | unsigned sizes[], void *alloc_ctxs[]) | 100 | unsigned sizes[], struct device *alloc_devs[]) |
101 | { | 101 | { |
102 | struct vivid_dev *dev = vb2_get_drv_priv(vq); | 102 | struct vivid_dev *dev = vb2_get_drv_priv(vq); |
103 | unsigned buffers = tpg_g_buffers(&dev->tpg); | 103 | unsigned buffers = tpg_g_buffers(&dev->tpg); |
@@ -144,11 +144,6 @@ static int vid_cap_queue_setup(struct vb2_queue *vq, | |||
144 | 144 | ||
145 | *nplanes = buffers; | 145 | *nplanes = buffers; |
146 | 146 | ||
147 | /* | ||
148 | * videobuf2-vmalloc allocator is context-less so no need to set | ||
149 | * alloc_ctxs array. | ||
150 | */ | ||
151 | |||
152 | dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers); | 147 | dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers); |
153 | for (p = 0; p < buffers; p++) | 148 | for (p = 0; p < buffers; p++) |
154 | dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]); | 149 | dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]); |
diff --git a/drivers/media/platform/vivid/vivid-vid-out.c b/drivers/media/platform/vivid/vivid-vid-out.c index f92f4496d527..dd609eea4753 100644 --- a/drivers/media/platform/vivid/vivid-vid-out.c +++ b/drivers/media/platform/vivid/vivid-vid-out.c | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | static int vid_out_queue_setup(struct vb2_queue *vq, | 35 | static int vid_out_queue_setup(struct vb2_queue *vq, |
36 | unsigned *nbuffers, unsigned *nplanes, | 36 | unsigned *nbuffers, unsigned *nplanes, |
37 | unsigned sizes[], void *alloc_ctxs[]) | 37 | unsigned sizes[], struct device *alloc_devs[]) |
38 | { | 38 | { |
39 | struct vivid_dev *dev = vb2_get_drv_priv(vq); | 39 | struct vivid_dev *dev = vb2_get_drv_priv(vq); |
40 | const struct vivid_fmt *vfmt = dev->fmt_out; | 40 | const struct vivid_fmt *vfmt = dev->fmt_out; |
@@ -87,11 +87,6 @@ static int vid_out_queue_setup(struct vb2_queue *vq, | |||
87 | 87 | ||
88 | *nplanes = planes; | 88 | *nplanes = planes; |
89 | 89 | ||
90 | /* | ||
91 | * videobuf2-vmalloc allocator is context-less so no need to set | ||
92 | * alloc_ctxs array. | ||
93 | */ | ||
94 | |||
95 | dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers); | 90 | dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers); |
96 | for (p = 0; p < planes; p++) | 91 | for (p = 0; p < planes; p++) |
97 | dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]); | 92 | dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]); |
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 0e94e3b6fcf1..424a54122190 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c | |||
@@ -519,8 +519,8 @@ static void vsp1_video_pipeline_put(struct vsp1_pipeline *pipe) | |||
519 | 519 | ||
520 | static int | 520 | static int |
521 | vsp1_video_queue_setup(struct vb2_queue *vq, | 521 | vsp1_video_queue_setup(struct vb2_queue *vq, |
522 | unsigned int *nbuffers, unsigned int *nplanes, | 522 | unsigned int *nbuffers, unsigned int *nplanes, |
523 | unsigned int sizes[], void *alloc_ctxs[]) | 523 | unsigned int sizes[], struct device *alloc_devs[]) |
524 | { | 524 | { |
525 | struct vsp1_video *video = vb2_get_drv_priv(vq); | 525 | struct vsp1_video *video = vb2_get_drv_priv(vq); |
526 | const struct v4l2_pix_format_mplane *format = &video->rwpf->format; | 526 | const struct v4l2_pix_format_mplane *format = &video->rwpf->format; |
@@ -530,10 +530,9 @@ vsp1_video_queue_setup(struct vb2_queue *vq, | |||
530 | if (*nplanes != format->num_planes) | 530 | if (*nplanes != format->num_planes) |
531 | return -EINVAL; | 531 | return -EINVAL; |
532 | 532 | ||
533 | for (i = 0; i < *nplanes; i++) { | 533 | for (i = 0; i < *nplanes; i++) |
534 | if (sizes[i] < format->plane_fmt[i].sizeimage) | 534 | if (sizes[i] < format->plane_fmt[i].sizeimage) |
535 | return -EINVAL; | 535 | return -EINVAL; |
536 | } | ||
537 | return 0; | 536 | return 0; |
538 | } | 537 | } |
539 | 538 | ||
@@ -979,7 +978,6 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1, | |||
979 | 978 | ||
980 | video_set_drvdata(&video->video, video); | 979 | video_set_drvdata(&video->video, video); |
981 | 980 | ||
982 | /* ... and the buffers queue... */ | ||
983 | video->queue.type = video->type; | 981 | video->queue.type = video->type; |
984 | video->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; | 982 | video->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; |
985 | video->queue.lock = &video->lock; | 983 | video->queue.lock = &video->lock; |
diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index 3838e11fc15f..7ae1a134b1ff 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c | |||
@@ -318,7 +318,7 @@ static void xvip_dma_complete(void *param) | |||
318 | static int | 318 | static int |
319 | xvip_dma_queue_setup(struct vb2_queue *vq, | 319 | xvip_dma_queue_setup(struct vb2_queue *vq, |
320 | unsigned int *nbuffers, unsigned int *nplanes, | 320 | unsigned int *nbuffers, unsigned int *nplanes, |
321 | unsigned int sizes[], void *alloc_ctxs[]) | 321 | unsigned int sizes[], struct device *alloc_devs[]) |
322 | { | 322 | { |
323 | struct xvip_dma *dma = vb2_get_drv_priv(vq); | 323 | struct xvip_dma *dma = vb2_get_drv_priv(vq); |
324 | 324 | ||
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c index 87c12930416f..d807d5875f7e 100644 --- a/drivers/media/usb/airspy/airspy.c +++ b/drivers/media/usb/airspy/airspy.c | |||
@@ -488,7 +488,7 @@ static void airspy_disconnect(struct usb_interface *intf) | |||
488 | /* Videobuf2 operations */ | 488 | /* Videobuf2 operations */ |
489 | static int airspy_queue_setup(struct vb2_queue *vq, | 489 | static int airspy_queue_setup(struct vb2_queue *vq, |
490 | unsigned int *nbuffers, | 490 | unsigned int *nbuffers, |
491 | unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) | 491 | unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[]) |
492 | { | 492 | { |
493 | struct airspy *s = vb2_get_drv_priv(vq); | 493 | struct airspy *s = vb2_get_drv_priv(vq); |
494 | 494 | ||
diff --git a/drivers/media/usb/au0828/au0828-vbi.c b/drivers/media/usb/au0828/au0828-vbi.c index b4efc103ae57..e0930ce59b8d 100644 --- a/drivers/media/usb/au0828/au0828-vbi.c +++ b/drivers/media/usb/au0828/au0828-vbi.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static int vbi_queue_setup(struct vb2_queue *vq, | 33 | static int vbi_queue_setup(struct vb2_queue *vq, |
34 | unsigned int *nbuffers, unsigned int *nplanes, | 34 | unsigned int *nbuffers, unsigned int *nplanes, |
35 | unsigned int sizes[], void *alloc_ctxs[]) | 35 | unsigned int sizes[], struct device *alloc_devs[]) |
36 | { | 36 | { |
37 | struct au0828_dev *dev = vb2_get_drv_priv(vq); | 37 | struct au0828_dev *dev = vb2_get_drv_priv(vq); |
38 | unsigned long size = dev->vbi_width * dev->vbi_height * 2; | 38 | unsigned long size = dev->vbi_width * dev->vbi_height * 2; |
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 7d0ec4cb248c..82b026985868 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c | |||
@@ -698,7 +698,7 @@ int au0828_v4l2_device_register(struct usb_interface *interface, | |||
698 | 698 | ||
699 | static int queue_setup(struct vb2_queue *vq, | 699 | static int queue_setup(struct vb2_queue *vq, |
700 | unsigned int *nbuffers, unsigned int *nplanes, | 700 | unsigned int *nbuffers, unsigned int *nplanes, |
701 | unsigned int sizes[], void *alloc_ctxs[]) | 701 | unsigned int sizes[], struct device *alloc_devs[]) |
702 | { | 702 | { |
703 | struct au0828_dev *dev = vb2_get_drv_priv(vq); | 703 | struct au0828_dev *dev = vb2_get_drv_priv(vq); |
704 | unsigned long size = dev->height * dev->bytesperline; | 704 | unsigned long size = dev->height * dev->bytesperline; |
diff --git a/drivers/media/usb/em28xx/em28xx-vbi.c b/drivers/media/usb/em28xx/em28xx-vbi.c index fe94c9225dd7..836c6b53b16c 100644 --- a/drivers/media/usb/em28xx/em28xx-vbi.c +++ b/drivers/media/usb/em28xx/em28xx-vbi.c | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | static int vbi_queue_setup(struct vb2_queue *vq, | 34 | static int vbi_queue_setup(struct vb2_queue *vq, |
35 | unsigned int *nbuffers, unsigned int *nplanes, | 35 | unsigned int *nbuffers, unsigned int *nplanes, |
36 | unsigned int sizes[], void *alloc_ctxs[]) | 36 | unsigned int sizes[], struct device *alloc_devs[]) |
37 | { | 37 | { |
38 | struct em28xx *dev = vb2_get_drv_priv(vq); | 38 | struct em28xx *dev = vb2_get_drv_priv(vq); |
39 | struct em28xx_v4l2 *v4l2 = dev->v4l2; | 39 | struct em28xx_v4l2 *v4l2 = dev->v4l2; |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 44834b2eff55..7968695217f3 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -1013,7 +1013,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) | |||
1013 | 1013 | ||
1014 | static int queue_setup(struct vb2_queue *vq, | 1014 | static int queue_setup(struct vb2_queue *vq, |
1015 | unsigned int *nbuffers, unsigned int *nplanes, | 1015 | unsigned int *nbuffers, unsigned int *nplanes, |
1016 | unsigned int sizes[], void *alloc_ctxs[]) | 1016 | unsigned int sizes[], struct device *alloc_devs[]) |
1017 | { | 1017 | { |
1018 | struct em28xx *dev = vb2_get_drv_priv(vq); | 1018 | struct em28xx *dev = vb2_get_drv_priv(vq); |
1019 | struct em28xx_v4l2 *v4l2 = dev->v4l2; | 1019 | struct em28xx_v4l2 *v4l2 = dev->v4l2; |
diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c index ea01ee5df60a..af8458996d91 100644 --- a/drivers/media/usb/go7007/go7007-v4l2.c +++ b/drivers/media/usb/go7007/go7007-v4l2.c | |||
@@ -370,7 +370,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | |||
370 | 370 | ||
371 | static int go7007_queue_setup(struct vb2_queue *q, | 371 | static int go7007_queue_setup(struct vb2_queue *q, |
372 | unsigned int *num_buffers, unsigned int *num_planes, | 372 | unsigned int *num_buffers, unsigned int *num_planes, |
373 | unsigned int sizes[], void *alloc_ctxs[]) | 373 | unsigned int sizes[], struct device *alloc_devs[]) |
374 | { | 374 | { |
375 | sizes[0] = GO7007_BUF_SIZE; | 375 | sizes[0] = GO7007_BUF_SIZE; |
376 | *num_planes = 1; | 376 | *num_planes = 1; |
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c index 9e700caf0d66..b1e229a44192 100644 --- a/drivers/media/usb/hackrf/hackrf.c +++ b/drivers/media/usb/hackrf/hackrf.c | |||
@@ -760,7 +760,7 @@ static void hackrf_return_all_buffers(struct vb2_queue *vq, | |||
760 | 760 | ||
761 | static int hackrf_queue_setup(struct vb2_queue *vq, | 761 | static int hackrf_queue_setup(struct vb2_queue *vq, |
762 | unsigned int *nbuffers, | 762 | unsigned int *nbuffers, |
763 | unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) | 763 | unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[]) |
764 | { | 764 | { |
765 | struct hackrf_dev *dev = vb2_get_drv_priv(vq); | 765 | struct hackrf_dev *dev = vb2_get_drv_priv(vq); |
766 | 766 | ||
diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 2d33033682af..e7f167d44c61 100644 --- a/drivers/media/usb/msi2500/msi2500.c +++ b/drivers/media/usb/msi2500/msi2500.c | |||
@@ -618,7 +618,7 @@ static int msi2500_querycap(struct file *file, void *fh, | |||
618 | static int msi2500_queue_setup(struct vb2_queue *vq, | 618 | static int msi2500_queue_setup(struct vb2_queue *vq, |
619 | unsigned int *nbuffers, | 619 | unsigned int *nbuffers, |
620 | unsigned int *nplanes, unsigned int sizes[], | 620 | unsigned int *nplanes, unsigned int sizes[], |
621 | void *alloc_ctxs[]) | 621 | struct device *alloc_devs[]) |
622 | { | 622 | { |
623 | struct msi2500_dev *dev = vb2_get_drv_priv(vq); | 623 | struct msi2500_dev *dev = vb2_get_drv_priv(vq); |
624 | 624 | ||
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index 18aed5dd325e..dd43652fdef8 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c | |||
@@ -573,7 +573,7 @@ static void pwc_video_release(struct v4l2_device *v) | |||
573 | 573 | ||
574 | static int queue_setup(struct vb2_queue *vq, | 574 | static int queue_setup(struct vb2_queue *vq, |
575 | unsigned int *nbuffers, unsigned int *nplanes, | 575 | unsigned int *nbuffers, unsigned int *nplanes, |
576 | unsigned int sizes[], void *alloc_ctxs[]) | 576 | unsigned int sizes[], struct device *alloc_devs[]) |
577 | { | 577 | { |
578 | struct pwc_device *pdev = vb2_get_drv_priv(vq); | 578 | struct pwc_device *pdev = vb2_get_drv_priv(vq); |
579 | int size; | 579 | int size; |
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 9acdaa3716fb..43ba71a7d02b 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c | |||
@@ -662,7 +662,7 @@ static void s2255_fillbuff(struct s2255_vc *vc, | |||
662 | 662 | ||
663 | static int queue_setup(struct vb2_queue *vq, | 663 | static int queue_setup(struct vb2_queue *vq, |
664 | unsigned int *nbuffers, unsigned int *nplanes, | 664 | unsigned int *nbuffers, unsigned int *nplanes, |
665 | unsigned int sizes[], void *alloc_ctxs[]) | 665 | unsigned int sizes[], struct device *alloc_devs[]) |
666 | { | 666 | { |
667 | struct s2255_vc *vc = vb2_get_drv_priv(vq); | 667 | struct s2255_vc *vc = vb2_get_drv_priv(vq); |
668 | if (*nbuffers < S2255_MIN_BUFS) | 668 | if (*nbuffers < S2255_MIN_BUFS) |
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index 7ddbc0274f12..5fab3bee8c74 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c | |||
@@ -666,7 +666,7 @@ static const struct v4l2_ioctl_ops stk1160_ioctl_ops = { | |||
666 | */ | 666 | */ |
667 | static int queue_setup(struct vb2_queue *vq, | 667 | static int queue_setup(struct vb2_queue *vq, |
668 | unsigned int *nbuffers, unsigned int *nplanes, | 668 | unsigned int *nbuffers, unsigned int *nplanes, |
669 | unsigned int sizes[], void *alloc_ctxs[]) | 669 | unsigned int sizes[], struct device *alloc_devs[]) |
670 | { | 670 | { |
671 | struct stk1160 *dev = vb2_get_drv_priv(vq); | 671 | struct stk1160 *dev = vb2_get_drv_priv(vq); |
672 | unsigned long size; | 672 | unsigned long size; |
diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c index f6cfad46547e..7e282048f932 100644 --- a/drivers/media/usb/usbtv/usbtv-video.c +++ b/drivers/media/usb/usbtv/usbtv-video.c | |||
@@ -608,7 +608,7 @@ static struct v4l2_file_operations usbtv_fops = { | |||
608 | 608 | ||
609 | static int usbtv_queue_setup(struct vb2_queue *vq, | 609 | static int usbtv_queue_setup(struct vb2_queue *vq, |
610 | unsigned int *nbuffers, | 610 | unsigned int *nbuffers, |
611 | unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) | 611 | unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[]) |
612 | { | 612 | { |
613 | struct usbtv *usbtv = vb2_get_drv_priv(vq); | 613 | struct usbtv *usbtv = vb2_get_drv_priv(vq); |
614 | unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32); | 614 | unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32); |
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index 54394722756f..773fefb52d7a 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c | |||
@@ -71,7 +71,7 @@ static void uvc_queue_return_buffers(struct uvc_video_queue *queue, | |||
71 | 71 | ||
72 | static int uvc_queue_setup(struct vb2_queue *vq, | 72 | static int uvc_queue_setup(struct vb2_queue *vq, |
73 | unsigned int *nbuffers, unsigned int *nplanes, | 73 | unsigned int *nbuffers, unsigned int *nplanes, |
74 | unsigned int sizes[], void *alloc_ctxs[]) | 74 | unsigned int sizes[], struct device *alloc_devs[]) |
75 | { | 75 | { |
76 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); | 76 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); |
77 | struct uvc_streaming *stream = uvc_queue_to_stream(queue); | 77 | struct uvc_streaming *stream = uvc_queue_to_stream(queue); |
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index aabb03e406f0..0b9e71e48ddb 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c | |||
@@ -207,7 +207,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) | |||
207 | unsigned long size = PAGE_ALIGN(vb->planes[plane].length); | 207 | unsigned long size = PAGE_ALIGN(vb->planes[plane].length); |
208 | 208 | ||
209 | mem_priv = call_ptr_memop(vb, alloc, | 209 | mem_priv = call_ptr_memop(vb, alloc, |
210 | q->alloc_ctx[plane] ? : &q->dev, | 210 | q->alloc_devs[plane] ? : q->dev, |
211 | q->dma_attrs, size, dma_dir, q->gfp_flags); | 211 | q->dma_attrs, size, dma_dir, q->gfp_flags); |
212 | if (IS_ERR_OR_NULL(mem_priv)) | 212 | if (IS_ERR_OR_NULL(mem_priv)) |
213 | goto free; | 213 | goto free; |
@@ -738,7 +738,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, | |||
738 | */ | 738 | */ |
739 | num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME); | 739 | num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME); |
740 | num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); | 740 | num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); |
741 | memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); | 741 | memset(q->alloc_devs, 0, sizeof(q->alloc_devs)); |
742 | q->memory = memory; | 742 | q->memory = memory; |
743 | 743 | ||
744 | /* | 744 | /* |
@@ -746,7 +746,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, | |||
746 | * Driver also sets the size and allocator context for each plane. | 746 | * Driver also sets the size and allocator context for each plane. |
747 | */ | 747 | */ |
748 | ret = call_qop(q, queue_setup, q, &num_buffers, &num_planes, | 748 | ret = call_qop(q, queue_setup, q, &num_buffers, &num_planes, |
749 | plane_sizes, q->alloc_ctx); | 749 | plane_sizes, q->alloc_devs); |
750 | if (ret) | 750 | if (ret) |
751 | return ret; | 751 | return ret; |
752 | 752 | ||
@@ -779,7 +779,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, | |||
779 | num_planes = 0; | 779 | num_planes = 0; |
780 | 780 | ||
781 | ret = call_qop(q, queue_setup, q, &num_buffers, | 781 | ret = call_qop(q, queue_setup, q, &num_buffers, |
782 | &num_planes, plane_sizes, q->alloc_ctx); | 782 | &num_planes, plane_sizes, q->alloc_devs); |
783 | 783 | ||
784 | if (!ret && allocated_buffers < num_buffers) | 784 | if (!ret && allocated_buffers < num_buffers) |
785 | ret = -ENOMEM; | 785 | ret = -ENOMEM; |
@@ -845,7 +845,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, | |||
845 | } | 845 | } |
846 | 846 | ||
847 | if (!q->num_buffers) { | 847 | if (!q->num_buffers) { |
848 | memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); | 848 | memset(q->alloc_devs, 0, sizeof(q->alloc_devs)); |
849 | q->memory = memory; | 849 | q->memory = memory; |
850 | q->waiting_for_buffers = !q->is_output; | 850 | q->waiting_for_buffers = !q->is_output; |
851 | } | 851 | } |
@@ -862,7 +862,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, | |||
862 | * buffer and their sizes are acceptable | 862 | * buffer and their sizes are acceptable |
863 | */ | 863 | */ |
864 | ret = call_qop(q, queue_setup, q, &num_buffers, | 864 | ret = call_qop(q, queue_setup, q, &num_buffers, |
865 | &num_planes, plane_sizes, q->alloc_ctx); | 865 | &num_planes, plane_sizes, q->alloc_devs); |
866 | if (ret) | 866 | if (ret) |
867 | return ret; | 867 | return ret; |
868 | 868 | ||
@@ -885,7 +885,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, | |||
885 | * queue driver has set up | 885 | * queue driver has set up |
886 | */ | 886 | */ |
887 | ret = call_qop(q, queue_setup, q, &num_buffers, | 887 | ret = call_qop(q, queue_setup, q, &num_buffers, |
888 | &num_planes, plane_sizes, q->alloc_ctx); | 888 | &num_planes, plane_sizes, q->alloc_devs); |
889 | 889 | ||
890 | if (!ret && allocated_buffers < num_buffers) | 890 | if (!ret && allocated_buffers < num_buffers) |
891 | ret = -ENOMEM; | 891 | ret = -ENOMEM; |
@@ -1133,7 +1133,7 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb) | |||
1133 | 1133 | ||
1134 | /* Acquire each plane's memory */ | 1134 | /* Acquire each plane's memory */ |
1135 | mem_priv = call_ptr_memop(vb, get_userptr, | 1135 | mem_priv = call_ptr_memop(vb, get_userptr, |
1136 | q->alloc_ctx[plane] ? : &q->dev, | 1136 | q->alloc_devs[plane] ? : q->dev, |
1137 | planes[plane].m.userptr, | 1137 | planes[plane].m.userptr, |
1138 | planes[plane].length, dma_dir); | 1138 | planes[plane].length, dma_dir); |
1139 | if (IS_ERR_OR_NULL(mem_priv)) { | 1139 | if (IS_ERR_OR_NULL(mem_priv)) { |
@@ -1258,7 +1258,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) | |||
1258 | 1258 | ||
1259 | /* Acquire each plane's memory */ | 1259 | /* Acquire each plane's memory */ |
1260 | mem_priv = call_ptr_memop(vb, attach_dmabuf, | 1260 | mem_priv = call_ptr_memop(vb, attach_dmabuf, |
1261 | q->alloc_ctx[plane] ? : &q->dev, | 1261 | q->alloc_devs[plane] ? : q->dev, |
1262 | dbuf, planes[plane].length, dma_dir); | 1262 | dbuf, planes[plane].length, dma_dir); |
1263 | if (IS_ERR(mem_priv)) { | 1263 | if (IS_ERR(mem_priv)) { |
1264 | dprintk(1, "failed to attach dmabuf\n"); | 1264 | dprintk(1, "failed to attach dmabuf\n"); |
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index a7825c62ad88..863f658a3fa1 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c | |||
@@ -21,10 +21,6 @@ | |||
21 | #include <media/videobuf2-dma-contig.h> | 21 | #include <media/videobuf2-dma-contig.h> |
22 | #include <media/videobuf2-memops.h> | 22 | #include <media/videobuf2-memops.h> |
23 | 23 | ||
24 | struct vb2_dc_conf { | ||
25 | struct device *dev; | ||
26 | }; | ||
27 | |||
28 | struct vb2_dc_buf { | 24 | struct vb2_dc_buf { |
29 | struct device *dev; | 25 | struct device *dev; |
30 | void *vaddr; | 26 | void *vaddr; |
@@ -139,12 +135,10 @@ static void vb2_dc_put(void *buf_priv) | |||
139 | kfree(buf); | 135 | kfree(buf); |
140 | } | 136 | } |
141 | 137 | ||
142 | static void *vb2_dc_alloc(void *alloc_ctx, const struct dma_attrs *attrs, | 138 | static void *vb2_dc_alloc(struct device *dev, const struct dma_attrs *attrs, |
143 | unsigned long size, enum dma_data_direction dma_dir, | 139 | unsigned long size, enum dma_data_direction dma_dir, |
144 | gfp_t gfp_flags) | 140 | gfp_t gfp_flags) |
145 | { | 141 | { |
146 | struct vb2_dc_conf *conf = alloc_ctx; | ||
147 | struct device *dev = conf->dev; | ||
148 | struct vb2_dc_buf *buf; | 142 | struct vb2_dc_buf *buf; |
149 | 143 | ||
150 | buf = kzalloc(sizeof *buf, GFP_KERNEL); | 144 | buf = kzalloc(sizeof *buf, GFP_KERNEL); |
@@ -479,10 +473,9 @@ static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn | |||
479 | } | 473 | } |
480 | #endif | 474 | #endif |
481 | 475 | ||
482 | static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, | 476 | static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, |
483 | unsigned long size, enum dma_data_direction dma_dir) | 477 | unsigned long size, enum dma_data_direction dma_dir) |
484 | { | 478 | { |
485 | struct vb2_dc_conf *conf = alloc_ctx; | ||
486 | struct vb2_dc_buf *buf; | 479 | struct vb2_dc_buf *buf; |
487 | struct frame_vector *vec; | 480 | struct frame_vector *vec; |
488 | unsigned long offset; | 481 | unsigned long offset; |
@@ -510,7 +503,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, | |||
510 | if (!buf) | 503 | if (!buf) |
511 | return ERR_PTR(-ENOMEM); | 504 | return ERR_PTR(-ENOMEM); |
512 | 505 | ||
513 | buf->dev = conf->dev; | 506 | buf->dev = dev; |
514 | buf->dma_dir = dma_dir; | 507 | buf->dma_dir = dma_dir; |
515 | 508 | ||
516 | offset = vaddr & ~PAGE_MASK; | 509 | offset = vaddr & ~PAGE_MASK; |
@@ -677,10 +670,9 @@ static void vb2_dc_detach_dmabuf(void *mem_priv) | |||
677 | kfree(buf); | 670 | kfree(buf); |
678 | } | 671 | } |
679 | 672 | ||
680 | static void *vb2_dc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf, | 673 | static void *vb2_dc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf, |
681 | unsigned long size, enum dma_data_direction dma_dir) | 674 | unsigned long size, enum dma_data_direction dma_dir) |
682 | { | 675 | { |
683 | struct vb2_dc_conf *conf = alloc_ctx; | ||
684 | struct vb2_dc_buf *buf; | 676 | struct vb2_dc_buf *buf; |
685 | struct dma_buf_attachment *dba; | 677 | struct dma_buf_attachment *dba; |
686 | 678 | ||
@@ -691,7 +683,7 @@ static void *vb2_dc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf, | |||
691 | if (!buf) | 683 | if (!buf) |
692 | return ERR_PTR(-ENOMEM); | 684 | return ERR_PTR(-ENOMEM); |
693 | 685 | ||
694 | buf->dev = conf->dev; | 686 | buf->dev = dev; |
695 | /* create attachment for the dmabuf with the user device */ | 687 | /* create attachment for the dmabuf with the user device */ |
696 | dba = dma_buf_attach(dbuf, buf->dev); | 688 | dba = dma_buf_attach(dbuf, buf->dev); |
697 | if (IS_ERR(dba)) { | 689 | if (IS_ERR(dba)) { |
@@ -730,27 +722,6 @@ const struct vb2_mem_ops vb2_dma_contig_memops = { | |||
730 | }; | 722 | }; |
731 | EXPORT_SYMBOL_GPL(vb2_dma_contig_memops); | 723 | EXPORT_SYMBOL_GPL(vb2_dma_contig_memops); |
732 | 724 | ||
733 | void *vb2_dma_contig_init_ctx(struct device *dev) | ||
734 | { | ||
735 | struct vb2_dc_conf *conf; | ||
736 | |||
737 | conf = kzalloc(sizeof *conf, GFP_KERNEL); | ||
738 | if (!conf) | ||
739 | return ERR_PTR(-ENOMEM); | ||
740 | |||
741 | conf->dev = dev; | ||
742 | |||
743 | return conf; | ||
744 | } | ||
745 | EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx); | ||
746 | |||
747 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx) | ||
748 | { | ||
749 | if (!IS_ERR_OR_NULL(alloc_ctx)) | ||
750 | kfree(alloc_ctx); | ||
751 | } | ||
752 | EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx); | ||
753 | |||
754 | /** | 725 | /** |
755 | * vb2_dma_contig_set_max_seg_size() - configure DMA max segment size | 726 | * vb2_dma_contig_set_max_seg_size() - configure DMA max segment size |
756 | * @dev: device for configuring DMA parameters | 727 | * @dev: device for configuring DMA parameters |
diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index e7153f708ade..a39db8a6db7a 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c | |||
@@ -30,10 +30,6 @@ module_param(debug, int, 0644); | |||
30 | printk(KERN_DEBUG "vb2-dma-sg: " fmt, ## arg); \ | 30 | printk(KERN_DEBUG "vb2-dma-sg: " fmt, ## arg); \ |
31 | } while (0) | 31 | } while (0) |
32 | 32 | ||
33 | struct vb2_dma_sg_conf { | ||
34 | struct device *dev; | ||
35 | }; | ||
36 | |||
37 | struct vb2_dma_sg_buf { | 33 | struct vb2_dma_sg_buf { |
38 | struct device *dev; | 34 | struct device *dev; |
39 | void *vaddr; | 35 | void *vaddr; |
@@ -99,11 +95,10 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, | |||
99 | return 0; | 95 | return 0; |
100 | } | 96 | } |
101 | 97 | ||
102 | static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs, | 98 | static void *vb2_dma_sg_alloc(struct device *dev, const struct dma_attrs *dma_attrs, |
103 | unsigned long size, enum dma_data_direction dma_dir, | 99 | unsigned long size, enum dma_data_direction dma_dir, |
104 | gfp_t gfp_flags) | 100 | gfp_t gfp_flags) |
105 | { | 101 | { |
106 | struct vb2_dma_sg_conf *conf = alloc_ctx; | ||
107 | struct vb2_dma_sg_buf *buf; | 102 | struct vb2_dma_sg_buf *buf; |
108 | struct sg_table *sgt; | 103 | struct sg_table *sgt; |
109 | int ret; | 104 | int ret; |
@@ -112,7 +107,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs | |||
112 | 107 | ||
113 | dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); | 108 | dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs); |
114 | 109 | ||
115 | if (WARN_ON(alloc_ctx == NULL)) | 110 | if (WARN_ON(dev == NULL)) |
116 | return NULL; | 111 | return NULL; |
117 | buf = kzalloc(sizeof *buf, GFP_KERNEL); | 112 | buf = kzalloc(sizeof *buf, GFP_KERNEL); |
118 | if (!buf) | 113 | if (!buf) |
@@ -141,7 +136,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs | |||
141 | goto fail_table_alloc; | 136 | goto fail_table_alloc; |
142 | 137 | ||
143 | /* Prevent the device from being released while the buffer is used */ | 138 | /* Prevent the device from being released while the buffer is used */ |
144 | buf->dev = get_device(conf->dev); | 139 | buf->dev = get_device(dev); |
145 | 140 | ||
146 | sgt = &buf->sg_table; | 141 | sgt = &buf->sg_table; |
147 | /* | 142 | /* |
@@ -227,11 +222,10 @@ static void vb2_dma_sg_finish(void *buf_priv) | |||
227 | dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); | 222 | dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); |
228 | } | 223 | } |
229 | 224 | ||
230 | static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr, | 225 | static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, |
231 | unsigned long size, | 226 | unsigned long size, |
232 | enum dma_data_direction dma_dir) | 227 | enum dma_data_direction dma_dir) |
233 | { | 228 | { |
234 | struct vb2_dma_sg_conf *conf = alloc_ctx; | ||
235 | struct vb2_dma_sg_buf *buf; | 229 | struct vb2_dma_sg_buf *buf; |
236 | struct sg_table *sgt; | 230 | struct sg_table *sgt; |
237 | DEFINE_DMA_ATTRS(attrs); | 231 | DEFINE_DMA_ATTRS(attrs); |
@@ -243,7 +237,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr, | |||
243 | return NULL; | 237 | return NULL; |
244 | 238 | ||
245 | buf->vaddr = NULL; | 239 | buf->vaddr = NULL; |
246 | buf->dev = conf->dev; | 240 | buf->dev = dev; |
247 | buf->dma_dir = dma_dir; | 241 | buf->dma_dir = dma_dir; |
248 | buf->offset = vaddr & ~PAGE_MASK; | 242 | buf->offset = vaddr & ~PAGE_MASK; |
249 | buf->size = size; | 243 | buf->size = size; |
@@ -617,10 +611,9 @@ static void vb2_dma_sg_detach_dmabuf(void *mem_priv) | |||
617 | kfree(buf); | 611 | kfree(buf); |
618 | } | 612 | } |
619 | 613 | ||
620 | static void *vb2_dma_sg_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf, | 614 | static void *vb2_dma_sg_attach_dmabuf(struct device *dev, struct dma_buf *dbuf, |
621 | unsigned long size, enum dma_data_direction dma_dir) | 615 | unsigned long size, enum dma_data_direction dma_dir) |
622 | { | 616 | { |
623 | struct vb2_dma_sg_conf *conf = alloc_ctx; | ||
624 | struct vb2_dma_sg_buf *buf; | 617 | struct vb2_dma_sg_buf *buf; |
625 | struct dma_buf_attachment *dba; | 618 | struct dma_buf_attachment *dba; |
626 | 619 | ||
@@ -631,7 +624,7 @@ static void *vb2_dma_sg_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf, | |||
631 | if (!buf) | 624 | if (!buf) |
632 | return ERR_PTR(-ENOMEM); | 625 | return ERR_PTR(-ENOMEM); |
633 | 626 | ||
634 | buf->dev = conf->dev; | 627 | buf->dev = dev; |
635 | /* create attachment for the dmabuf with the user device */ | 628 | /* create attachment for the dmabuf with the user device */ |
636 | dba = dma_buf_attach(dbuf, buf->dev); | 629 | dba = dma_buf_attach(dbuf, buf->dev); |
637 | if (IS_ERR(dba)) { | 630 | if (IS_ERR(dba)) { |
@@ -673,27 +666,6 @@ const struct vb2_mem_ops vb2_dma_sg_memops = { | |||
673 | }; | 666 | }; |
674 | EXPORT_SYMBOL_GPL(vb2_dma_sg_memops); | 667 | EXPORT_SYMBOL_GPL(vb2_dma_sg_memops); |
675 | 668 | ||
676 | void *vb2_dma_sg_init_ctx(struct device *dev) | ||
677 | { | ||
678 | struct vb2_dma_sg_conf *conf; | ||
679 | |||
680 | conf = kzalloc(sizeof(*conf), GFP_KERNEL); | ||
681 | if (!conf) | ||
682 | return ERR_PTR(-ENOMEM); | ||
683 | |||
684 | conf->dev = dev; | ||
685 | |||
686 | return conf; | ||
687 | } | ||
688 | EXPORT_SYMBOL_GPL(vb2_dma_sg_init_ctx); | ||
689 | |||
690 | void vb2_dma_sg_cleanup_ctx(void *alloc_ctx) | ||
691 | { | ||
692 | if (!IS_ERR_OR_NULL(alloc_ctx)) | ||
693 | kfree(alloc_ctx); | ||
694 | } | ||
695 | EXPORT_SYMBOL_GPL(vb2_dma_sg_cleanup_ctx); | ||
696 | |||
697 | MODULE_DESCRIPTION("dma scatter/gather memory handling routines for videobuf2"); | 669 | MODULE_DESCRIPTION("dma scatter/gather memory handling routines for videobuf2"); |
698 | MODULE_AUTHOR("Andrzej Pietrasiewicz"); | 670 | MODULE_AUTHOR("Andrzej Pietrasiewicz"); |
699 | MODULE_LICENSE("GPL"); | 671 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index fb94c80e9aa8..7e8a07ed8d82 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c | |||
@@ -33,7 +33,7 @@ struct vb2_vmalloc_buf { | |||
33 | 33 | ||
34 | static void vb2_vmalloc_put(void *buf_priv); | 34 | static void vb2_vmalloc_put(void *buf_priv); |
35 | 35 | ||
36 | static void *vb2_vmalloc_alloc(void *alloc_ctx, const struct dma_attrs *attrs, | 36 | static void *vb2_vmalloc_alloc(struct device *dev, const struct dma_attrs *attrs, |
37 | unsigned long size, enum dma_data_direction dma_dir, | 37 | unsigned long size, enum dma_data_direction dma_dir, |
38 | gfp_t gfp_flags) | 38 | gfp_t gfp_flags) |
39 | { | 39 | { |
@@ -70,7 +70,7 @@ static void vb2_vmalloc_put(void *buf_priv) | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | static void *vb2_vmalloc_get_userptr(void *alloc_ctx, unsigned long vaddr, | 73 | static void *vb2_vmalloc_get_userptr(struct device *dev, unsigned long vaddr, |
74 | unsigned long size, | 74 | unsigned long size, |
75 | enum dma_data_direction dma_dir) | 75 | enum dma_data_direction dma_dir) |
76 | { | 76 | { |
@@ -404,7 +404,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv) | |||
404 | kfree(buf); | 404 | kfree(buf); |
405 | } | 405 | } |
406 | 406 | ||
407 | static void *vb2_vmalloc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf, | 407 | static void *vb2_vmalloc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf, |
408 | unsigned long size, enum dma_data_direction dma_dir) | 408 | unsigned long size, enum dma_data_direction dma_dir) |
409 | { | 409 | { |
410 | struct vb2_vmalloc_buf *buf; | 410 | struct vb2_vmalloc_buf *buf; |
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index 77e66e75ffce..3319fb8f7d01 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c | |||
@@ -1091,7 +1091,7 @@ vpfe_g_dv_timings(struct file *file, void *fh, | |||
1091 | * @nbuffers: ptr to number of buffers requested by application | 1091 | * @nbuffers: ptr to number of buffers requested by application |
1092 | * @nplanes:: contains number of distinct video planes needed to hold a frame | 1092 | * @nplanes:: contains number of distinct video planes needed to hold a frame |
1093 | * @sizes[]: contains the size (in bytes) of each plane. | 1093 | * @sizes[]: contains the size (in bytes) of each plane. |
1094 | * @alloc_ctxs: ptr to allocation context | 1094 | * @alloc_devs: ptr to allocation context |
1095 | * | 1095 | * |
1096 | * This callback function is called when reqbuf() is called to adjust | 1096 | * This callback function is called when reqbuf() is called to adjust |
1097 | * the buffer nbuffers and buffer size | 1097 | * the buffer nbuffers and buffer size |
@@ -1099,7 +1099,7 @@ vpfe_g_dv_timings(struct file *file, void *fh, | |||
1099 | static int | 1099 | static int |
1100 | vpfe_buffer_queue_setup(struct vb2_queue *vq, | 1100 | vpfe_buffer_queue_setup(struct vb2_queue *vq, |
1101 | unsigned int *nbuffers, unsigned int *nplanes, | 1101 | unsigned int *nbuffers, unsigned int *nplanes, |
1102 | unsigned int sizes[], void *alloc_ctxs[]) | 1102 | unsigned int sizes[], struct device *alloc_devs[]) |
1103 | { | 1103 | { |
1104 | struct vpfe_fh *fh = vb2_get_drv_priv(vq); | 1104 | struct vpfe_fh *fh = vb2_get_drv_priv(vq); |
1105 | struct vpfe_video_device *video = fh->video; | 1105 | struct vpfe_video_device *video = fh->video; |
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index 3c077e378267..90b7ff56722d 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c | |||
@@ -298,7 +298,7 @@ iss_video_check_format(struct iss_video *video, struct iss_video_fh *vfh) | |||
298 | 298 | ||
299 | static int iss_video_queue_setup(struct vb2_queue *vq, | 299 | static int iss_video_queue_setup(struct vb2_queue *vq, |
300 | unsigned int *count, unsigned int *num_planes, | 300 | unsigned int *count, unsigned int *num_planes, |
301 | unsigned int sizes[], void *alloc_ctxs[]) | 301 | unsigned int sizes[], struct device *alloc_devs[]) |
302 | { | 302 | { |
303 | struct iss_video_fh *vfh = vb2_get_drv_priv(vq); | 303 | struct iss_video_fh *vfh = vb2_get_drv_priv(vq); |
304 | struct iss_video *video = vfh->video; | 304 | struct iss_video *video = vfh->video; |
diff --git a/drivers/staging/media/tw686x-kh/tw686x-kh-video.c b/drivers/staging/media/tw686x-kh/tw686x-kh-video.c index 4e2ef9decbe2..9bf32aec2fc6 100644 --- a/drivers/staging/media/tw686x-kh/tw686x-kh-video.c +++ b/drivers/staging/media/tw686x-kh/tw686x-kh-video.c | |||
@@ -130,7 +130,7 @@ static void tw686x_get_format(struct tw686x_video_channel *vc, | |||
130 | 130 | ||
131 | static int tw686x_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, | 131 | static int tw686x_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, |
132 | unsigned int *nplanes, unsigned int sizes[], | 132 | unsigned int *nplanes, unsigned int sizes[], |
133 | void *alloc_ctxs[]) | 133 | struct device *alloc_devs[]) |
134 | { | 134 | { |
135 | struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); | 135 | struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); |
136 | unsigned int size = vc->width * vc->height * vc->format->depth / 8; | 136 | unsigned int size = vc->width * vc->height * vc->format->depth / 8; |
diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c index 912694f3d54e..6377e9fee6e5 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | static int uvc_queue_setup(struct vb2_queue *vq, | 44 | static int uvc_queue_setup(struct vb2_queue *vq, |
45 | unsigned int *nbuffers, unsigned int *nplanes, | 45 | unsigned int *nbuffers, unsigned int *nplanes, |
46 | unsigned int sizes[], void *alloc_ctxs[]) | 46 | unsigned int sizes[], struct device *alloc_devs[]) |
47 | { | 47 | { |
48 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); | 48 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); |
49 | struct uvc_video *video = container_of(queue, struct uvc_video, queue); | 49 | struct uvc_video *video = container_of(queue, struct uvc_video, queue); |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index d38668c2ea06..bea81c9e3758 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -56,7 +56,7 @@ struct vb2_threadio_data; | |||
56 | * @put_userptr: inform the allocator that a USERPTR buffer will no longer | 56 | * @put_userptr: inform the allocator that a USERPTR buffer will no longer |
57 | * be used. | 57 | * be used. |
58 | * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation; | 58 | * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation; |
59 | * used for DMABUF memory types; alloc_ctx is the alloc context | 59 | * used for DMABUF memory types; dev is the alloc device |
60 | * dbuf is the shared dma_buf; returns NULL on failure; | 60 | * dbuf is the shared dma_buf; returns NULL on failure; |
61 | * allocator private per-buffer structure on success; | 61 | * allocator private per-buffer structure on success; |
62 | * this needs to be used for further accesses to the buffer. | 62 | * this needs to be used for further accesses to the buffer. |
@@ -92,13 +92,13 @@ struct vb2_threadio_data; | |||
92 | * unmap_dmabuf. | 92 | * unmap_dmabuf. |
93 | */ | 93 | */ |
94 | struct vb2_mem_ops { | 94 | struct vb2_mem_ops { |
95 | void *(*alloc)(void *alloc_ctx, const struct dma_attrs *attrs, | 95 | void *(*alloc)(struct device *dev, const struct dma_attrs *attrs, |
96 | unsigned long size, enum dma_data_direction dma_dir, | 96 | unsigned long size, enum dma_data_direction dma_dir, |
97 | gfp_t gfp_flags); | 97 | gfp_t gfp_flags); |
98 | void (*put)(void *buf_priv); | 98 | void (*put)(void *buf_priv); |
99 | struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); | 99 | struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); |
100 | 100 | ||
101 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, | 101 | void *(*get_userptr)(struct device *dev, unsigned long vaddr, |
102 | unsigned long size, | 102 | unsigned long size, |
103 | enum dma_data_direction dma_dir); | 103 | enum dma_data_direction dma_dir); |
104 | void (*put_userptr)(void *buf_priv); | 104 | void (*put_userptr)(void *buf_priv); |
@@ -106,7 +106,7 @@ struct vb2_mem_ops { | |||
106 | void (*prepare)(void *buf_priv); | 106 | void (*prepare)(void *buf_priv); |
107 | void (*finish)(void *buf_priv); | 107 | void (*finish)(void *buf_priv); |
108 | 108 | ||
109 | void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf, | 109 | void *(*attach_dmabuf)(struct device *dev, struct dma_buf *dbuf, |
110 | unsigned long size, | 110 | unsigned long size, |
111 | enum dma_data_direction dma_dir); | 111 | enum dma_data_direction dma_dir); |
112 | void (*detach_dmabuf)(void *buf_priv); | 112 | void (*detach_dmabuf)(void *buf_priv); |
@@ -281,7 +281,7 @@ struct vb2_buffer { | |||
281 | * in *num_buffers, the required number of planes per | 281 | * in *num_buffers, the required number of planes per |
282 | * buffer in *num_planes, the size of each plane should be | 282 | * buffer in *num_planes, the size of each plane should be |
283 | * set in the sizes[] array and optional per-plane | 283 | * set in the sizes[] array and optional per-plane |
284 | * allocator specific context in the alloc_ctxs[] array. | 284 | * allocator specific device in the alloc_devs[] array. |
285 | * When called from VIDIOC_REQBUFS, *num_planes == 0, the | 285 | * When called from VIDIOC_REQBUFS, *num_planes == 0, the |
286 | * driver has to use the currently configured format to | 286 | * driver has to use the currently configured format to |
287 | * determine the plane sizes and *num_buffers is the total | 287 | * determine the plane sizes and *num_buffers is the total |
@@ -355,7 +355,7 @@ struct vb2_buffer { | |||
355 | struct vb2_ops { | 355 | struct vb2_ops { |
356 | int (*queue_setup)(struct vb2_queue *q, | 356 | int (*queue_setup)(struct vb2_queue *q, |
357 | unsigned int *num_buffers, unsigned int *num_planes, | 357 | unsigned int *num_buffers, unsigned int *num_planes, |
358 | unsigned int sizes[], void *alloc_ctxs[]); | 358 | unsigned int sizes[], struct device *alloc_devs[]); |
359 | 359 | ||
360 | void (*wait_prepare)(struct vb2_queue *q); | 360 | void (*wait_prepare)(struct vb2_queue *q); |
361 | void (*wait_finish)(struct vb2_queue *q); | 361 | void (*wait_finish)(struct vb2_queue *q); |
@@ -401,7 +401,7 @@ struct vb2_buf_ops { | |||
401 | * the V4L2_BUF_TYPE_* in include/uapi/linux/videodev2.h | 401 | * the V4L2_BUF_TYPE_* in include/uapi/linux/videodev2.h |
402 | * @io_modes: supported io methods (see vb2_io_modes enum) | 402 | * @io_modes: supported io methods (see vb2_io_modes enum) |
403 | * @dev: device to use for the default allocation context if the driver | 403 | * @dev: device to use for the default allocation context if the driver |
404 | * doesn't fill in the @alloc_ctx array. | 404 | * doesn't fill in the @alloc_devs array. |
405 | * @dma_attrs: DMA attributes to use for the DMA. May be NULL. | 405 | * @dma_attrs: DMA attributes to use for the DMA. May be NULL. |
406 | * @fileio_read_once: report EOF after reading the first buffer | 406 | * @fileio_read_once: report EOF after reading the first buffer |
407 | * @fileio_write_immediately: queue buffer after each write() call | 407 | * @fileio_write_immediately: queue buffer after each write() call |
@@ -449,7 +449,7 @@ struct vb2_buf_ops { | |||
449 | * @done_list: list of buffers ready to be dequeued to userspace | 449 | * @done_list: list of buffers ready to be dequeued to userspace |
450 | * @done_lock: lock to protect done_list list | 450 | * @done_lock: lock to protect done_list list |
451 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued | 451 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued |
452 | * @alloc_ctx: memory type/allocator-specific contexts for each plane | 452 | * @alloc_devs: memory type/allocator-specific per-plane device |
453 | * @streaming: current streaming state | 453 | * @streaming: current streaming state |
454 | * @start_streaming_called: start_streaming() was called successfully and we | 454 | * @start_streaming_called: start_streaming() was called successfully and we |
455 | * started streaming. | 455 | * started streaming. |
@@ -503,7 +503,7 @@ struct vb2_queue { | |||
503 | spinlock_t done_lock; | 503 | spinlock_t done_lock; |
504 | wait_queue_head_t done_wq; | 504 | wait_queue_head_t done_wq; |
505 | 505 | ||
506 | void *alloc_ctx[VB2_MAX_PLANES]; | 506 | struct device *alloc_devs[VB2_MAX_PLANES]; |
507 | 507 | ||
508 | unsigned int streaming:1; | 508 | unsigned int streaming:1; |
509 | unsigned int start_streaming_called:1; | 509 | unsigned int start_streaming_called:1; |
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h index 5bdd4a4072e5..df2aabee3401 100644 --- a/include/media/videobuf2-dma-contig.h +++ b/include/media/videobuf2-dma-contig.h | |||
@@ -26,8 +26,6 @@ vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no) | |||
26 | return *addr; | 26 | return *addr; |
27 | } | 27 | } |
28 | 28 | ||
29 | void *vb2_dma_contig_init_ctx(struct device *dev); | ||
30 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx); | ||
31 | int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size); | 29 | int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size); |
32 | void vb2_dma_contig_clear_max_seg_size(struct device *dev); | 30 | void vb2_dma_contig_clear_max_seg_size(struct device *dev); |
33 | 31 | ||
diff --git a/include/media/videobuf2-dma-sg.h b/include/media/videobuf2-dma-sg.h index 8d1083f83c3d..52afa0e2bb17 100644 --- a/include/media/videobuf2-dma-sg.h +++ b/include/media/videobuf2-dma-sg.h | |||
@@ -21,9 +21,6 @@ static inline struct sg_table *vb2_dma_sg_plane_desc( | |||
21 | return (struct sg_table *)vb2_plane_cookie(vb, plane_no); | 21 | return (struct sg_table *)vb2_plane_cookie(vb, plane_no); |
22 | } | 22 | } |
23 | 23 | ||
24 | void *vb2_dma_sg_init_ctx(struct device *dev); | ||
25 | void vb2_dma_sg_cleanup_ctx(void *alloc_ctx); | ||
26 | |||
27 | extern const struct vb2_mem_ops vb2_dma_sg_memops; | 24 | extern const struct vb2_mem_ops vb2_dma_sg_memops; |
28 | 25 | ||
29 | #endif | 26 | #endif |
diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c index 5f91d76260ff..93b76c3220fd 100644 --- a/samples/v4l/v4l2-pci-skeleton.c +++ b/samples/v4l/v4l2-pci-skeleton.c | |||
@@ -163,7 +163,7 @@ static irqreturn_t skeleton_irq(int irq, void *dev_id) | |||
163 | */ | 163 | */ |
164 | static int queue_setup(struct vb2_queue *vq, | 164 | static int queue_setup(struct vb2_queue *vq, |
165 | unsigned int *nbuffers, unsigned int *nplanes, | 165 | unsigned int *nbuffers, unsigned int *nplanes, |
166 | unsigned int sizes[], void *alloc_ctxs[]) | 166 | unsigned int sizes[], struct device *alloc_devs[]) |
167 | { | 167 | { |
168 | struct skeleton *skel = vb2_get_drv_priv(vq); | 168 | struct skeleton *skel = vb2_get_drv_priv(vq); |
169 | 169 | ||