* [PATCH 0/2] v4l-utils: media-ctl: Print media graph completes if available
@ 2020-03-18 21:31 Niklas Söderlund
2020-03-18 21:31 ` [PATCH 1/2] [DNI] v4l-utils: Add flags filed to media_device_info in media.h Niklas Söderlund
2020-03-18 21:31 ` [PATCH 2/2] media-ctl: Print media graph completes if available Niklas Söderlund
0 siblings, 2 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-03-18 21:31 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, linux-media
Cc: linux-renesas-soc, Niklas Söderlund
Hi,
This series adds the option to print the media graphs completes if its
available. This series is intended as a demo of the use-case for the
patches posted to the media mailing list in [1].
The series is based on-top of latest v4l-utils master branch. Patch 1/2
is not meant for consumption but to ease testing of patch 2/2. Patch 1/2
should be replaced with a proper header after [1] is picked up up in
Linux.
1. [RFC 0/5] media-device: Report if graph is complete or not
Niklas Söderlund (2):
[DNI] v4l-utils: Add flags filed to media_device_info in media.h
media-ctl: Print media graph completes if available
include/linux/media.h | 6 +++++-
utils/media-ctl/media-ctl.c | 15 +++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
--
2.25.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] [DNI] v4l-utils: Add flags filed to media_device_info in media.h
2020-03-18 21:31 [PATCH 0/2] v4l-utils: media-ctl: Print media graph completes if available Niklas Söderlund
@ 2020-03-18 21:31 ` Niklas Söderlund
2020-03-18 21:31 ` [PATCH 2/2] media-ctl: Print media graph completes if available Niklas Söderlund
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-03-18 21:31 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, linux-media
Cc: linux-renesas-soc, Niklas Söderlund
Add the flags from the out of tree patches that adds a field and flags
to struct media_device_info. This patch is not intended for consumption
but to ease adding logic to media-ctl while the patches makes their way
into the media-tree.
Not-yet-Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
include/linux/media.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/media.h b/include/linux/media.h
index f4ba8ae3e410103c..0982814dfc06daab 100644
--- a/include/linux/media.h
+++ b/include/linux/media.h
@@ -32,9 +32,13 @@ struct media_device_info {
__u32 media_version;
__u32 hw_revision;
__u32 driver_version;
- __u32 reserved[31];
+ __u32 flags;
+ __u32 reserved[30];
};
+#define MEDIA_INFO_FLAG_INCOMPLETE (1 << 0)
+#define MEDIA_INFO_FLAG_COMPLETE (1 << 1)
+
/*
* Base number ranges for entity functions
*
--
2.25.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] media-ctl: Print media graph completes if available
2020-03-18 21:31 [PATCH 0/2] v4l-utils: media-ctl: Print media graph completes if available Niklas Söderlund
2020-03-18 21:31 ` [PATCH 1/2] [DNI] v4l-utils: Add flags filed to media_device_info in media.h Niklas Söderlund
@ 2020-03-18 21:31 ` Niklas Söderlund
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-03-18 21:31 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, linux-media
Cc: linux-renesas-soc, Niklas Söderlund
Make use of the flags filed in media_device_info and display the graphs
completes, if the information is available.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
utils/media-ctl/media-ctl.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 6661b487d73ca7cd..5187258e0625eb56 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -563,6 +563,14 @@ int main(int argc, char **argv)
if (media_opts.print) {
const struct media_device_info *info = media_get_info(media);
+ const char *complete = "";
+
+ if (info->flags) {
+ if (info->flags & MEDIA_INFO_FLAG_INCOMPLETE)
+ complete = "graph status: incomplete\n";
+ else if (info->flags & MEDIA_INFO_FLAG_COMPLETE)
+ complete = "graph status: complete\n";
+ }
printf("Media controller API version %u.%u.%u\n\n",
(info->media_version >> 16) & 0xff,
@@ -575,13 +583,16 @@ int main(int argc, char **argv)
"serial %s\n"
"bus info %s\n"
"hw revision 0x%x\n"
- "driver version %u.%u.%u\n\n",
+ "driver version %u.%u.%u\n"
+ "%s\n",
info->driver, info->model,
info->serial, info->bus_info,
info->hw_revision,
(info->driver_version >> 16) & 0xff,
(info->driver_version >> 8) & 0xff,
- (info->driver_version >> 0) & 0xff);
+ (info->driver_version >> 0) & 0xff,
+ complete);
+
}
if (media_opts.entity) {
--
2.25.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-18 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 21:31 [PATCH 0/2] v4l-utils: media-ctl: Print media graph completes if available Niklas Söderlund
2020-03-18 21:31 ` [PATCH 1/2] [DNI] v4l-utils: Add flags filed to media_device_info in media.h Niklas Söderlund
2020-03-18 21:31 ` [PATCH 2/2] media-ctl: Print media graph completes if available Niklas Söderlund
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).