diff mbox series

[RFC,3/5] mc-device.c: If graph completes status is available report it to user-space

Message ID 20200318213051.3200981-4-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show
Series media-device: Report if graph is complete or not | expand

Commit Message

Niklas Söderlund March 18, 2020, 9:30 p.m. UTC
If the media device implements the graph_complete callback utilise it
and fill in the completes of the graph in the struct media_device_info.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/mc/mc-device.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kieran Bingham June 9, 2020, 4:12 p.m. UTC | #1
Hi Niklas,

On 18/03/2020 21:30, Niklas Söderlund wrote:> If the media device
implements the graph_complete callback utilise it> and fill in the
completes of the graph in the struct media_device_info.> >
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/mc/mc-device.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
> index da8088351135298a..64c786570b6df129 100644
> --- a/drivers/media/mc/mc-device.c
> +++ b/drivers/media/mc/mc-device.c
> @@ -75,6 +75,10 @@ static long media_device_get_info(struct media_device *dev, void *arg)
>  	info->driver_version = info->media_version;
>  	info->hw_revision = dev->hw_revision;
>  
> +	if (dev->ops && dev->ops->graph_complete)
> +		info->flags |= dev->ops->graph_complete(dev) ?
> +			MEDIA_INFO_FLAG_COMPLETE : MEDIA_INFO_FLAG_INCOMPLETE;

Aha, I see it was because of graph_complete being optional that leads to
having both states of the bool...

And I guess we can't 'default' to either state if graph_complete()
doesn't exist...

--
Kieran



> +
>  	return 0;
>  }
>  
>
diff mbox series

Patch

diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
index da8088351135298a..64c786570b6df129 100644
--- a/drivers/media/mc/mc-device.c
+++ b/drivers/media/mc/mc-device.c
@@ -75,6 +75,10 @@  static long media_device_get_info(struct media_device *dev, void *arg)
 	info->driver_version = info->media_version;
 	info->hw_revision = dev->hw_revision;
 
+	if (dev->ops && dev->ops->graph_complete)
+		info->flags |= dev->ops->graph_complete(dev) ?
+			MEDIA_INFO_FLAG_COMPLETE : MEDIA_INFO_FLAG_INCOMPLETE;
+
 	return 0;
 }