linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
	kernel@collabora.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Steve Longerbeam <slongerbeam@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH v2] media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}
Date: Wed, 26 Feb 2020 14:28:08 -0300	[thread overview]
Message-ID: <f0798d3bebaa52bdcf613120f56791d76229b276.camel@collabora.com> (raw)
In-Reply-To: <20200226155336.GO5023@valkosipuli.retiisi.org.uk>

Hello Sakari,

Thanks a lot for your comments.

On Wed, 2020-02-26 at 17:53 +0200, Sakari Ailus wrote:
> Hi Ezequiel,
> 
> On Fri, Jan 24, 2020 at 05:35:43PM -0300, Ezequiel Garcia wrote:
> > Currently, v4l2_pipeline_pm_use() prototype is:
> > 
> >   int v4l2_pipeline_pm_use(struct media_entity *entity, int use)
> > 
> > Where the 'use' argument shall only be set to '1' for enable/power-on,
> > or to '0' for disable/power-off. The integer return is specified
> > as only meaningful when 'use' is set to '1'.
> > 
> > Let's enforce this semantic by splitting the function in two:
> > v4l2_pipeline_pm_get and v4l2_pipeline_pm_put. This is done
> > for several reasons.
> > 
> > It makes the API easier to use (or harder to misuse).
> > It removes the constraint on the values the 'use' argument
> > shall take. Also, it removes the need to constraint
> > the return value, by making v4l2_pipeline_pm_put void return.
> > 
> > And last, it's more consistent with other kernel APIs, such
> > as the runtime pm APIs, which makes the code more symmetric.
> 
> Indeed. These functions only exist because not all sensor etc. drivers have
> been converted to runtime PM yet. New drivers no longer implement s_power
> callbacks.
> 
> I don't object the patch as such, but I think you could also add a note
> that relying on the s_power callback is deprecated. This probably should be
> a separate patch.
> 

Hans picked this patch, sending a pull request yesterday which includes it.

Since you know this API better than me, I thikn it would be best
if you take care of sending a patch for it.

In particular, I'd like to know as reference, if any changes are needed
RKISP1 and sensors such as IMX219 in order to avoid relying in the deprecated
API.

Moreover, is there any way we can add some build time or run time warning,
to avoid developers from using an API that is deprecated?

Thanks!
Ezequiel


  reply	other threads:[~2020-02-26 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 20:35 [PATCH v2] media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put} Ezequiel Garcia
2020-02-26 15:53 ` Sakari Ailus
2020-02-26 17:28   ` Ezequiel Garcia [this message]
2020-02-26 20:38     ` Sakari Ailus
2020-02-26 21:08       ` Ezequiel Garcia
2020-02-26 21:20         ` Sakari Ailus
2020-02-27 12:48           ` Ezequiel Garcia

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=f0798d3bebaa52bdcf613120f56791d76229b276.camel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=sakari.ailus@iki.fi \
    --cc=slongerbeam@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;
as well as URLs for NNTP newsgroup(s).