From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
tomoharu.fukawa.eb@renesas.com,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH v3 04/27] media: entity: Swap pads if route is checked from source to sink
Date: Tue, 14 Mar 2017 20:02:45 +0100 [thread overview]
Message-ID: <20170314190308.25790-5-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20170314190308.25790-1-niklas.soderlund+renesas@ragnatech.se>
From: Sakari Ailus <sakari.ailus@linux.intel.com>
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>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
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 ccd991d2d3450ab3..f0386ddd7c92cc4e 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -256,6 +256,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.12.0
next prev parent reply other threads:[~2017-03-14 19:06 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 19:02 [PATCH v3 00/27] rcar-vin: Add Gen3 with media controller support Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 01/27] rcar-vin: add Gen3 devicetree bindings documentation Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 02/27] media: entity: Add has_route entity operation Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 03/27] media: entity: Add media_entity_has_route() function Niklas Söderlund
2017-03-14 19:02 ` Niklas Söderlund [this message]
2017-03-14 19:02 ` [PATCH v3 05/27] rcar-vin: move chip information to own struct Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 06/27] rcar-vin: move max width and height information to chip information Niklas Söderlund
2017-03-15 9:37 ` Sergei Shtylyov
2017-03-14 19:02 ` [PATCH v3 07/27] rcar-vin: change name of video device Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 08/27] rcar-vin: move functions regarding scaling Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 09/27] rcar-vin: all Gen2 boards can scale simplify logic Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 10/27] rcar-vin: do not reset crop and compose when setting format Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 11/27] rcar-vin: do not allow changing scaling and composing while streaming Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 12/27] rcar-vin: read subdevice format for crop only when needed Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 13/27] rcar-vin: do not cut height in two for top, bottom or alternate fields Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 14/27] rcar-vin: move media bus configuration to struct rvin_info Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 15/27] rcar-vin: enable Gen3 hardware configuration Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 16/27] rcar-vin: add functions to manipulate Gen3 CHSEL value Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 17/27] rcar-vin: prepare digital notifier for group notifier Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 18/27] rcar-vin: add flag to switch to media controller mode Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 19/27] rcar-vin: use different v4l2 operations in " Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 20/27] rcar-vin: register a media pad if running " Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 21/27] rcar-vin: add group allocator functions Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 22/27] rcar-vin: add chsel information to rvin_info Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 23/27] rcar-vin: parse Gen3 OF and setup media graph Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 24/27] rcar-vin: add link notify for Gen3 Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 25/27] rcar-vin: extend {start,stop}_streaming to work with media controller Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 26/27] rcar-vin: enable support for r8a7795 Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 27/27] rcar-vin: enable support for r8a7796 Niklas Söderlund
2017-03-16 8:36 ` Geert Uytterhoeven
2017-03-16 9:17 ` Niklas Söderlund
2017-04-24 18:14 ` [PATCH 2/2] rcar-vin: group: use correct of_node Kieran Bingham
2017-04-25 14:30 ` Niklas Söderlund
2017-04-25 14:33 ` Kieran Bingham
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=20170314190308.25790-5-niklas.soderlund+renesas@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=geert@linux-m68k.org \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomoharu.fukawa.eb@renesas.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