diff mbox series

[2/2] media-ctl: Print media graph completes if available

Message ID 20200318213115.3201107-3-niklas.soderlund+renesas@ragnatech.se
State New
Headers show
Series [1/2,DNI] v4l-utils: Add flags filed to media_device_info in media.h | expand

Commit Message

Niklas Söderlund March 18, 2020, 9:31 p.m. UTC
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 mbox series

Patch

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