media: atomisp: Rename video_out_preview to video_out
authorHans de Goede <hdegoede@redhat.com>
Sun, 7 May 2023 19:42:26 +0000 (20:42 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 13:31:40 +0000 (14:31 +0100)
Now that we have only 1 /dev/video# node for output for all different
run-modes (with only 1 run-mode at a time) using video_out_preview for
the remaining atomisp_pipe does not properly reflect that this is
*the* output pipe. Fo the following renames to fix the naming:

s/video_out_preview/video_out/
s/ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW/ATOMISP_SUBDEV_PAD_SOURCE/

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.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_cmd.c
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_ioctl.c
drivers/staging/media/atomisp/pci/atomisp_subdev.c
drivers/staging/media/atomisp/pci/atomisp_subdev.h

index 3d6e0d0..8cd9418 100644 (file)
@@ -643,7 +643,7 @@ void atomisp_flush_video_pipe(struct atomisp_video_pipe *pipe, enum vb2_buffer_s
 /* Returns queued buffers back to video-core */
 void atomisp_flush_bufs_and_wakeup(struct atomisp_sub_device *asd)
 {
-       atomisp_flush_video_pipe(&asd->video_out_preview, VB2_BUF_STATE_ERROR, false);
+       atomisp_flush_video_pipe(&asd->video_out, VB2_BUF_STATE_ERROR, false);
 }
 
 /* clean out the parameters that did not apply */
@@ -1032,7 +1032,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
                atomisp_flush_bufs_and_wakeup(&isp->asd);
 
                /* Requeue unprocessed per-frame parameters. */
-               atomisp_recover_params_queue(&isp->asd.video_out_preview);
+               atomisp_recover_params_queue(&isp->asd.video_out);
 
                ret = v4l2_subdev_call(
                          isp->inputs[isp->asd.input_curr].camera, video,
@@ -1293,7 +1293,7 @@ static void atomisp_update_capture_mode(struct atomisp_sub_device *asd)
                atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_ADVANCED);
        else if (asd->params.low_light)
                atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_LOW_LIGHT);
-       else if (asd->video_out_preview.sh_fmt == IA_CSS_FRAME_FORMAT_RAW)
+       else if (asd->video_out.sh_fmt == IA_CSS_FRAME_FORMAT_RAW)
                atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_RAW);
        else
                atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_PRIMARY);
index 8e8caa9..d5b9c0f 100644 (file)
@@ -1958,7 +1958,7 @@ void atomisp_css_stop(struct atomisp_sub_device *asd,
                list_splice_init(&asd->metadata_ready[i], &asd->metadata[i]);
        }
 
-       atomisp_flush_params_queue(&asd->video_out_preview);
+       atomisp_flush_params_queue(&asd->video_out);
        atomisp_free_css_parameters(&asd->params.css_param);
        memset(&asd->params.css_param, 0, sizeof(asd->params.css_param));
 }
index 99152db..ccd9646 100644 (file)
@@ -362,7 +362,7 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
                pipe_id = IA_CSS_PIPE_ID_CAPTURE;
        }
 
-       atomisp_q_video_buffers_to_css(asd, &asd->video_out_preview,
+       atomisp_q_video_buffers_to_css(asd, &asd->video_out,
                                       ATOMISP_INPUT_STREAM_GENERAL,
                                       IA_CSS_BUFFER_TYPE_OUTPUT_FRAME, pipe_id);
        return 0;
@@ -494,7 +494,7 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd)
  */
 static unsigned int atomisp_subdev_users(struct atomisp_sub_device *asd)
 {
-       return asd->video_out_preview.users;
+       return asd->video_out.users;
 }
 
 unsigned int atomisp_dev_users(struct atomisp_device *isp)
index 3068f1a..1684ea6 100644 (file)
@@ -618,7 +618,7 @@ static int atomisp_enum_input(struct file *file, void *fh,
 static unsigned int
 atomisp_subdev_streaming_count(struct atomisp_sub_device *asd)
 {
-       return vb2_start_streaming_called(&asd->video_out_preview.vb_queue);
+       return vb2_start_streaming_called(&asd->video_out.vb_queue);
 }
 
 unsigned int atomisp_streaming_count(struct atomisp_device *isp)
index d7da8d0..a9da366 100644 (file)
@@ -355,7 +355,7 @@ static const char *atomisp_pad_str(unsigned int pad)
 {
        static const char *const pad_str[] = {
                "ATOMISP_SUBDEV_PAD_SINK",
-               "ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW",
+               "ATOMISP_SUBDEV_PAD_SOURCE",
        };
 
        if (pad >= ARRAY_SIZE(pad_str))
@@ -431,7 +431,7 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd,
                        struct v4l2_rect tmp = *crop[pad];
 
                        atomisp_subdev_set_selection(sd, sd_state, which,
-                                                    ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW,
+                                                    ATOMISP_SUBDEV_PAD_SOURCE,
                                                     V4L2_SEL_TGT_COMPOSE, flags, &tmp);
                }
 
@@ -593,7 +593,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
 
                break;
        }
-       case ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW:
+       case ATOMISP_SUBDEV_PAD_SOURCE:
                __ffmt->code = ffmt->code;
                break;
        }
@@ -899,12 +899,10 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
        sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        pads[ATOMISP_SUBDEV_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
-       pads[ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW].flags = MEDIA_PAD_FL_SOURCE;
+       pads[ATOMISP_SUBDEV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
 
-       asd->fmt[ATOMISP_SUBDEV_PAD_SINK].fmt.code =
-           MEDIA_BUS_FMT_SBGGR10_1X10;
-       asd->fmt[ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW].fmt.code =
-           MEDIA_BUS_FMT_SBGGR10_1X10;
+       asd->fmt[ATOMISP_SUBDEV_PAD_SINK].fmt.code = MEDIA_BUS_FMT_SBGGR10_1X10;
+       asd->fmt[ATOMISP_SUBDEV_PAD_SOURCE].fmt.code = MEDIA_BUS_FMT_SBGGR10_1X10;
 
        me->ops = &isp_subdev_media_ops;
        me->function = MEDIA_ENT_F_PROC_VIDEO_ISP;
@@ -912,13 +910,11 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
        if (ret < 0)
                return ret;
 
-       ret = atomisp_init_subdev_pipe(asd, &asd->video_out_preview,
-                                      V4L2_BUF_TYPE_VIDEO_CAPTURE);
+       ret = atomisp_init_subdev_pipe(asd, &asd->video_out, V4L2_BUF_TYPE_VIDEO_CAPTURE);
        if (ret)
                return ret;
 
-       ret = atomisp_video_init(&asd->video_out_preview, "PREVIEW",
-                                ATOMISP_RUN_MODE_PREVIEW);
+       ret = atomisp_video_init(&asd->video_out, "PREVIEW", ATOMISP_RUN_MODE_PREVIEW);
        if (ret < 0)
                return ret;
 
@@ -980,9 +976,8 @@ int atomisp_create_pads_links(struct atomisp_device *isp)
                        return ret;
        }
 
-       ret = media_create_pad_link(&isp->asd.subdev.entity,
-                                   ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW,
-                                   &isp->asd.video_out_preview.vdev.entity, 0, 0);
+       ret = media_create_pad_link(&isp->asd.subdev.entity, ATOMISP_SUBDEV_PAD_SOURCE,
+                                   &isp->asd.video_out.vdev.entity, 0, 0);
        if (ret < 0)
                return ret;
 
@@ -1014,7 +1009,7 @@ void atomisp_subdev_unregister_entities(struct atomisp_sub_device *asd)
 {
        atomisp_subdev_cleanup_entities(asd);
        v4l2_device_unregister_subdev(&asd->subdev);
-       atomisp_video_unregister(&asd->video_out_preview);
+       atomisp_video_unregister(&asd->video_out);
 }
 
 int atomisp_subdev_register_subdev(struct atomisp_sub_device *asd,
@@ -1028,10 +1023,9 @@ int atomisp_subdev_register_video_nodes(struct atomisp_sub_device *asd,
 {
        int ret;
 
-       asd->video_out_preview.vdev.v4l2_dev = vdev;
-       asd->video_out_preview.vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-       ret = video_register_device(&asd->video_out_preview.vdev,
-                                   VFL_TYPE_VIDEO, -1);
+       asd->video_out.vdev.v4l2_dev = vdev;
+       asd->video_out.vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       ret = video_register_device(&asd->video_out.vdev, VFL_TYPE_VIDEO, -1);
        if (ret < 0)
                goto error;
 
index 2be594a..c4f312c 100644 (file)
@@ -32,7 +32,7 @@
 #define ATOMISP_MAX_EXP_ID     (250)
 
 #define ATOMISP_SUBDEV_PAD_SINK                        0
-#define ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW      1
+#define ATOMISP_SUBDEV_PAD_SOURCE              1
 #define ATOMISP_SUBDEV_PADS_NUM                        2
 
 struct atomisp_in_fmt_conv {
@@ -244,8 +244,7 @@ struct atomisp_sub_device {
        u16 capture_pad; /* main capture pad; defines much of isp config */
 
        unsigned int output;
-       struct atomisp_video_pipe video_out_preview; /* preview output */
-       /* struct isp_subdev_params params; */
+       struct atomisp_video_pipe video_out;
        struct atomisp_device *isp;
        struct v4l2_ctrl_handler ctrl_handler;
        struct v4l2_ctrl *run_mode;