Re: [PATCH v5 12/12] media: rcar-vin: Fold event notifier into only user

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

 



On 2025-06-12 12:44:08 +0300, Laurent Pinchart wrote:
> On Thu, Jun 12, 2025 at 09:22:40AM +0200, Niklas Söderlund wrote:
> > On 2025-06-12 03:28:16 +0300, Laurent Pinchart wrote:
> > > On Fri, Jun 06, 2025 at 08:26:06PM +0200, Niklas Söderlund wrote:
> > > > With Gen2 converted to use the common media device there is only one
> > > > caller left for the helper to notify a video device of an event, fold it
> > > > in.
> > > > 
> > > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> > > > ---
> > > > * Changes since v4
> > > > - Broken out from larger patch.
> > > > ---
> > > >  .../platform/renesas/rcar-vin/rcar-v4l2.c     | 20 +++++++------------
> > > >  1 file changed, 7 insertions(+), 13 deletions(-)
> > > > 
> > > > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> > > > index 2bf94bd77c24..59b01cb0628a 100644
> > > > --- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> > > > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> > > > @@ -656,18 +656,6 @@ void rvin_v4l2_unregister(struct rvin_dev *vin)
> > > >  	video_unregister_device(&vin->vdev);
> > > >  }
> > > >  
> > > > -static void rvin_notify_video_device(struct rvin_dev *vin,
> > > > -				     unsigned int notification, void *arg)
> > > > -{
> > > > -	switch (notification) {
> > > > -	case V4L2_DEVICE_NOTIFY_EVENT:
> > > > -		v4l2_event_queue(&vin->vdev, arg);
> > > > -		break;
> > > > -	default:
> > > > -		break;
> > > > -	}
> > > > -}
> > > > -
> > > >  static void rvin_notify(struct v4l2_subdev *sd,
> > > >  			unsigned int notification, void *arg)
> > > >  {
> > > > @@ -693,7 +681,13 @@ static void rvin_notify(struct v4l2_subdev *sd,
> > > >  		if (remote != sd)
> > > >  			continue;
> > > >  
> > > > -		rvin_notify_video_device(vin, notification, arg);
> > > > +		switch (notification) {
> > > > +		case V4L2_DEVICE_NOTIFY_EVENT:
> > > > +			v4l2_event_queue(&vin->vdev, arg);
> > > > +			break;
> > > > +		default:
> > > > +			break;
> > > > +		}
> > > 
> > > How about
> > > 
> > > 		if (notification == V4L2_DEVICE_NOTIFY_EVENT)
> > > 			v4l2_event_queue(&vin->vdev, arg);
> > > 
> > > Unless you expect more notifications to be handled later ?
> > 
> > I do, I have a different series that tries to notify CSI-2 errors to 
> > user-space with events. The series was posted in 2021 and I need to get 
> > back to it at some point ;-)
> 
> Could the event be sent on the subdev instead of the video device ?

That is a good point, the event should be sent to user-space thru the 
subdev. The current work I have (that might change) however acts on the 
event to stop the capture process on error, but indeed maybe the call to 
stop capturing should also come from user-space as a reaction to the 
event.

I have captured these thoughts in my TODO file, thanks for the 
suggestion.

> 
> > As this just moves the existing structure around I would prefere to keep 
> > it as-is for now.
> 
> OK.
> 
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> > > 
> > > >  	}
> > > >  }
> > > >  
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Kind Regards,
Niklas Söderlund




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux