Re: [PATCH] media: intel/ipu6: Set the VC of the stream as the SOF event id

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

 



Hi Hongju,

On Mon, Nov 04, 2024 at 03:07:58AM +0000, Wang, Hongju wrote:
> Hi Sakari
> 
> > -----Original Message-----
> > From: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> > Sent: Thursday, October 24, 2024 6:31 PM
> > To: Wang, Hongju <hongju.wang@xxxxxxxxx>
> > Cc: linux-media@xxxxxxxxxxxxxxx; bingbu.cao@xxxxxxxxxxxxxxx
> > Subject: Re: [PATCH] media: intel/ipu6: Set the VC of the stream as the
> > SOF event id
> > 
> > Hi Hongju,
> > 
> > On Thu, Oct 24, 2024 at 11:22:01AM +0800, Hongju Wang wrote:
> > > In the virtual channel case, they should use v4l2_event.id to
> > > distinguish SOF events of different streams. Therefore, we set the
> > > virtual channel number of the stream as the SOF event ID. This number is
> > unique.
> > >
> > > Signed-off-by: Hongju Wang <hongju.wang@xxxxxxxxx>
> > > ---
> > >  drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
> > > b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
> > > index 051898ce53f4..5ad426afa0f0 100644
> > > --- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
> > > +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
> > > @@ -578,6 +578,7 @@ void ipu6_isys_csi2_sof_event_by_stream(struct
> > ipu6_isys_stream *stream)
> > >  		.type = V4L2_EVENT_FRAME_SYNC,
> > >  	};
> > >
> > > +	ev.id = stream->vc;
> > >  	ev.u.frame_sync.frame_sequence = atomic_fetch_inc(&stream->sequence);
> > >  	v4l2_event_queue(vdev, &ev);
> > >
> > 
> > The id field in struct v4l2_event isn't used for the FRAME_SYNC event and
> > also the virtual channel isn't communicated to the user space currently.
> 	
>   How to use the id field? User space should use SOF to do FRAME_SYNC,
>   but the v4l2_event doesn't distinguish different streams. Do you have
>   any good suggestions?

Ah, now I think I do understand the problem. The events are produced by the
CSI-2 receiver sub-device but there are multiple streams and the event
isn't stream-aware?

It's nice that the id field of the FRAME_SYNC event isn't in use for any
other purpose. This should be taken into account in event subscription,
too.

I'll add a patch documenting this in the metadata series. Any thoughts?

Cc Laurent and Hans.

-- 
Kind regards,

Sakari Ailus




[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