All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	linux-media@vger.kernel.org, kyungmin.park@samsung.com,
	sw0312.kim@samsung.com, a.hajda@samsung.com,
	hj210.choi@samsung.com, shaik.ameer@samsung.com,
	arun.kk@samsung.com
Subject: Re: [REVIEW PATCH v3 1/2] media: Change media device link_notify behaviour
Date: Mon, 10 Jun 2013 12:49:01 +0200	[thread overview]
Message-ID: <17805842.6Cz4b94dag@avalon> (raw)
In-Reply-To: <51B5AEA6.1080509@samsung.com>

On Monday 10 June 2013 12:47:02 Sylwester Nawrocki wrote:
> On 06/10/2013 12:10 AM, Sakari Ailus wrote:
> > Sylwester Nawrocki wrote:
> > ...
> > 
> >> diff --git a/drivers/media/platform/omap3isp/isp.c
> >> b/drivers/media/platform/omap3isp/isp.c index 1d7dbd5..1a2d25c 100644
> >> --- a/drivers/media/platform/omap3isp/isp.c
> >> +++ b/drivers/media/platform/omap3isp/isp.c
> >> @@ -792,9 +792,9 @@ int omap3isp_pipeline_pm_use(struct media_entity
> >> *entity, int use)>> 
> >>   /*
> >>   
> >>    * isp_pipeline_link_notify - Link management notification callback
> >> 
> >> - * @source: Pad at the start of the link
> >> - * @sink: Pad at the end of the link
> >> + * @link: The link
> >> 
> >>    * @flags: New link flags that will be applied
> >> 
> >> + * @notification: The link's state change notification type
> >> (MEDIA_DEV_NOTIFY_*)>> 
> >>    *
> >>    * React to link management on powered pipelines by updating the use
> >>    count of * all entities in the source and sink sides of the link.
> >>    Entities are powered>> 
> >> @@ -804,29 +804,38 @@ int omap3isp_pipeline_pm_use(struct media_entity
> >> *entity, int use)>> 
> >>    * off is assumed to never fail. This function will not fail for
> >>    disconnection * events.
> >>    */
> >> 
> >> -static int isp_pipeline_link_notify(struct media_pad *source,
> >> -				    struct media_pad *sink, u32 flags)
> >> +static int isp_pipeline_link_notify(struct media_link *link, u32 flags,
> >> +				    unsigned int notification)
> >> 
> >>   {
> >> 
> >> -	int source_use = isp_pipeline_pm_use_count(source->entity);
> >> -	int sink_use = isp_pipeline_pm_use_count(sink->entity);
> >> +	struct media_entity *source = link->source->entity;
> >> +	struct media_entity *sink = link->sink->entity;
> >> +	int source_use = isp_pipeline_pm_use_count(source);
> >> +	int sink_use = isp_pipeline_pm_use_count(sink);
> >> 
> >>   	int ret;
> >> 
> >> -	if (!(flags & MEDIA_LNK_FL_ENABLED)) {
> >> +	if (notification == MEDIA_DEV_NOTIFY_POST_LINK_CH &&
> >> +	    !(link->flags & MEDIA_LNK_FL_ENABLED)) {
> >> 
> >>   		/* Powering off entities is assumed to never fail. */
> >> 
> >> -		isp_pipeline_pm_power(source->entity, -sink_use);
> >> -		isp_pipeline_pm_power(sink->entity, -source_use);
> >> +		isp_pipeline_pm_power(source, -sink_use);
> >> +		isp_pipeline_pm_power(sink, -source_use);
> >> 
> >>   		return 0;
> >>   	
> >>   	}
> >> 
> >> -	ret = isp_pipeline_pm_power(source->entity, sink_use);
> >> -	if (ret < 0)
> >> -		return ret;
> >> +	if (notification == MEDIA_DEV_NOTIFY_PRE_LINK_CH &&
> >> +		(flags & MEDIA_LNK_FL_ENABLED)) {
> > 
> > You could return zero here if the opposite was true, and unindent the
> > rest. Up to you --- the patch is fine.

I would personally keep the code as-is, to keep the symmetry, but I'm fine 
with both :-)

> All right, thanks for the Ack. An updated patch to follow.
> 
> > Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
> > 
> >> -	ret = isp_pipeline_pm_power(sink->entity, source_use);
> >> -	if (ret < 0)
> >> -		isp_pipeline_pm_power(source->entity, -sink_use);
> >> +		ret = isp_pipeline_pm_power(source, sink_use);
> >> +		if (ret < 0)
> >> +			return ret;
> >> 
> >> -	return ret;
> >> +		ret = isp_pipeline_pm_power(sink, source_use);
> >> +		if (ret < 0)
> >> +			isp_pipeline_pm_power(source, -sink_use);
> >> +
> >> +		return ret;
> >> +	}
> >> +
> >> +	return 0;
> >> 
> >>   }

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2013-06-10 10:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 20:14 [REVIEW PATCH v3 0/2] Media link_notify behaviour change and exynos4-is updates Sylwester Nawrocki
2013-06-09 20:14 ` [REVIEW PATCH v3 1/2] media: Change media device link_notify behaviour Sylwester Nawrocki
2013-06-09 20:33   ` Laurent Pinchart
2013-06-09 22:10   ` Sakari Ailus
2013-06-10  9:46     ` Laurent Pinchart
2013-06-10 10:20       ` Sylwester Nawrocki
2013-06-10 10:21         ` Laurent Pinchart
2013-06-10 10:47     ` Sylwester Nawrocki
2013-06-10 10:49       ` Laurent Pinchart [this message]
2013-06-10 10:59         ` Sylwester Nawrocki
2013-06-09 20:14 ` [REVIEW PATCH v3 2/2] exynos4-is: Extend link_notify handler to support fimc-is/lite pipelines Sylwester Nawrocki

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=17805842.6Cz4b94dag@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=arun.kk@samsung.com \
    --cc=hj210.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    --cc=shaik.ameer@samsung.com \
    --cc=sw0312.kim@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.