]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 15 Apr 2016 12:15:05 +0000 (09:15 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Jul 2016 17:45:07 +0000 (14:45 -0300)
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:
drivers/input/touchscreen/sur40.c
drivers/media/dvb-frontends/rtl2832_sdr.c
drivers/media/pci/cobalt/cobalt-v4l2.c
drivers/media/pci/cx23885/cx23885-417.c
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/pci/cx23885/cx23885-vbi.c
drivers/media/pci/cx23885/cx23885-video.c
drivers/media/pci/cx25821/cx25821-video.c
drivers/media/pci/cx88/cx88-blackbird.c
drivers/media/pci/cx88/cx88-dvb.c
drivers/media/pci/cx88/cx88-vbi.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/dt3155/dt3155.c
drivers/media/pci/netup_unidvb/netup_unidvb_core.c
drivers/media/pci/saa7134/saa7134-ts.c
drivers/media/pci/saa7134/saa7134-vbi.c
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7134/saa7134.h
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
drivers/media/pci/solo6x10/solo6x10-v4l2.c
drivers/media/pci/sta2x11/sta2x11_vip.c
drivers/media/pci/tw68/tw68-video.c
drivers/media/pci/tw686x/tw686x-video.c
drivers/media/platform/am437x/am437x-vpfe.c
drivers/media/platform/blackfin/bfin_capture.c
drivers/media/platform/coda/coda-common.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/exynos-gsc/gsc-core.h
drivers/media/platform/exynos-gsc/gsc-m2m.c
drivers/media/platform/exynos4-is/fimc-capture.c
drivers/media/platform/exynos4-is/fimc-isp-video.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/exynos4-is/fimc-m2m.c
drivers/media/platform/m2m-deinterlace.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/mx2_emmaprp.c
drivers/media/platform/omap3isp/ispvideo.c
drivers/media/platform/rcar-vin/rcar-dma.c
drivers/media/platform/rcar_jpu.c
drivers/media/platform/s3c-camif/camif-capture.c
drivers/media/platform/s5p-g2d/g2d.c
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/s5p-tv/mixer_video.c
drivers/media/platform/sh_veu.c
drivers/media/platform/sh_vou.c
drivers/media/platform/soc_camera/atmel-isi.c
drivers/media/platform/soc_camera/rcar_vin.c
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
drivers/media/platform/sti/bdisp/bdisp-v4l2.c
drivers/media/platform/ti-vpe/cal.c
drivers/media/platform/ti-vpe/vpe.c
drivers/media/platform/vim2m.c
drivers/media/platform/vivid/vivid-sdr-cap.c
drivers/media/platform/vivid/vivid-vbi-cap.c
drivers/media/platform/vivid/vivid-vbi-out.c
drivers/media/platform/vivid/vivid-vid-cap.c
drivers/media/platform/vivid/vivid-vid-out.c
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/platform/xilinx/xilinx-dma.c
drivers/media/usb/airspy/airspy.c
drivers/media/usb/au0828/au0828-vbi.c
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/em28xx/em28xx-vbi.c
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/go7007/go7007-v4l2.c
drivers/media/usb/hackrf/hackrf.c
drivers/media/usb/msi2500/msi2500.c
drivers/media/usb/pwc/pwc-if.c
drivers/media/usb/s2255/s2255drv.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/usbtv/usbtv-video.c
drivers/media/usb/uvc/uvc_queue.c
drivers/media/v4l2-core/videobuf2-core.c
drivers/media/v4l2-core/videobuf2-dma-contig.c
drivers/media/v4l2-core/videobuf2-dma-sg.c
drivers/media/v4l2-core/videobuf2-vmalloc.c
drivers/staging/media/davinci_vpfe/vpfe_video.c
drivers/staging/media/omap4iss/iss_video.c
drivers/staging/media/tw686x-kh/tw686x-kh-video.c
drivers/usb/gadget/function/uvc_queue.c
include/media/videobuf2-core.h
include/media/videobuf2-dma-contig.h
include/media/videobuf2-dma-sg.h
samples/v4l/v4l2-pci-skeleton.c

index cc4bd3e53b5860126ca61674319f86427e206a9c..f124f3af0de1638925180026a3ce6986469bcbcc 100644 (file)
@@ -645,7 +645,7 @@ static void sur40_disconnect(struct usb_interface *interface)
  */
 static int sur40_queue_setup(struct vb2_queue *q,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        if (q->num_buffers + *nbuffers < 3)
                *nbuffers = 3 - q->num_buffers;
index 47a480a7d46cd5c9f5b731cfbcfd98cb868b3f5b..6e22af36b637b7798d4176d090f7e46eb86bfff4 100644 (file)
@@ -452,7 +452,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh,
 /* Videobuf2 operations */
 static int rtl2832_sdr_queue_setup(struct vb2_queue *vq,
                unsigned int *nbuffers,
-               unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
+               unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
 {
        struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq);
        struct platform_device *pdev = dev->pdev;
index 6c19cdfcf3b19b5f48002b75d32788113bdb924e..d05672fe9ff95635f60a9b17656f53b855c1a778 100644 (file)
@@ -45,7 +45,7 @@ static const struct v4l2_dv_timings cea1080p60 = V4L2_DV_BT_CEA_1920X1080P60;
 
 static int cobalt_queue_setup(struct vb2_queue *q,
                        unsigned int *num_buffers, unsigned int *num_planes,
-                       unsigned int sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cobalt_stream *s = q->drv_priv;
        unsigned size = s->stride * s->height;
index 0174d08d0c270b8577907e2e95e499f27853445b..efec2d1a7afddf877432a8d15316dcec40060fb6 100644 (file)
@@ -1140,7 +1140,7 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder)
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx23885_dev *dev = q->drv_priv;
 
index 6ad07f5b5749b6d0ea5755ed334c001e6007397a..95aaa2e2afebd0d5373f9e3ec992daaeafd72c0a 100644 (file)
@@ -94,7 +94,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx23885_tsport *port = q->drv_priv;
 
index 2de9485013e1d94a32d870d7aff7d17850a9b82c..75e7fa7b11216e9f99f47618f0c80c184bc407d4 100644 (file)
@@ -122,7 +122,7 @@ static int cx23885_start_vbi_dma(struct cx23885_dev    *dev,
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx23885_dev *dev = q->drv_priv;
        unsigned lines = VBI_PAL_LINE_COUNT;
index 3ff86d6dbc602427aa6cbdee5e9f73490ef84f13..6d735222a958f56fecfdade7e0aed34e2abf1491 100644 (file)
@@ -335,7 +335,7 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev,
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx23885_dev *dev = q->drv_priv;
 
index 45fc23e11b0cf8288376625dad91671b19a9293c..adcd09be347da94827ead7d51b7384063e80aba3 100644 (file)
@@ -143,7 +143,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status)
 
 static int cx25821_queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx25821_channel *chan = q->drv_priv;
        unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3;
index 7c026c1ca1fe73fd7b5a9809f0b5d316757560ac..04fe9af2a80217ed89b0bf596755b3f79c366d59 100644 (file)
@@ -639,7 +639,7 @@ static int blackbird_stop_codec(struct cx8802_dev *dev)
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx8802_dev *dev = q->drv_priv;
 
index 4d91d16974191aa3881f93d6e9ecf608e4e0edd1..5bb63e7a5691df9dd7e3b4daf644ad070518e1cb 100644 (file)
@@ -84,7 +84,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx8802_dev *dev = q->drv_priv;
 
index 2479f7deccbf04d90121252344309c0452dfc490..d3237cf8ffa31c1b002ab0ee78be4b8f25748e27 100644 (file)
@@ -109,7 +109,7 @@ int cx8800_restart_vbi_queue(struct cx8800_dev    *dev,
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx8800_dev *dev = q->drv_priv;
 
index 9764d6fb382ec9de9c53fb02b9d04639f6172513..5dc1e3f08d50ccea7228bae77555b32296335854 100644 (file)
@@ -431,7 +431,7 @@ static int restart_video_queue(struct cx8800_dev    *dev,
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cx8800_dev *dev = q->drv_priv;
        struct cx88_core *core = dev->core;
index ec8f58a710c75dc6dfcd9b7dcc48ad7d65ed6705..6a219694b22573d514036ad9a8358816a594ffc0 100644 (file)
@@ -133,7 +133,7 @@ static int wait_i2c_reg(void __iomem *addr)
 static int
 dt3155_queue_setup(struct vb2_queue *vq,
                unsigned int *nbuffers, unsigned int *num_planes,
-               unsigned int sizes[], void *alloc_ctxs[])
+               unsigned int sizes[], struct device *alloc_devs[])
 
 {
        struct dt3155_priv *pd = vb2_get_drv_priv(vq);
index d278d4e151a0a71f25a5e3dade33a51d0220c04e..5e3f41b7b3fe7580d5d1fba83878ee75b226f827 100644 (file)
@@ -293,7 +293,7 @@ static int netup_unidvb_queue_setup(struct vb2_queue *vq,
                                    unsigned int *nbuffers,
                                    unsigned int *nplanes,
                                    unsigned int sizes[],
-                                   void *alloc_ctxs[])
+                                   struct device *alloc_devs[])
 {
        struct netup_dma *dma = vb2_get_drv_priv(vq);
 
index 8c68a934e22b45a935eb3ff030626fb9511889dc..7eaf36a41db9ea05c415b3836935b0022f628b8d 100644 (file)
@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);
 
 int saa7134_ts_queue_setup(struct vb2_queue *q,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct saa7134_dmaqueue *dmaq = q->drv_priv;
        struct saa7134_dev *dev = dmaq->dev;
index e9bffb3569ba3c7e9da6a4afe2251bb09bcbf52b..cf9a31e0a390783fbe2b3431b950090ffdf81147 100644 (file)
@@ -140,7 +140,7 @@ static int buffer_prepare(struct vb2_buffer *vb2)
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct saa7134_dmaqueue *dmaq = q->drv_priv;
        struct saa7134_dev *dev = dmaq->dev;
index 965ade72f5c5d2f7f17e6d8e416d1a7d594a6278..8a6ebd087889dfbff21071b453c3450ae250fea4 100644 (file)
@@ -963,7 +963,7 @@ static int buffer_prepare(struct vb2_buffer *vb2)
 
 static int queue_setup(struct vb2_queue *q,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct saa7134_dmaqueue *dmaq = q->drv_priv;
        struct saa7134_dev *dev = dmaq->dev;
index 41c01588af37a4c3bbbd1113f2d10c119048085a..3849083526a7ac24f0a3b3976ae9d38131bd3b28 100644 (file)
@@ -853,7 +853,7 @@ int saa7134_ts_buffer_init(struct vb2_buffer *vb2);
 int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);
 int saa7134_ts_queue_setup(struct vb2_queue *q,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[]);
+                          unsigned int sizes[], struct device *alloc_devs[]);
 int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count);
 void saa7134_ts_stop_streaming(struct vb2_queue *vq);
 
index f48ef33925765feb43b81f0a887f9dde59f68d9c..8b1cde57c8177131c6309d9f6768a2714076f611 100644 (file)
@@ -664,7 +664,7 @@ static int solo_ring_thread(void *data)
 static int solo_enc_queue_setup(struct vb2_queue *q,
                                unsigned int *num_buffers,
                                unsigned int *num_planes, unsigned int sizes[],
-                               void *alloc_ctxs[])
+                               struct device *alloc_devs[])
 {
        sizes[0] = FRAME_BUF_SIZE;
        *num_planes = 1;
index 11cf03be106f2768fa1991630cecab3a9eabb413..b4be47969b6b56913454c2441a6bf91c28cfeeb5 100644 (file)
@@ -315,7 +315,7 @@ static void solo_stop_thread(struct solo_dev *solo_dev)
 
 static int solo_queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct solo_dev *solo_dev = vb2_get_drv_priv(q);
 
index 2844df23ada2927bbea039c9dd7ac120ec6fd628..aeb2b4e2db35cf500535586ccc2562f83f557859 100644 (file)
@@ -265,7 +265,7 @@ static void vip_active_buf_next(struct sta2x11_vip *vip)
 /* Videobuf2 Operations */
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct sta2x11_vip *vip = vb2_get_drv_priv(vq);
 
index c675f9abbb24bde5f71d41d832fdf913c9f6bce2..5e8212845c871b5886f317ce98628dfc1c00735e 100644 (file)
@@ -378,7 +378,7 @@ static int tw68_buffer_count(unsigned int size, unsigned int count)
 
 static int tw68_queue_setup(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct tw68_dev *dev = vb2_get_drv_priv(q);
        unsigned tot_bufs = q->num_buffers + *num_buffers;
index d380a8d8e462362520478ebca01ddb2aff03fe2d..973fa951644b20f7435a19143d282d093656b2d6 100644 (file)
@@ -401,7 +401,7 @@ static const struct tw686x_format *format_by_fourcc(unsigned int fourcc)
 
 static int tw686x_queue_setup(struct vb2_queue *vq,
                              unsigned int *nbuffers, unsigned int *nplanes,
-                             unsigned int sizes[], void *alloc_ctxs[])
+                             unsigned int sizes[], struct device *alloc_devs[])
 {
        struct tw686x_video_channel *vc = vb2_get_drv_priv(vq);
        unsigned int szimage =
index d22b09db9fd005d996a0bce0b88adfeb80acfdb8..b33b9e35e60e4aac658fb370379ff8f11b062c28 100644 (file)
@@ -1901,14 +1901,14 @@ static void vpfe_calculate_offsets(struct vpfe_device *vpfe)
  * @nbuffers: ptr to number of buffers requested by application
  * @nplanes:: contains number of distinct video planes needed to hold a frame
  * @sizes[]: contains the size (in bytes) of each plane.
- * @alloc_ctxs: ptr to allocation context
+ * @alloc_devs: ptr to allocation context
  *
  * This callback function is called when reqbuf() is called to adjust
  * the buffer count and buffer size
  */
 static int vpfe_queue_setup(struct vb2_queue *vq,
                            unsigned int *nbuffers, unsigned int *nplanes,
-                           unsigned int sizes[], void *alloc_ctxs[])
+                           unsigned int sizes[], struct device *alloc_devs[])
 {
        struct vpfe_device *vpfe = vb2_get_drv_priv(vq);
        unsigned size = vpfe->fmt.fmt.pix.sizeimage;
index 1e2442876d267d625a208568b395bece99f7a35d..8eb03397d736f2c9fa98d1380be8615530a79bad 100644 (file)
@@ -201,7 +201,7 @@ static void bcap_free_sensor_formats(struct bcap_device *bcap_dev)
 
 static int bcap_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
 
index 3d57c352cefa87fd1f77f30962f793efea1e823f..3e9b7c817684b8b0d60596c8ba614a4dd213c144 100644 (file)
@@ -1139,7 +1139,7 @@ static void set_default_params(struct coda_ctx *ctx)
  */
 static int coda_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct coda_ctx *ctx = vb2_get_drv_priv(vq);
        struct coda_q_data *q_data;
index 2a4c2914d077ddbacad37dace8023742c5bbd377..0b1709e96673d164ab05f6f2fd0d8844985dbe16 100644 (file)
@@ -230,7 +230,7 @@ static int vpbe_buffer_prepare(struct vb2_buffer *vb)
 static int
 vpbe_buffer_queue_setup(struct vb2_queue *vq,
                        unsigned int *nbuffers, unsigned int *nplanes,
-                       unsigned int sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 
 {
        /* Get the file handle object and layer object */
index d5afab0dd9e500deb249e5cd47e7b8caa6ddd2c7..5104cc0ee40e35ca2b973efc9ebad4b2a71bdd6e 100644 (file)
@@ -107,14 +107,14 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb)
  * @nbuffers: ptr to number of buffers requested by application
  * @nplanes:: contains number of distinct video planes needed to hold a frame
  * @sizes[]: contains the size (in bytes) of each plane.
- * @alloc_ctxs: ptr to allocation context
+ * @alloc_devs: ptr to allocation context
  *
  * This callback function is called when reqbuf() is called to adjust
  * the buffer count and buffer size
  */
 static int vpif_buffer_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct channel_obj *ch = vb2_get_drv_priv(vq);
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
index 5d77884b120ab0a933e33ec50204c457176b1190..75b27233ec2f9d8919b12e42b9481a022508ab1d 100644 (file)
@@ -102,14 +102,14 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb)
  * @nbuffers: ptr to number of buffers requested by application
  * @nplanes:: contains number of distinct video planes needed to hold a frame
  * @sizes[]: contains the size (in bytes) of each plane.
- * @alloc_ctxs: ptr to allocation context
+ * @alloc_devs: ptr to allocation context
  *
  * This callback function is called when reqbuf() is called to adjust
  * the buffer count and buffer size
  */
 static int vpif_buffer_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct channel_obj *ch = vb2_get_drv_priv(vq);
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
index 5c48329381faa27509698de02f9703b5e9c09ed5..7ad7b9dc224373e30ab07018802128ce51eef351 100644 (file)
@@ -327,7 +327,6 @@ struct gsc_driverdata {
  * @irq_queue: interrupt handler waitqueue
  * @m2m:       memory-to-memory V4L2 device information
  * @state:     flags used to synchronize m2m and capture mode operation
- * @alloc_ctx: videobuf2 memory allocator context
  * @vdev:      video device for G-Scaler instance
  */
 struct gsc_dev {
index 622709c4541304fcd91166a516dda7ccf4dd8399..ec6494cbdd4588860ad8a204f9ff43fa74041b04 100644 (file)
@@ -213,7 +213,7 @@ put_device:
 
 static int gsc_m2m_queue_setup(struct vb2_queue *vq,
                        unsigned int *num_buffers, unsigned int *num_planes,
-                       unsigned int sizes[], void *allocators[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct gsc_ctx *ctx = vb2_get_drv_priv(vq);
        struct gsc_frame *frame;
index 512b254914bcef49ff2a5a5baa75543b1bf5cb18..fdec499fbbda496284b6500bf9035cec6bb8b807 100644 (file)
@@ -340,7 +340,7 @@ int fimc_capture_resume(struct fimc_dev *fimc)
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *num_buffers, unsigned int *num_planes,
-                      unsigned int sizes[], void *allocators[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct fimc_ctx *ctx = vq->drv_priv;
        struct fimc_frame *frame = &ctx->d_frame;
index abc338962d809ec5f722b40a3513aa336dd798e8..400ce0cb0c0dc97900226d0060c57cb0b3f71711 100644 (file)
@@ -40,7 +40,7 @@
 
 static int isp_video_capture_queue_setup(struct vb2_queue *vq,
                        unsigned int *num_buffers, unsigned int *num_planes,
-                       unsigned int sizes[], void *allocators[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct fimc_isp *isp = vb2_get_drv_priv(vq);
        struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;
index f5a27a90e9d10788e2087f1cbd4ed2fed22b9f42..a0f149fb88e1980e36d24058a6f12bc583000ce6 100644 (file)
@@ -357,7 +357,7 @@ static void stop_streaming(struct vb2_queue *q)
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *num_buffers, unsigned int *num_planes,
-                      unsigned int sizes[], void *allocators[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct fimc_lite *fimc = vq->drv_priv;
        struct flite_frame *frame = &fimc->out_frame;
index f4f76225ffed612f49d62d22c4765e02cacfcc9a..b1309e114edbe223929be87cdc0b66a5e5d7f2ad 100644 (file)
@@ -174,7 +174,7 @@ static void fimc_job_abort(void *priv)
 
 static int fimc_queue_setup(struct vb2_queue *vq,
                            unsigned int *num_buffers, unsigned int *num_planes,
-                           unsigned int sizes[], void *allocators[])
+                           unsigned int sizes[], struct device *alloc_devs[])
 {
        struct fimc_ctx *ctx = vb2_get_drv_priv(vq);
        struct fimc_frame *f;
index 15110ea89c5649c2285063f2260faa13b9cfeadd..0fcb5c78031dabb6b65b2a8ce407640823df8c6b 100644 (file)
@@ -798,7 +798,7 @@ struct vb2_dc_conf {
 
 static int deinterlace_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct deinterlace_ctx *ctx = vb2_get_drv_priv(vq);
        struct deinterlace_q_data *q_data;
index 8a1f12d08c0c10c9c09999ee6ed87c57e4c70aec..9171174521b230670231758795c7c5b1ade183b1 100644 (file)
@@ -1051,7 +1051,7 @@ static int mcam_read_setup(struct mcam_camera *cam)
 static int mcam_vb_queue_setup(struct vb2_queue *vq,
                unsigned int *nbufs,
                unsigned int *num_planes, unsigned int sizes[],
-               void *alloc_ctxs[])
+               struct device *alloc_devs[])
 {
        struct mcam_camera *cam = vb2_get_drv_priv(vq);
        int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2;
index 88b3d982a2da7186155e12b0c2e118c4053249a3..c639406fe72ef4659ccb36e8bac72b6b0a1456b7 100644 (file)
@@ -689,7 +689,7 @@ static const struct v4l2_ioctl_ops emmaprp_ioctl_ops = {
  */
 static int emmaprp_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct emmaprp_ctx *ctx = vb2_get_drv_priv(vq);
        struct emmaprp_q_data *q_data;
index 486b8754110fc7edba3e397ace3ab8a357c8330d..7d9f35976d18e063e952a2b99c1acb3b04fc5493 100644 (file)
@@ -331,7 +331,7 @@ isp_video_check_format(struct isp_video *video, struct isp_video_fh *vfh)
 
 static int isp_video_queue_setup(struct vb2_queue *queue,
                                 unsigned int *count, unsigned int *num_planes,
-                                unsigned int sizes[], void *alloc_ctxs[])
+                                unsigned int sizes[], struct device *alloc_devs[])
 {
        struct isp_video_fh *vfh = vb2_get_drv_priv(queue);
        struct isp_video *video = vfh->video;
index 4c5c529aafa76943730c880d394008180e6a2a02..496aa97b64008b3e3e52406a7fda4abd319cda63 100644 (file)
@@ -974,7 +974,7 @@ static void return_all_buffers(struct rvin_dev *vin,
 
 static int rvin_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
                            unsigned int *nplanes, unsigned int sizes[],
-                           void *alloc_ctxs[])
+                           struct device *alloc_devs[])
 
 {
        struct rvin_dev *vin = vb2_get_drv_priv(vq);
index d81c41035bb6eeaa069109910ca682223bfbb5f2..16782ceb29c3d6eb0d35ce10e43e35959db49811 100644 (file)
@@ -1014,7 +1014,7 @@ error_free:
  */
 static int jpu_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct jpu_ctx *ctx = vb2_get_drv_priv(vq);
        struct jpu_q_data *q_data;
index 5eb5df1c6f75e20fa405af6be0fa8d697717c3fe..0413a861a59a48e4ff76522892905b9e6f97e07d 100644 (file)
@@ -437,7 +437,7 @@ static void stop_streaming(struct vb2_queue *vq)
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *num_buffers, unsigned int *num_planes,
-                      unsigned int sizes[], void *allocators[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct camif_vp *vp = vb2_get_drv_priv(vq);
        struct camif_frame *frame = &vp->out_frame;
index 2aeb950ba91fe218fab434d29529c740e2f4ce3a..391dd7a7b362c8cb498884468ab84f136cc67516 100644 (file)
@@ -103,7 +103,7 @@ static struct g2d_frame *get_frame(struct g2d_ctx *ctx,
 
 static int g2d_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct g2d_ctx *ctx = vb2_get_drv_priv(vq);
        struct g2d_frame *f = get_frame(ctx, vq->type);
index d8842c482f0cb093699949cf42d18ecae33fd93d..785e6936c881dbda58e4b2d697c9489758df9233 100644 (file)
@@ -2436,7 +2436,7 @@ static struct v4l2_m2m_ops exynos4_jpeg_m2m_ops = {
 
 static int s5p_jpeg_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(vq);
        struct s5p_jpeg_q_data *q_data = NULL;
index ae98a5568b695583e8fc267907bc9c55cc7836ba..47c997d9e8cbfbff09a53bac1f8d041a9292acf6 100644 (file)
@@ -890,7 +890,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_dec_ioctl_ops = {
 static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                        unsigned int *buf_count,
                        unsigned int *plane_count, unsigned int psize[],
-                       void *allocators[])
+                       struct device *alloc_devs[])
 {
        struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
        struct s5p_mfc_dev *dev = ctx->dev;
@@ -931,14 +931,14 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                psize[1] = ctx->chroma_size;
 
                if (IS_MFCV6_PLUS(dev))
-                       allocators[0] = &ctx->dev->mem_dev_l;
+                       alloc_devs[0] = ctx->dev->mem_dev_l;
                else
-                       allocators[0] = &ctx->dev->mem_dev_r;
-               allocators[1] = &ctx->dev->mem_dev_l;
+                       alloc_devs[0] = ctx->dev->mem_dev_r;
+               alloc_devs[1] = ctx->dev->mem_dev_l;
        } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
                   ctx->state == MFCINST_INIT) {
                psize[0] = ctx->dec_src_buf_size;
-               allocators[0] = &ctx->dev->mem_dev_l;
+               alloc_devs[0] = ctx->dev->mem_dev_l;
        } else {
                mfc_err("This video node is dedicated to decoding. Decoding not initialized\n");
                return -EINVAL;
index b95796a0cc338388ce1f2078b4c953228b983eb6..fcc2e054c61f7f47a84385c356328a0f55e9faf2 100644 (file)
@@ -1812,7 +1812,7 @@ static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb)
 
 static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                        unsigned int *buf_count, unsigned int *plane_count,
-                       unsigned int psize[], void *allocators[])
+                       unsigned int psize[], struct device *alloc_devs[])
 {
        struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
        struct s5p_mfc_dev *dev = ctx->dev;
@@ -1832,7 +1832,7 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                if (*buf_count > MFC_MAX_BUFFERS)
                        *buf_count = MFC_MAX_BUFFERS;
                psize[0] = ctx->enc_dst_buf_size;
-               allocators[0] = &ctx->dev->mem_dev_l;
+               alloc_devs[0] = ctx->dev->mem_dev_l;
        } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
                if (ctx->src_fmt)
                        *plane_count = ctx->src_fmt->num_planes;
@@ -1848,11 +1848,11 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
                psize[1] = ctx->chroma_size;
 
                if (IS_MFCV6_PLUS(dev)) {
-                       allocators[0] = &ctx->dev->mem_dev_l;
-                       allocators[1] = &ctx->dev->mem_dev_l;
+                       alloc_devs[0] = ctx->dev->mem_dev_l;
+                       alloc_devs[1] = ctx->dev->mem_dev_l;
                } else {
-                       allocators[0] = &ctx->dev->mem_dev_r;
-                       allocators[1] = &ctx->dev->mem_dev_r;
+                       alloc_devs[0] = ctx->dev->mem_dev_r;
+                       alloc_devs[1] = ctx->dev->mem_dev_r;
                }
        } else {
                mfc_err("invalid queue type: %d\n", vq->type);
index 6c4d1b91f3255d0ea1f7dae27d4c3e4c3b3b2ccd..ee74e2b44d692d5bdf6f8395c12b1d700bccf841 100644 (file)
@@ -874,7 +874,7 @@ static const struct v4l2_file_operations mxr_fops = {
 
 static int queue_setup(struct vb2_queue *vq,
        unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[],
-       void *alloc_ctxs[])
+       struct device *alloc_devs[])
 {
        struct mxr_layer *layer = vb2_get_drv_priv(vq);
        const struct mxr_format *fmt = layer->fmt;
index afd21c9f1a024c05b8e54cc352a87bdbdccc9e67..15a562af13c774711c8478cf682491e916b8784b 100644 (file)
@@ -865,7 +865,7 @@ static const struct v4l2_ioctl_ops sh_veu_ioctl_ops = {
 
 static int sh_veu_queue_setup(struct vb2_queue *vq,
                              unsigned int *nbuffers, unsigned int *nplanes,
-                             unsigned int sizes[], void *alloc_ctxs[])
+                             unsigned int sizes[], struct device *alloc_devs[])
 {
        struct sh_veu_dev *veu = vb2_get_drv_priv(vq);
        struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type);
index 59830a4915925d1f52bb221203b6f945fe2b58b5..e1f39b4cf1cd018d1ad52b31286847134c173405 100644 (file)
@@ -244,7 +244,7 @@ static void sh_vou_stream_config(struct sh_vou_device *vou_dev)
 /* Locking: caller holds fop_lock mutex */
 static int sh_vou_queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq);
        struct v4l2_pix_format *pix = &vou_dev->pix;
index 899b93ad1e4fecc970da1a1b49936b2c307375f2..30211f6b4483138819ec6182f90ad7c7f17170ff 100644 (file)
@@ -303,7 +303,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset)
    ------------------------------------------------------------------*/
 static int queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
index dadc5b3e1bb2badbcdd14ce3c1bad3f31bedf0bd..9c137522c660e5704e8c1c3f7e3bec0aa9d60095 100644 (file)
@@ -533,7 +533,7 @@ struct rcar_vin_cam {
 static int rcar_vin_videobuf_setup(struct vb2_queue *vq,
                                   unsigned int *count,
                                   unsigned int *num_planes,
-                                  unsigned int sizes[], void *alloc_ctxs[])
+                                  unsigned int sizes[], struct device *alloc_devs[])
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
index 8f87fbec6f510c99f9a93cd6904b52dd82b34987..02b519dde42aa924d8e3c57fc4af6232eac3870f 100644 (file)
@@ -210,7 +210,7 @@ static int sh_mobile_ceu_soft_reset(struct sh_mobile_ceu_dev *pcdev)
  */
 static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,
                        unsigned int *count, unsigned int *num_planes,
-                       unsigned int sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
        struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
index b3e8b5afeb619da0b542c415e43abec0d99d574c..3b1ac687d0dfbbec1a230d7a7bc4a8f28c1cab65 100644 (file)
@@ -439,7 +439,7 @@ static void bdisp_ctrls_delete(struct bdisp_ctx *ctx)
 
 static int bdisp_queue_setup(struct vb2_queue *vq,
                             unsigned int *nb_buf, unsigned int *nb_planes,
-                            unsigned int sizes[], void *alloc_ctxs[])
+                            unsigned int sizes[], struct device *alloc_devs[])
 {
        struct bdisp_ctx *ctx = vb2_get_drv_priv(vq);
        struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type);
index 51ebf32c659c007399d1a7befc5068c29dd08028..e967fcfdc1d83658828b10a0679fda5d3a6f06bf 100644 (file)
@@ -1225,7 +1225,7 @@ static int cal_enum_frameintervals(struct file *file, void *priv,
  */
 static int cal_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct cal_ctx *ctx = vb2_get_drv_priv(vq);
        unsigned size = ctx->v_fmt.fmt.pix.sizeimage;
index 3fefd8ad37afc23438a2550ac37b2979fa689552..55a1458ac7830ffc47558be3317462b5e213f6d2 100644 (file)
@@ -1796,7 +1796,7 @@ static const struct v4l2_ioctl_ops vpe_ioctl_ops = {
  */
 static int vpe_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        int i;
        struct vpe_ctx *ctx = vb2_get_drv_priv(vq);
index c4b5fab836663d2ea07f9c240327d52f80529e83..6b17015048aedb913aaa86b5adf31cbcc96d7ae4 100644 (file)
@@ -711,7 +711,7 @@ static const struct v4l2_ioctl_ops vim2m_ioctl_ops = {
 
 static int vim2m_queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct vim2m_ctx *ctx = vb2_get_drv_priv(vq);
        struct vim2m_q_data *q_data;
@@ -731,11 +731,6 @@ static int vim2m_queue_setup(struct vb2_queue *vq,
        *nplanes = 1;
        sizes[0] = size;
 
-       /*
-        * videobuf2-vmalloc allocator is context-less so no need to set
-        * alloc_ctxs array.
-        */
-
        dprintk(ctx->dev, "get %d buffer(s) of size %d each.\n", count, size);
 
        return 0;
index 1428e31a28753d67886b8fcd2dd6092fa1a15ce9..ebd7b9c4dd830ec3c78a88f90abbb5a84ce55926 100644 (file)
@@ -213,7 +213,7 @@ static int vivid_thread_sdr_cap(void *data)
 
 static int sdr_cap_queue_setup(struct vb2_queue *vq,
                       unsigned *nbuffers, unsigned *nplanes,
-                      unsigned sizes[], void *alloc_ctxs[])
+                      unsigned sizes[], struct device *alloc_devs[])
 {
        /* 2 = max 16-bit sample returned */
        sizes[0] = SDR_CAP_SAMPLES_PER_BUF * 2;
index cda45a582bfef3756766df64cb6c0a6e3cbeb242..d66ef95dd2b5be619afb4ef5888f77c079a862e0 100644 (file)
@@ -137,7 +137,7 @@ void vivid_sliced_vbi_cap_process(struct vivid_dev *dev,
 
 static int vbi_cap_queue_setup(struct vb2_queue *vq,
                       unsigned *nbuffers, unsigned *nplanes,
-                      unsigned sizes[], void *alloc_ctxs[])
+                      unsigned sizes[], struct device *alloc_devs[])
 {
        struct vivid_dev *dev = vb2_get_drv_priv(vq);
        bool is_60hz = dev->std_cap & V4L2_STD_525_60;
index 3c5a469e6f49799faf846647e059d8d8c46cacbd..d2989195cf03c8399380615eac9aea168ece3bca 100644 (file)
@@ -29,7 +29,7 @@
 
 static int vbi_out_queue_setup(struct vb2_queue *vq,
                       unsigned *nbuffers, unsigned *nplanes,
-                      unsigned sizes[], void *alloc_ctxs[])
+                      unsigned sizes[], struct device *alloc_devs[])
 {
        struct vivid_dev *dev = vb2_get_drv_priv(vq);
        bool is_60hz = dev->std_out & V4L2_STD_525_60;
index fdca33fc20b04c5d232a1a842c628998738651cc..52ea6d74b70b38737b3d4902d027e627df1955d0 100644 (file)
@@ -97,7 +97,7 @@ static const struct v4l2_discrete_probe webcam_probe = {
 
 static int vid_cap_queue_setup(struct vb2_queue *vq,
                       unsigned *nbuffers, unsigned *nplanes,
-                      unsigned sizes[], void *alloc_ctxs[])
+                      unsigned sizes[], struct device *alloc_devs[])
 {
        struct vivid_dev *dev = vb2_get_drv_priv(vq);
        unsigned buffers = tpg_g_buffers(&dev->tpg);
@@ -144,11 +144,6 @@ static int vid_cap_queue_setup(struct vb2_queue *vq,
 
        *nplanes = buffers;
 
-       /*
-        * videobuf2-vmalloc allocator is context-less so no need to set
-        * alloc_ctxs array.
-        */
-
        dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers);
        for (p = 0; p < buffers; p++)
                dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]);
index f92f4496d527fa30d4a8c50879b291e555b52d1d..dd609eea4753cc6d8117787939b69b1c20a7d77d 100644 (file)
@@ -34,7 +34,7 @@
 
 static int vid_out_queue_setup(struct vb2_queue *vq,
                       unsigned *nbuffers, unsigned *nplanes,
-                      unsigned sizes[], void *alloc_ctxs[])
+                      unsigned sizes[], struct device *alloc_devs[])
 {
        struct vivid_dev *dev = vb2_get_drv_priv(vq);
        const struct vivid_fmt *vfmt = dev->fmt_out;
@@ -87,11 +87,6 @@ static int vid_out_queue_setup(struct vb2_queue *vq,
 
        *nplanes = planes;
 
-       /*
-        * videobuf2-vmalloc allocator is context-less so no need to set
-        * alloc_ctxs array.
-        */
-
        dprintk(dev, 1, "%s: count=%d\n", __func__, *nbuffers);
        for (p = 0; p < planes; p++)
                dprintk(dev, 1, "%s: size[%u]=%u\n", __func__, p, sizes[p]);
index 0e94e3b6fcf166c55657f7c78239a963329bccac..424a541221903f72ae9260572a80519bab25f620 100644 (file)
@@ -519,8 +519,8 @@ static void vsp1_video_pipeline_put(struct vsp1_pipeline *pipe)
 
 static int
 vsp1_video_queue_setup(struct vb2_queue *vq,
-                    unsigned int *nbuffers, unsigned int *nplanes,
-                    unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int *nbuffers, unsigned int *nplanes,
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct vsp1_video *video = vb2_get_drv_priv(vq);
        const struct v4l2_pix_format_mplane *format = &video->rwpf->format;
@@ -530,10 +530,9 @@ vsp1_video_queue_setup(struct vb2_queue *vq,
                if (*nplanes != format->num_planes)
                        return -EINVAL;
 
-               for (i = 0; i < *nplanes; i++) {
+               for (i = 0; i < *nplanes; i++)
                        if (sizes[i] < format->plane_fmt[i].sizeimage)
                                return -EINVAL;
-               }
                return 0;
        }
 
@@ -979,7 +978,6 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
 
        video_set_drvdata(&video->video, video);
 
-       /* ... and the buffers queue... */
        video->queue.type = video->type;
        video->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
        video->queue.lock = &video->lock;
index 3838e11fc15fb42908d7674ebfae9a74ae8fc1b5..7ae1a134b1ffc2c7e1c69f61890c3cac1253b7ce 100644 (file)
@@ -318,7 +318,7 @@ static void xvip_dma_complete(void *param)
 static int
 xvip_dma_queue_setup(struct vb2_queue *vq,
                     unsigned int *nbuffers, unsigned int *nplanes,
-                    unsigned int sizes[], void *alloc_ctxs[])
+                    unsigned int sizes[], struct device *alloc_devs[])
 {
        struct xvip_dma *dma = vb2_get_drv_priv(vq);
 
index 87c12930416f565a118c145501e54df1a6b13cc7..d807d5875f7ec976bedf2ad3a1ebae33f5a70402 100644 (file)
@@ -488,7 +488,7 @@ static void airspy_disconnect(struct usb_interface *intf)
 /* Videobuf2 operations */
 static int airspy_queue_setup(struct vb2_queue *vq,
                unsigned int *nbuffers,
-               unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
+               unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
 {
        struct airspy *s = vb2_get_drv_priv(vq);
 
index b4efc103ae5786b5e2297032a4d4b00e86655f09..e0930ce59b8d269dff1cb3e5fb46628c1804b223 100644 (file)
@@ -32,7 +32,7 @@
 
 static int vbi_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct au0828_dev *dev = vb2_get_drv_priv(vq);
        unsigned long size = dev->vbi_width * dev->vbi_height * 2;
index 7d0ec4cb248c5d93aba4e6eb8530c3064f71fc0c..82b026985868358595310d66bb7b7dddcadd4dac 100644 (file)
@@ -698,7 +698,7 @@ int au0828_v4l2_device_register(struct usb_interface *interface,
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct au0828_dev *dev = vb2_get_drv_priv(vq);
        unsigned long size = dev->height * dev->bytesperline;
index fe94c9225dd7f18ce413f56347551bc7de961688..836c6b53b16c116474f4b5910305a69025b4e8ba 100644 (file)
@@ -33,7 +33,7 @@
 
 static int vbi_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct em28xx *dev = vb2_get_drv_priv(vq);
        struct em28xx_v4l2 *v4l2 = dev->v4l2;
index 44834b2eff55a1d727db7e4822ea8a7cd3304d37..7968695217f339d776a4b893e8fb14f1e7863287 100644 (file)
@@ -1013,7 +1013,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev)
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct em28xx *dev = vb2_get_drv_priv(vq);
        struct em28xx_v4l2 *v4l2 = dev->v4l2;
index ea01ee5df60a4400e51f55a201db43d985ffc67e..af8458996d91f38cc0c3eb6fbfa982b463ac1061 100644 (file)
@@ -370,7 +370,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
 
 static int go7007_queue_setup(struct vb2_queue *q,
                unsigned int *num_buffers, unsigned int *num_planes,
-               unsigned int sizes[], void *alloc_ctxs[])
+               unsigned int sizes[], struct device *alloc_devs[])
 {
        sizes[0] = GO7007_BUF_SIZE;
        *num_planes = 1;
index 9e700caf0d663f77b4a9c927de0bb2e32b368c6d..b1e229a44192d3d091b62869d42c3e4b874fac73 100644 (file)
@@ -760,7 +760,7 @@ static void hackrf_return_all_buffers(struct vb2_queue *vq,
 
 static int hackrf_queue_setup(struct vb2_queue *vq,
                unsigned int *nbuffers,
-               unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
+               unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
 {
        struct hackrf_dev *dev = vb2_get_drv_priv(vq);
 
index 2d33033682af3635a1237d14e0bef045185e7ef0..e7f167d44c61cefbb2827a195e981dfe0ed57573 100644 (file)
@@ -618,7 +618,7 @@ static int msi2500_querycap(struct file *file, void *fh,
 static int msi2500_queue_setup(struct vb2_queue *vq,
                               unsigned int *nbuffers,
                               unsigned int *nplanes, unsigned int sizes[],
-                              void *alloc_ctxs[])
+                              struct device *alloc_devs[])
 {
        struct msi2500_dev *dev = vb2_get_drv_priv(vq);
 
index 18aed5dd325e024e1db0860ba954ae75ef50fa7e..dd43652fdef8e56635ee8af0aa34d0cba44d53c5 100644 (file)
@@ -573,7 +573,7 @@ static void pwc_video_release(struct v4l2_device *v)
 
 static int queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct pwc_device *pdev = vb2_get_drv_priv(vq);
        int size;
index 9acdaa3716fbea1503ec90791fa09ad15d750da5..43ba71a7d02b8f4fbe0619ca8fbdbcaf25019802 100644 (file)
@@ -662,7 +662,7 @@ static void s2255_fillbuff(struct s2255_vc *vc,
 
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct s2255_vc *vc = vb2_get_drv_priv(vq);
        if (*nbuffers < S2255_MIN_BUFS)
index 7ddbc0274f127eed30936687d7471c77382a267c..5fab3bee8c74caf45eebad10aa305c7482d8f174 100644 (file)
@@ -666,7 +666,7 @@ static const struct v4l2_ioctl_ops stk1160_ioctl_ops = {
  */
 static int queue_setup(struct vb2_queue *vq,
                                unsigned int *nbuffers, unsigned int *nplanes,
-                               unsigned int sizes[], void *alloc_ctxs[])
+                               unsigned int sizes[], struct device *alloc_devs[])
 {
        struct stk1160 *dev = vb2_get_drv_priv(vq);
        unsigned long size;
index f6cfad46547ef5951923e95d4005aa3f317c1e56..7e282048f932bccecfd698e85d01250bf0789f3a 100644 (file)
@@ -608,7 +608,7 @@ static struct v4l2_file_operations usbtv_fops = {
 
 static int usbtv_queue_setup(struct vb2_queue *vq,
        unsigned int *nbuffers,
-       unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
+       unsigned int *nplanes, unsigned int sizes[], struct device *alloc_devs[])
 {
        struct usbtv *usbtv = vb2_get_drv_priv(vq);
        unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32);
index 54394722756f16211984b0150d9461c9014d0a5c..773fefb52d7a514616b705d2a16dc2d3ebd29ce2 100644 (file)
@@ -71,7 +71,7 @@ static void uvc_queue_return_buffers(struct uvc_video_queue *queue,
 
 static int uvc_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
        struct uvc_streaming *stream = uvc_queue_to_stream(queue);
index aabb03e406f0d50f49cdc566ea1c2720200e51eb..0b9e71e48ddbadd8a7534731f2ce137b90dbd85f 100644 (file)
@@ -207,7 +207,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
                unsigned long size = PAGE_ALIGN(vb->planes[plane].length);
 
                mem_priv = call_ptr_memop(vb, alloc,
-                               q->alloc_ctx[plane] ? : &q->dev,
+                               q->alloc_devs[plane] ? : q->dev,
                                q->dma_attrs, size, dma_dir, q->gfp_flags);
                if (IS_ERR_OR_NULL(mem_priv))
                        goto free;
@@ -738,7 +738,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
         */
        num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME);
        num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed);
-       memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
+       memset(q->alloc_devs, 0, sizeof(q->alloc_devs));
        q->memory = memory;
 
        /*
@@ -746,7 +746,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
         * Driver also sets the size and allocator context for each plane.
         */
        ret = call_qop(q, queue_setup, q, &num_buffers, &num_planes,
-                      plane_sizes, q->alloc_ctx);
+                      plane_sizes, q->alloc_devs);
        if (ret)
                return ret;
 
@@ -779,7 +779,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
                num_planes = 0;
 
                ret = call_qop(q, queue_setup, q, &num_buffers,
-                              &num_planes, plane_sizes, q->alloc_ctx);
+                              &num_planes, plane_sizes, q->alloc_devs);
 
                if (!ret && allocated_buffers < num_buffers)
                        ret = -ENOMEM;
@@ -845,7 +845,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
        }
 
        if (!q->num_buffers) {
-               memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
+               memset(q->alloc_devs, 0, sizeof(q->alloc_devs));
                q->memory = memory;
                q->waiting_for_buffers = !q->is_output;
        }
@@ -862,7 +862,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
         * buffer and their sizes are acceptable
         */
        ret = call_qop(q, queue_setup, q, &num_buffers,
-                      &num_planes, plane_sizes, q->alloc_ctx);
+                      &num_planes, plane_sizes, q->alloc_devs);
        if (ret)
                return ret;
 
@@ -885,7 +885,7 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
                 * queue driver has set up
                 */
                ret = call_qop(q, queue_setup, q, &num_buffers,
-                              &num_planes, plane_sizes, q->alloc_ctx);
+                              &num_planes, plane_sizes, q->alloc_devs);
 
                if (!ret && allocated_buffers < num_buffers)
                        ret = -ENOMEM;
@@ -1133,7 +1133,7 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb)
 
                /* Acquire each plane's memory */
                mem_priv = call_ptr_memop(vb, get_userptr,
-                               q->alloc_ctx[plane] ? : &q->dev,
+                               q->alloc_devs[plane] ? : q->dev,
                                planes[plane].m.userptr,
                                planes[plane].length, dma_dir);
                if (IS_ERR_OR_NULL(mem_priv)) {
@@ -1258,7 +1258,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb)
 
                /* Acquire each plane's memory */
                mem_priv = call_ptr_memop(vb, attach_dmabuf,
-                               q->alloc_ctx[plane] ? : &q->dev,
+                               q->alloc_devs[plane] ? : q->dev,
                                dbuf, planes[plane].length, dma_dir);
                if (IS_ERR(mem_priv)) {
                        dprintk(1, "failed to attach dmabuf\n");
index a7825c62ad882dd6469a0d2d093c0241925c1c6a..863f658a3fa197301bb635b7b981937a9442e246 100644 (file)
 #include <media/videobuf2-dma-contig.h>
 #include <media/videobuf2-memops.h>
 
-struct vb2_dc_conf {
-       struct device           *dev;
-};
-
 struct vb2_dc_buf {
        struct device                   *dev;
        void                            *vaddr;
@@ -139,12 +135,10 @@ static void vb2_dc_put(void *buf_priv)
        kfree(buf);
 }
 
-static void *vb2_dc_alloc(void *alloc_ctx, const struct dma_attrs *attrs,
+static void *vb2_dc_alloc(struct device *dev, const struct dma_attrs *attrs,
                          unsigned long size, enum dma_data_direction dma_dir,
                          gfp_t gfp_flags)
 {
-       struct vb2_dc_conf *conf = alloc_ctx;
-       struct device *dev = conf->dev;
        struct vb2_dc_buf *buf;
 
        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
 }
 #endif
 
-static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
+static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr,
        unsigned long size, enum dma_data_direction dma_dir)
 {
-       struct vb2_dc_conf *conf = alloc_ctx;
        struct vb2_dc_buf *buf;
        struct frame_vector *vec;
        unsigned long offset;
@@ -510,7 +503,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
        if (!buf)
                return ERR_PTR(-ENOMEM);
 
-       buf->dev = conf->dev;
+       buf->dev = dev;
        buf->dma_dir = dma_dir;
 
        offset = vaddr & ~PAGE_MASK;
@@ -677,10 +670,9 @@ static void vb2_dc_detach_dmabuf(void *mem_priv)
        kfree(buf);
 }
 
-static void *vb2_dc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf,
+static void *vb2_dc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf,
        unsigned long size, enum dma_data_direction dma_dir)
 {
-       struct vb2_dc_conf *conf = alloc_ctx;
        struct vb2_dc_buf *buf;
        struct dma_buf_attachment *dba;
 
@@ -691,7 +683,7 @@ static void *vb2_dc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf,
        if (!buf)
                return ERR_PTR(-ENOMEM);
 
-       buf->dev = conf->dev;
+       buf->dev = dev;
        /* create attachment for the dmabuf with the user device */
        dba = dma_buf_attach(dbuf, buf->dev);
        if (IS_ERR(dba)) {
@@ -730,27 +722,6 @@ const struct vb2_mem_ops vb2_dma_contig_memops = {
 };
 EXPORT_SYMBOL_GPL(vb2_dma_contig_memops);
 
-void *vb2_dma_contig_init_ctx(struct device *dev)
-{
-       struct vb2_dc_conf *conf;
-
-       conf = kzalloc(sizeof *conf, GFP_KERNEL);
-       if (!conf)
-               return ERR_PTR(-ENOMEM);
-
-       conf->dev = dev;
-
-       return conf;
-}
-EXPORT_SYMBOL_GPL(vb2_dma_contig_init_ctx);
-
-void vb2_dma_contig_cleanup_ctx(void *alloc_ctx)
-{
-       if (!IS_ERR_OR_NULL(alloc_ctx))
-               kfree(alloc_ctx);
-}
-EXPORT_SYMBOL_GPL(vb2_dma_contig_cleanup_ctx);
-
 /**
  * vb2_dma_contig_set_max_seg_size() - configure DMA max segment size
  * @dev:       device for configuring DMA parameters
index e7153f708ade2703422ecdf73e0cee24875eece3..a39db8a6db7a592bcdc51c3697e6a098792c35c9 100644 (file)
@@ -30,10 +30,6 @@ module_param(debug, int, 0644);
                        printk(KERN_DEBUG "vb2-dma-sg: " fmt, ## arg);  \
        } while (0)
 
-struct vb2_dma_sg_conf {
-       struct device           *dev;
-};
-
 struct vb2_dma_sg_buf {
        struct device                   *dev;
        void                            *vaddr;
@@ -99,11 +95,10 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf,
        return 0;
 }
 
-static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs,
+static void *vb2_dma_sg_alloc(struct device *dev, const struct dma_attrs *dma_attrs,
                              unsigned long size, enum dma_data_direction dma_dir,
                              gfp_t gfp_flags)
 {
-       struct vb2_dma_sg_conf *conf = alloc_ctx;
        struct vb2_dma_sg_buf *buf;
        struct sg_table *sgt;
        int ret;
@@ -112,7 +107,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs
 
        dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
 
-       if (WARN_ON(alloc_ctx == NULL))
+       if (WARN_ON(dev == NULL))
                return NULL;
        buf = kzalloc(sizeof *buf, GFP_KERNEL);
        if (!buf)
@@ -141,7 +136,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, const struct dma_attrs *dma_attrs
                goto fail_table_alloc;
 
        /* Prevent the device from being released while the buffer is used */
-       buf->dev = get_device(conf->dev);
+       buf->dev = get_device(dev);
 
        sgt = &buf->sg_table;
        /*
@@ -227,11 +222,10 @@ static void vb2_dma_sg_finish(void *buf_priv)
        dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir);
 }
 
-static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr,
+static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr,
                                    unsigned long size,
                                    enum dma_data_direction dma_dir)
 {
-       struct vb2_dma_sg_conf *conf = alloc_ctx;
        struct vb2_dma_sg_buf *buf;
        struct sg_table *sgt;
        DEFINE_DMA_ATTRS(attrs);
@@ -243,7 +237,7 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr,
                return NULL;
 
        buf->vaddr = NULL;
-       buf->dev = conf->dev;
+       buf->dev = dev;
        buf->dma_dir = dma_dir;
        buf->offset = vaddr & ~PAGE_MASK;
        buf->size = size;
@@ -617,10 +611,9 @@ static void vb2_dma_sg_detach_dmabuf(void *mem_priv)
        kfree(buf);
 }
 
-static void *vb2_dma_sg_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf,
+static void *vb2_dma_sg_attach_dmabuf(struct device *dev, struct dma_buf *dbuf,
        unsigned long size, enum dma_data_direction dma_dir)
 {
-       struct vb2_dma_sg_conf *conf = alloc_ctx;
        struct vb2_dma_sg_buf *buf;
        struct dma_buf_attachment *dba;
 
@@ -631,7 +624,7 @@ static void *vb2_dma_sg_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf,
        if (!buf)
                return ERR_PTR(-ENOMEM);
 
-       buf->dev = conf->dev;
+       buf->dev = dev;
        /* create attachment for the dmabuf with the user device */
        dba = dma_buf_attach(dbuf, buf->dev);
        if (IS_ERR(dba)) {
@@ -673,27 +666,6 @@ const struct vb2_mem_ops vb2_dma_sg_memops = {
 };
 EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);
 
-void *vb2_dma_sg_init_ctx(struct device *dev)
-{
-       struct vb2_dma_sg_conf *conf;
-
-       conf = kzalloc(sizeof(*conf), GFP_KERNEL);
-       if (!conf)
-               return ERR_PTR(-ENOMEM);
-
-       conf->dev = dev;
-
-       return conf;
-}
-EXPORT_SYMBOL_GPL(vb2_dma_sg_init_ctx);
-
-void vb2_dma_sg_cleanup_ctx(void *alloc_ctx)
-{
-       if (!IS_ERR_OR_NULL(alloc_ctx))
-               kfree(alloc_ctx);
-}
-EXPORT_SYMBOL_GPL(vb2_dma_sg_cleanup_ctx);
-
 MODULE_DESCRIPTION("dma scatter/gather memory handling routines for videobuf2");
 MODULE_AUTHOR("Andrzej Pietrasiewicz");
 MODULE_LICENSE("GPL");
index fb94c80e9aa87f72de6b74d08fee375ef6d81976..7e8a07ed8d825fd6d508fe9da9df3802461543c3 100644 (file)
@@ -33,7 +33,7 @@ struct vb2_vmalloc_buf {
 
 static void vb2_vmalloc_put(void *buf_priv);
 
-static void *vb2_vmalloc_alloc(void *alloc_ctx, const struct dma_attrs *attrs,
+static void *vb2_vmalloc_alloc(struct device *dev, const struct dma_attrs *attrs,
                               unsigned long size, enum dma_data_direction dma_dir,
                               gfp_t gfp_flags)
 {
@@ -70,7 +70,7 @@ static void vb2_vmalloc_put(void *buf_priv)
        }
 }
 
-static void *vb2_vmalloc_get_userptr(void *alloc_ctx, unsigned long vaddr,
+static void *vb2_vmalloc_get_userptr(struct device *dev, unsigned long vaddr,
                                     unsigned long size,
                                     enum dma_data_direction dma_dir)
 {
@@ -404,7 +404,7 @@ static void vb2_vmalloc_detach_dmabuf(void *mem_priv)
        kfree(buf);
 }
 
-static void *vb2_vmalloc_attach_dmabuf(void *alloc_ctx, struct dma_buf *dbuf,
+static void *vb2_vmalloc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf,
        unsigned long size, enum dma_data_direction dma_dir)
 {
        struct vb2_vmalloc_buf *buf;
index 77e66e75ffce577c27c6403f8427134fb56f30ce..3319fb8f7d016686799661b6556de0aaa7a52c23 100644 (file)
@@ -1091,7 +1091,7 @@ vpfe_g_dv_timings(struct file *file, void *fh,
  * @nbuffers: ptr to number of buffers requested by application
  * @nplanes:: contains number of distinct video planes needed to hold a frame
  * @sizes[]: contains the size (in bytes) of each plane.
- * @alloc_ctxs: ptr to allocation context
+ * @alloc_devs: ptr to allocation context
  *
  * This callback function is called when reqbuf() is called to adjust
  * the buffer nbuffers and buffer size
@@ -1099,7 +1099,7 @@ vpfe_g_dv_timings(struct file *file, void *fh,
 static int
 vpfe_buffer_queue_setup(struct vb2_queue *vq,
                        unsigned int *nbuffers, unsigned int *nplanes,
-                       unsigned int sizes[], void *alloc_ctxs[])
+                       unsigned int sizes[], struct device *alloc_devs[])
 {
        struct vpfe_fh *fh = vb2_get_drv_priv(vq);
        struct vpfe_video_device *video = fh->video;
index 3c077e3782670515f56315ad140a2a6dc8f8f3e6..90b7ff56722d30a2d2c1324d492ac402d6f0fd4a 100644 (file)
@@ -298,7 +298,7 @@ iss_video_check_format(struct iss_video *video, struct iss_video_fh *vfh)
 
 static int iss_video_queue_setup(struct vb2_queue *vq,
                                 unsigned int *count, unsigned int *num_planes,
-                                unsigned int sizes[], void *alloc_ctxs[])
+                                unsigned int sizes[], struct device *alloc_devs[])
 {
        struct iss_video_fh *vfh = vb2_get_drv_priv(vq);
        struct iss_video *video = vfh->video;
index 4e2ef9decbe27f65bdce9ae7c55aef7e739a9780..9bf32aec2fc6e2a8a85c326c1c1e0bdad8690833 100644 (file)
@@ -130,7 +130,7 @@ static void tw686x_get_format(struct tw686x_video_channel *vc,
 
 static int tw686x_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
                              unsigned int *nplanes, unsigned int sizes[],
-                             void *alloc_ctxs[])
+                             struct device *alloc_devs[])
 {
        struct tw686x_video_channel *vc = vb2_get_drv_priv(vq);
        unsigned int size = vc->width * vc->height * vc->format->depth / 8;
index 912694f3d54ec807c6090336007067241b7649a4..6377e9fee6e5988fdc679b7b708d038ede0e710c 100644 (file)
@@ -43,7 +43,7 @@
 
 static int uvc_queue_setup(struct vb2_queue *vq,
                           unsigned int *nbuffers, unsigned int *nplanes,
-                          unsigned int sizes[], void *alloc_ctxs[])
+                          unsigned int sizes[], struct device *alloc_devs[])
 {
        struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
        struct uvc_video *video = container_of(queue, struct uvc_video, queue);
index d38668c2ea06b36a6677e927c7cd0a2d80dcc059..bea81c9e37581c3318baabbbef5238974df7dae7 100644 (file)
@@ -56,7 +56,7 @@ struct vb2_threadio_data;
  * @put_userptr: inform the allocator that a USERPTR buffer will no longer
  *              be used.
  * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation;
- *                used for DMABUF memory types; alloc_ctx is the alloc context
+ *                used for DMABUF memory types; dev is the alloc device
  *                dbuf is the shared dma_buf; returns NULL on failure;
  *                allocator private per-buffer structure on success;
  *                this needs to be used for further accesses to the buffer.
@@ -92,13 +92,13 @@ struct vb2_threadio_data;
  *                               unmap_dmabuf.
  */
 struct vb2_mem_ops {
-       void            *(*alloc)(void *alloc_ctx, const struct dma_attrs *attrs,
+       void            *(*alloc)(struct device *dev, const struct dma_attrs *attrs,
                                  unsigned long size, enum dma_data_direction dma_dir,
                                  gfp_t gfp_flags);
        void            (*put)(void *buf_priv);
        struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags);
 
-       void            *(*get_userptr)(void *alloc_ctx, unsigned long vaddr,
+       void            *(*get_userptr)(struct device *dev, unsigned long vaddr,
                                        unsigned long size,
                                        enum dma_data_direction dma_dir);
        void            (*put_userptr)(void *buf_priv);
@@ -106,7 +106,7 @@ struct vb2_mem_ops {
        void            (*prepare)(void *buf_priv);
        void            (*finish)(void *buf_priv);
 
-       void            *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf,
+       void            *(*attach_dmabuf)(struct device *dev, struct dma_buf *dbuf,
                                          unsigned long size,
                                          enum dma_data_direction dma_dir);
        void            (*detach_dmabuf)(void *buf_priv);
@@ -281,7 +281,7 @@ struct vb2_buffer {
  *                     in *num_buffers, the required number of planes per
  *                     buffer in *num_planes, the size of each plane should be
  *                     set in the sizes[] array and optional per-plane
- *                     allocator specific context in the alloc_ctxs[] array.
+ *                     allocator specific device in the alloc_devs[] array.
  *                     When called from VIDIOC_REQBUFS, *num_planes == 0, the
  *                     driver has to use the currently configured format to
  *                     determine the plane sizes and *num_buffers is the total
@@ -355,7 +355,7 @@ struct vb2_buffer {
 struct vb2_ops {
        int (*queue_setup)(struct vb2_queue *q,
                           unsigned int *num_buffers, unsigned int *num_planes,
-                          unsigned int sizes[], void *alloc_ctxs[]);
+                          unsigned int sizes[], struct device *alloc_devs[]);
 
        void (*wait_prepare)(struct vb2_queue *q);
        void (*wait_finish)(struct vb2_queue *q);
@@ -401,7 +401,7 @@ struct vb2_buf_ops {
  *             the V4L2_BUF_TYPE_* in include/uapi/linux/videodev2.h
  * @io_modes:  supported io methods (see vb2_io_modes enum)
  * @dev:       device to use for the default allocation context if the driver
- *             doesn't fill in the @alloc_ctx array.
+ *             doesn't fill in the @alloc_devs array.
  * @dma_attrs: DMA attributes to use for the DMA. May be NULL.
  * @fileio_read_once:          report EOF after reading the first buffer
  * @fileio_write_immediately:  queue buffer after each write() call
@@ -449,7 +449,7 @@ struct vb2_buf_ops {
  * @done_list: list of buffers ready to be dequeued to userspace
  * @done_lock: lock to protect done_list list
  * @done_wq:   waitqueue for processes waiting for buffers ready to be dequeued
- * @alloc_ctx: memory type/allocator-specific contexts for each plane
+ * @alloc_devs:        memory type/allocator-specific per-plane device
  * @streaming: current streaming state
  * @start_streaming_called: start_streaming() was called successfully and we
  *             started streaming.
@@ -503,7 +503,7 @@ struct vb2_queue {
        spinlock_t                      done_lock;
        wait_queue_head_t               done_wq;
 
-       void                            *alloc_ctx[VB2_MAX_PLANES];
+       struct device                   *alloc_devs[VB2_MAX_PLANES];
 
        unsigned int                    streaming:1;
        unsigned int                    start_streaming_called:1;
index 5bdd4a4072e51bfd91a82fd52c794b2603f335f7..df2aabee3401aa2b2b04164dc504239a4733ca57 100644 (file)
@@ -26,8 +26,6 @@ vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no)
        return *addr;
 }
 
-void *vb2_dma_contig_init_ctx(struct device *dev);
-void vb2_dma_contig_cleanup_ctx(void *alloc_ctx);
 int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size);
 void vb2_dma_contig_clear_max_seg_size(struct device *dev);
 
index 8d1083f83c3dc1ea469fa21dd297db5990670849..52afa0e2bb17105f642ac6fcd07355cfa450477a 100644 (file)
@@ -21,9 +21,6 @@ static inline struct sg_table *vb2_dma_sg_plane_desc(
        return (struct sg_table *)vb2_plane_cookie(vb, plane_no);
 }
 
-void *vb2_dma_sg_init_ctx(struct device *dev);
-void vb2_dma_sg_cleanup_ctx(void *alloc_ctx);
-
 extern const struct vb2_mem_ops vb2_dma_sg_memops;
 
 #endif
index 5f91d76260ff7dff1944d124f5714e824a7c923e..93b76c3220fddc888397c0005507eeafdd1fb6a3 100644 (file)
@@ -163,7 +163,7 @@ static irqreturn_t skeleton_irq(int irq, void *dev_id)
  */
 static int queue_setup(struct vb2_queue *vq,
                       unsigned int *nbuffers, unsigned int *nplanes,
-                      unsigned int sizes[], void *alloc_ctxs[])
+                      unsigned int sizes[], struct device *alloc_devs[])
 {
        struct skeleton *skel = vb2_get_drv_priv(vq);