Re: [PATCH 3/5] v4l2-async: Flag when media graph is complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Niklas,

Thank you for the patch.

On Thu, Jun 11, 2020 at 01:05:39AM +0200, Niklas Söderlund wrote:
> When the notifier completes set the complete flag in the struct
> media_device. This flag can can then be reported to user-space to let it
> know the graph is complete.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> ---
>  drivers/media/v4l2-core/v4l2-async.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> index 8bde33c21ce45f98..331594ca5b3bb723 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -217,6 +217,11 @@ v4l2_async_notifier_try_complete(struct v4l2_async_notifier *notifier)
>  	if (!v4l2_async_notifier_can_complete(notifier))
>  		return 0;
>  
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> +	if (notifier->v4l2_dev->mdev)
> +		notifier->v4l2_dev->mdev->complete = true;
> +#endif

Does this work with sub-notifiers ?

> +
>  	return v4l2_async_notifier_call_complete(notifier);

Isn't there a race here, if we report the complete flag before the
notifier calls the .complete() operation ?

>  }
>  

-- 
Regards,

Laurent Pinchart



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux