public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Kate Hsuan <hpa@redhat.com>, Tsuchiya Yuto <kitakar@gmail.com>,
	Yury Luneff <yury.lunev@gmail.com>,
	Nable <nable.maininbox@googlemail.com>,
	andrey.i.trufanov@gmail.com, Fabio Aiuto <fabioaiuto83@gmail.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH 02/10] media: atomisp: Remove continuous mode support
Date: Tue, 21 Feb 2023 17:57:56 +0200	[thread overview]
Message-ID: <Y/TqBBdU7dbYPIsW@smile.fi.intel.com> (raw)
In-Reply-To: <20230221145906.8113-3-hdegoede@redhat.com>

On Tue, Feb 21, 2023 at 03:58:58PM +0100, Hans de Goede wrote:
> Continues mode is a special mode where 2 /dev/video devices can be active
> at the same time. Either the video-preview + video nodes or the
> viewfinder (for still capture) + capture nodes.
> 
> For the video-preview + video-recording case modern userspace will
> use a single stream multiplexed by pipewire.
> 
> The still-capture case is extra special only starting the preview
> stream and then relying on a custom ATOMISP_IOC_S_CONT_CAPTURE_CONFIG
> ioctl to set things up followed by a second stream on to capture
> the amount of configured still pictures. While running the sensor
> at full resolution all the time. This case too is better handled
> with dma-buf + GPU downscaling for the view-finder rather then all this
> custom special code. Besises this the ioctl expects a bunch of special
> non error checked conditions to be met otherwise things will crash/hang.
> 
> The continues mode also involves a special cases all over the code
> getting in the way of further cleanups and simplifying the code to
> using just 1 /dev/video# node. So lets remove it and the
> related custom ATOMISP_IOC_S_CONT_CAPTURE_CONFIG ioctl.

...

> +	ret = atomisp_set_fmt_to_snr(vdev, &s_fmt,
> +				     f->fmt.pix.pixelformat, padding_w,

At least one parameter can be moved to the previous line.

> +				     padding_h, dvs_env_w, dvs_env_h);
> +	if (ret) {
> +		dev_warn(isp->dev,
> +			 "Set format to sensor failed with %d\n", ret);
> +		return -EINVAL;

...

>  	case ATOMISP_RUN_MODE_PREVIEW:
> -		if (!asd->continuous_mode->val) {
> -			if (pipe_id == IA_CSS_PIPE_ID_PREVIEW)
> -				return true;
> +		if (pipe_id == IA_CSS_PIPE_ID_PREVIEW)
> +			return true;
>  
> -			return false;
> -		}
> -		fallthrough;
> +		return false;

		return pipe_id == IA_CSS_PIPE_ID_PREVIEW;

...

>  	case ATOMISP_RUN_MODE_VIDEO:
> -		if (!asd->continuous_mode->val) {
> -			if (pipe_id == IA_CSS_PIPE_ID_VIDEO ||
> -			    pipe_id == IA_CSS_PIPE_ID_YUVPP)
> -				return true;
> -			else
> -				return false;
> -		}
> -		fallthrough;
> +		if (pipe_id == IA_CSS_PIPE_ID_VIDEO || pipe_id == IA_CSS_PIPE_ID_YUVPP)
> +			return true;
> +
> +		return false;

Similar.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-02-21 15:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:58 [PATCH 00/10] media: atomisp: Remove depth-mode and continuous mode support Hans de Goede
2023-02-21 14:58 ` [PATCH 01/10] media: atomisp: Remove depth-mode support Hans de Goede
2023-02-21 15:52   ` Andy Shevchenko
2023-02-21 14:58 ` [PATCH 02/10] media: atomisp: Remove continuous mode support Hans de Goede
2023-02-21 15:57   ` Andy Shevchenko [this message]
2023-04-01 10:58     ` Hans de Goede
2023-04-02  6:06       ` Andy Shevchenko
2023-04-02 12:41         ` Hans de Goede
2023-02-22  4:18   ` kernel test robot
2023-02-21 14:58 ` [PATCH 03/10] media: atomisp: Remove delayed_init related code Hans de Goede
2023-02-21 14:59 ` [PATCH 04/10] media: atomisp: Remove crop_needs_override from atomisp_set_fmt() Hans de Goede
2023-02-21 16:00   ` Andy Shevchenko
2023-04-01 11:06     ` Hans de Goede
2023-02-21 14:59 ` [PATCH 05/10] media: atomisp: Remove atomisp_css_enable_raw_binning() Hans de Goede
2023-02-21 14:59 ` [PATCH 06/10] media: atomisp: Remove atomisp_get_metadata_type() Hans de Goede
2023-02-21 14:59 ` [PATCH 07/10] media: atomisp: Remove unused SOC_CAMERA, XENON_FLASH and FILE_INPUT subdev types Hans de Goede
2023-02-21 14:59 ` [PATCH 08/10] media: atomisp: Remove ATOMISP_USE_YUVPP() Hans de Goede
2023-02-21 14:59 ` [PATCH 09/10] media: atomisp: Remove yuvpp_mode Hans de Goede
2023-02-21 14:59 ` [PATCH 10/10] media: atomisp: Remove online_process setting Hans de Goede
2023-02-21 16:04 ` [PATCH 00/10] media: atomisp: Remove depth-mode and continuous mode support Andy Shevchenko
2023-04-01 11:09   ` Hans de Goede
2023-02-23  9:17 ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/TqBBdU7dbYPIsW@smile.fi.intel.com \
    --to=andy@kernel.org \
    --cc=andrey.i.trufanov@gmail.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@redhat.com \
    --cc=kitakar@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nable.maininbox@googlemail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yury.lunev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox