linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] media: entity: Swap pads if route is checked from source to sink
@ 2016-11-08 10:11 Sakari Ailus
  2017-03-07 11:15 ` Niklas Söderlund
  0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2016-11-08 10:11 UTC (permalink / raw)
  To: linux-media; +Cc: niklas.soderlund

This way the pads are always passed to the has_route() op sink pad first.
Makes sense.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Niklas,

This should make it easier to implement the has_route() op in drivers.

Feel free to merge this to "[PATCH 02/32] media: entity: Add
media_entity_has_route() function" if you like, or add separately after
the second patch.

 drivers/media/media-entity.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 747adcb..520f3f6 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -254,6 +254,10 @@ bool media_entity_has_route(struct media_entity *entity, unsigned int pad0,
 	if (!entity->ops || !entity->ops->has_route)
 		return true;
 
+	if (entity->pads[pad0].flags & MEDIA_PAD_FL_SOURCE
+	    && entity->pads[pad1].flags & MEDIA_PAD_FL_SINK)
+		swap(pad0, pad1);
+
 	return entity->ops->has_route(entity, pad0, pad1);
 }
 EXPORT_SYMBOL_GPL(media_entity_has_route);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] media: entity: Swap pads if route is checked from source to sink
  2016-11-08 10:11 [PATCH 1/1] media: entity: Swap pads if route is checked from source to sink Sakari Ailus
@ 2017-03-07 11:15 ` Niklas Söderlund
  2017-03-07 11:17   ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Niklas Söderlund @ 2017-03-07 11:15 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

Hi Sakari,

Thanks for the patch.

On 2016-11-08 12:11:15 +0200, Sakari Ailus wrote:
> This way the pads are always passed to the has_route() op sink pad first.
> Makes sense.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Hi Niklas,
> 
> This should make it easier to implement the has_route() op in drivers.
> 
> Feel free to merge this to "[PATCH 02/32] media: entity: Add
> media_entity_has_route() function" if you like, or add separately after
> the second patch.

I choose to append this as a separated patch on top of Laurents patches 
and include all 3 in my next R-Car VIN series.

> 
>  drivers/media/media-entity.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index 747adcb..520f3f6 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -254,6 +254,10 @@ bool media_entity_has_route(struct media_entity *entity, unsigned int pad0,
>  	if (!entity->ops || !entity->ops->has_route)
>  		return true;
>  
> +	if (entity->pads[pad0].flags & MEDIA_PAD_FL_SOURCE
> +	    && entity->pads[pad1].flags & MEDIA_PAD_FL_SINK)
> +		swap(pad0, pad1);
> +
>  	return entity->ops->has_route(entity, pad0, pad1);
>  }
>  EXPORT_SYMBOL_GPL(media_entity_has_route);
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] media: entity: Swap pads if route is checked from source to sink
  2017-03-07 11:15 ` Niklas Söderlund
@ 2017-03-07 11:17   ` Sakari Ailus
  0 siblings, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2017-03-07 11:17 UTC (permalink / raw)
  To: Niklas Söderlund; +Cc: linux-media

Hi Niklas,

On 03/07/17 13:15, Niklas Söderlund wrote:
> Hi Sakari,
> 
> Thanks for the patch.
> 
> On 2016-11-08 12:11:15 +0200, Sakari Ailus wrote:
>> This way the pads are always passed to the has_route() op sink pad first.
>> Makes sense.
>>
>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>> ---
>> Hi Niklas,
>>
>> This should make it easier to implement the has_route() op in drivers.
>>
>> Feel free to merge this to "[PATCH 02/32] media: entity: Add
>> media_entity_has_route() function" if you like, or add separately after
>> the second patch.
> 
> I choose to append this as a separated patch on top of Laurents patches 
> and include all 3 in my next R-Car VIN series.


Ack. Thanks for the info.

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-07 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 10:11 [PATCH 1/1] media: entity: Swap pads if route is checked from source to sink Sakari Ailus
2017-03-07 11:15 ` Niklas Söderlund
2017-03-07 11:17   ` Sakari Ailus

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).