media: atomisp: Remove the outq videobuf queue
authorHans de Goede <hdegoede@redhat.com>
Sat, 27 Aug 2022 14:39:10 +0000 (16:39 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 07:51:02 +0000 (09:51 +0200)
After the file-injection support removal the outq videobuf queue is
no longer used, remove it.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_subdev.c
drivers/staging/media/atomisp/pci/atomisp_subdev.h

index 08b62fc..d6a7198 100644 (file)
@@ -593,47 +593,6 @@ static void atomisp_buf_release(struct videobuf_queue *vq,
        atomisp_videobuf_free_buf(vb);
 }
 
-static int atomisp_buf_setup_output(struct videobuf_queue *vq,
-                                   unsigned int *count, unsigned int *size)
-{
-       struct atomisp_video_pipe *pipe = vq->priv_data;
-
-       *size = pipe->pix.sizeimage;
-
-       return 0;
-}
-
-static int atomisp_buf_prepare_output(struct videobuf_queue *vq,
-                                     struct videobuf_buffer *vb,
-                                     enum v4l2_field field)
-{
-       struct atomisp_video_pipe *pipe = vq->priv_data;
-
-       vb->size = pipe->pix.sizeimage;
-       vb->width = pipe->pix.width;
-       vb->height = pipe->pix.height;
-       vb->field = field;
-       vb->state = VIDEOBUF_PREPARED;
-
-       return 0;
-}
-
-static void atomisp_buf_queue_output(struct videobuf_queue *vq,
-                                    struct videobuf_buffer *vb)
-{
-       struct atomisp_video_pipe *pipe = vq->priv_data;
-
-       list_add_tail(&vb->queue, &pipe->activeq_out);
-       vb->state = VIDEOBUF_QUEUED;
-}
-
-static void atomisp_buf_release_output(struct videobuf_queue *vq,
-                                      struct videobuf_buffer *vb)
-{
-       videobuf_vmalloc_free(vb);
-       vb->state = VIDEOBUF_NEEDS_INIT;
-}
-
 static const struct videobuf_queue_ops videobuf_qops = {
        .buf_setup      = atomisp_buf_setup,
        .buf_prepare    = atomisp_buf_prepare,
@@ -641,13 +600,6 @@ static const struct videobuf_queue_ops videobuf_qops = {
        .buf_release    = atomisp_buf_release,
 };
 
-static const struct videobuf_queue_ops videobuf_qops_output = {
-       .buf_setup      = atomisp_buf_setup_output,
-       .buf_prepare    = atomisp_buf_prepare_output,
-       .buf_queue      = atomisp_buf_queue_output,
-       .buf_release    = atomisp_buf_release_output,
-};
-
 static int atomisp_init_pipe(struct atomisp_video_pipe *pipe)
 {
        /* init locks */
@@ -660,15 +612,7 @@ static int atomisp_init_pipe(struct atomisp_video_pipe *pipe)
                                    sizeof(struct atomisp_buffer), pipe,
                                    NULL);      /* ext_lock: NULL */
 
-       videobuf_queue_vmalloc_init(&pipe->outq, &videobuf_qops_output, NULL,
-                                   &pipe->irq_lock,
-                                   V4L2_BUF_TYPE_VIDEO_OUTPUT,
-                                   V4L2_FIELD_NONE,
-                                   sizeof(struct atomisp_buffer), pipe,
-                                   NULL);      /* ext_lock: NULL */
-
        INIT_LIST_HEAD(&pipe->activeq);
-       INIT_LIST_HEAD(&pipe->activeq_out);
        INIT_LIST_HEAD(&pipe->buffers_waiting_for_param);
        INIT_LIST_HEAD(&pipe->per_frame_params);
        memset(pipe->frame_request_config_id, 0,
@@ -964,12 +908,6 @@ static int atomisp_release(struct file *file)
                goto done;
        }
 
-       if (pipe->outq.bufs[0]) {
-               mutex_lock(&pipe->outq.vb_lock);
-               videobuf_queue_cancel(&pipe->outq);
-               mutex_unlock(&pipe->outq.vb_lock);
-       }
-
        /*
         * A little trick here:
         * file injection input resolution is recorded in the sink pad,
index 1509543..e05aeb0 100644 (file)
@@ -1066,7 +1066,6 @@ static void atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
        pipe->isp = asd->isp;
        spin_lock_init(&pipe->irq_lock);
        INIT_LIST_HEAD(&pipe->activeq);
-       INIT_LIST_HEAD(&pipe->activeq_out);
        INIT_LIST_HEAD(&pipe->buffers_waiting_for_param);
        INIT_LIST_HEAD(&pipe->per_frame_params);
        memset(pipe->frame_request_config_id,
index 938d427..d89ae32 100644 (file)
@@ -70,9 +70,7 @@ struct atomisp_video_pipe {
        enum v4l2_buf_type type;
        struct media_pad pad;
        struct videobuf_queue capq;
-       struct videobuf_queue outq;
        struct list_head activeq;
-       struct list_head activeq_out;
        /*
         * the buffers waiting for per-frame parameters, this is only valid
         * in per-frame setting mode.
@@ -86,9 +84,10 @@ struct atomisp_video_pipe {
 
        unsigned int buffers_in_css;
 
-       /* irq_lock is used to protect video buffer state change operations and
-        * also to make activeq, activeq_out, capq and outq list
-        * operations atomic. */
+       /*
+        * irq_lock is used to protect video buffer state change operations and
+        * also to make activeq and capq operations atomic.
+        */
        spinlock_t irq_lock;
        unsigned int users;