Re: [PATCH 05/30] media: atomisp: Replace source-pad checks with run-mode checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 13, 2023 at 3:32 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Currently atomisp behavior is determined by a mix of which /dev/video# node
> (which isp-subdev source-pad) is opened + which run-mode is set.
> With various combinations not being allowed and likely leading to crashes
> due to lack of error checking.
>
> Now that we no longer support continuous mode and thus no longer support
> streaming from 2 /dev/video# nodes at the same time, there is no need
> to have a separate /dev/video# node for each run-mode. Instead the plan is
> to support the 3 different run-modes on a single /dev/video# node.
> Since we are moving to a single isp-subdev source-pad, the behavior should
> then be solely and consistently be defined by the run-mode.
>
> Replace various source-pad checks with run-mode checks in preparation for
> moving to a single source-pad. In some places the new run-mode checks
> overlap with existing run-mode checks and the checks are folded together
> into a single check.
>
> This removes handling of the ATOMISP_SUBDEV_PAD_SOURCE_VF source-pad,
> this source-pad was only useful for continuous mode, for which support has
> been removed.
>
> Note that currently the only run-mode which we actually have been able to
> get to work is the video-capture with scaler aka preview mode and as such
> that is also the only run-mode tested. This patch is intended to preserve
> the current (known to not work 100%) behavior of the other run-modes, so
> that those maybe can be enabled later.

...

> @@ -5005,16 +4993,11 @@ static int atomisp_get_pipe_id(struct atomisp_video_pipe *pipe)

It seems to me that all 'else':s in this function are redundant.
At least you can probably drop them either here or in a separate change.

>                 return IA_CSS_PIPE_ID_VIDEO;
>         } else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_LOWLAT) {
>                 return IA_CSS_PIPE_ID_CAPTURE;
> -       } else if (pipe == &asd->video_out_video_capture) {
> +       } else if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) {
>                 return IA_CSS_PIPE_ID_VIDEO;
> -       } else if (pipe == &asd->video_out_vf) {
> -               return IA_CSS_PIPE_ID_CAPTURE;
> -       } else if (pipe == &asd->video_out_preview) {
> -               if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO)
> -                       return IA_CSS_PIPE_ID_VIDEO;
> -               else
> -                       return IA_CSS_PIPE_ID_PREVIEW;
> -       } else if (pipe == &asd->video_out_capture) {
> +       } else if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
> +               return IA_CSS_PIPE_ID_PREVIEW;
> +       } else if (asd->run_mode->val == ATOMISP_RUN_MODE_STILL_CAPTURE) {
>                 if (asd->copy_mode)
>                         return IA_CSS_PIPE_ID_COPY;
>                 else

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux