From: Kaaira Gupta <kgupta@es.iitr.ac.in>
To: Helen Koike <helen.koike@collabora.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Kaaira Gupta <kgupta@es.iitr.ac.in>
Subject: [PATCH v3 1/9] media: vimc: Move get_source_entity to vimc-common
Date: Wed, 19 Aug 2020 23:34:34 +0530 [thread overview]
Message-ID: <20200819180442.11630-2-kgupta@es.iitr.ac.in> (raw)
In-Reply-To: <20200819180442.11630-1-kgupta@es.iitr.ac.in>
Move the function vimc_get_source_entity() to vimc-common.c to make it
reusable.
Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
drivers/media/test-drivers/vimc/vimc-common.c | 14 +++++++++++
drivers/media/test-drivers/vimc/vimc-common.h | 12 ++++++++++
.../media/test-drivers/vimc/vimc-streamer.c | 24 -------------------
3 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/drivers/media/test-drivers/vimc/vimc-common.c b/drivers/media/test-drivers/vimc/vimc-common.c
index 0d97b25ce21e..91c8992bb391 100644
--- a/drivers/media/test-drivers/vimc/vimc-common.c
+++ b/drivers/media/test-drivers/vimc/vimc-common.c
@@ -417,3 +417,17 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
media_entity_cleanup(&sd->entity);
return ret;
}
+
+struct media_entity *vimc_get_source_entity(struct media_entity *ent)
+{
+ struct media_pad *pad;
+ int i;
+
+ for (i = 0; i < ent->num_pads; i++) {
+ if (ent->pads[i].flags & MEDIA_PAD_FL_SOURCE)
+ continue;
+ pad = media_entity_remote_pad(&ent->pads[i]);
+ return pad ? pad->entity : NULL;
+ }
+ return NULL;
+}
diff --git a/drivers/media/test-drivers/vimc/vimc-common.h b/drivers/media/test-drivers/vimc/vimc-common.h
index a289434e75ba..4c580d854007 100644
--- a/drivers/media/test-drivers/vimc/vimc-common.h
+++ b/drivers/media/test-drivers/vimc/vimc-common.h
@@ -230,4 +230,16 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
*/
int vimc_vdev_link_validate(struct media_link *link);
+/**
+ * vimc_get_source_entity - get the entity connected with the first sink pad
+ *
+ * @ent: reference media_entity
+ *
+ * Helper function that returns the media entity containing the source pad
+ * linked with the first sink pad from the given media entity pad list.
+ *
+ * Return: The source pad or NULL, if it wasn't found.
+ */
+struct media_entity *vimc_get_source_entity(struct media_entity *ent);
+
#endif
diff --git a/drivers/media/test-drivers/vimc/vimc-streamer.c b/drivers/media/test-drivers/vimc/vimc-streamer.c
index 451a32c0d034..4f8384246042 100644
--- a/drivers/media/test-drivers/vimc/vimc-streamer.c
+++ b/drivers/media/test-drivers/vimc/vimc-streamer.c
@@ -12,30 +12,6 @@
#include "vimc-streamer.h"
-/**
- * vimc_get_source_entity - get the entity connected with the first sink pad
- *
- * @ent: reference media_entity
- *
- * Helper function that returns the media entity containing the source pad
- * linked with the first sink pad from the given media entity pad list.
- *
- * Return: The source pad or NULL, if it wasn't found.
- */
-static struct media_entity *vimc_get_source_entity(struct media_entity *ent)
-{
- struct media_pad *pad;
- int i;
-
- for (i = 0; i < ent->num_pads; i++) {
- if (ent->pads[i].flags & MEDIA_PAD_FL_SOURCE)
- continue;
- pad = media_entity_remote_pad(&ent->pads[i]);
- return pad ? pad->entity : NULL;
- }
- return NULL;
-}
-
/**
* vimc_streamer_pipeline_terminate - Disable stream in all ved in stream
*
--
2.17.1
next prev parent reply other threads:[~2020-08-19 18:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 18:04 [PATCH v3 0/9] media: vimc: Multiple stream support in vimc Kaaira Gupta
2020-08-19 18:04 ` Kaaira Gupta [this message]
2020-08-20 15:32 ` [PATCH v3 1/9] media: vimc: Move get_source_entity to vimc-common Kieran Bingham
2020-08-19 18:04 ` [PATCH v3 2/9] media: vimc: Add get_frame callback Kaaira Gupta
2020-08-20 15:36 ` Kieran Bingham
2020-09-12 10:01 ` Kaaira Gupta
2020-10-02 11:08 ` Dafna Hirschfeld
2020-08-19 18:04 ` [PATCH v3 3/9] media: vimc: Add usage count to subdevices Kaaira Gupta
2020-10-02 11:13 ` Dafna Hirschfeld
2020-08-19 18:04 ` [PATCH v3 4/9] media: vimc: Separate starting stream from pipeline initialisation Kaaira Gupta
2020-08-21 15:11 ` Dafna Hirschfeld
2020-08-21 21:01 ` Kaaira Gupta
2020-08-28 20:37 ` Dafna Hirschfeld
2020-09-02 9:56 ` Kieran Bingham
2020-09-12 10:21 ` Kaaira Gupta
2020-09-12 10:16 ` Kaaira Gupta
2020-08-19 18:04 ` [PATCH v3 5/9] media: vimc: Separate closing of stream and thread Kaaira Gupta
2020-09-02 10:13 ` Kieran Bingham
2020-09-12 10:28 ` Kaaira Gupta
2020-08-19 18:04 ` [PATCH v3 6/9] media: vimc: Serialize vimc_streamer_s_stream() Kaaira Gupta
2020-08-19 18:04 ` [PATCH v3 7/9] media: vimc: Dynamically allocate stream struct Kaaira Gupta
2020-09-02 10:29 ` Kieran Bingham
2020-09-12 10:39 ` Kaaira Gupta
2020-08-19 18:04 ` [PATCH v3 8/9] media: vimc: Join pipeline if one already exists Kaaira Gupta
2020-09-02 10:40 ` Kieran Bingham
2020-08-19 18:04 ` [PATCH v3 9/9] media: vimc: Run multiple captures on same thread Kaaira Gupta
2020-09-02 10:46 ` Kieran Bingham
2020-09-12 10:45 ` Kaaira Gupta
2020-09-02 10:51 ` [PATCH v3 0/9] media: vimc: Multiple stream support in vimc Kieran Bingham
2020-09-12 10:49 ` Kaaira Gupta
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=20200819180442.11630-2-kgupta@es.iitr.ac.in \
--to=kgupta@es.iitr.ac.in \
--cc=helen.koike@collabora.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=skhan@linuxfoundation.org \
/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).