Re: [RFC] Support for events with a large payload

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

 



Hi Hans,

On Mon, Jun 24, 2013 at 03:40:14PM +0200, Hans Verkuil wrote:
...
> > Events that fit to regular 64 bytes will be delivered using that, and the
> > user-provided pointer will only be used in the case a large event is
> > delivered to the user. So in order to be able to receive large events, the
> > user must always provide the pointer even if it's not always used.
> 
> This is an option. The easiest approach would be to extend v4l2_kevent with
> a pointer to a struct v4l2_event_payload, which would be refcounted (it's
> basically a struct kref + size + payload). Since this would have to be allocated
> you can't use this in interrupt context.

Well, one can use GFP_NOWAIT. I would allow this. But surely better done
outside interrupt context.

> Since the payloads are larger I am less concerned about speed. There is one
> problem, though: if you dequeue the event and the buffer that should receive
> the payload is too small, then you have lost that payload. You can't allocate
> a new, larger, buffer and retry. So this approach can only work if you really
> know the maximum payload size.
> 
> The advantage is also that you won't lose payloads.
> 
> You are starting to convince me :-) Just don't change the current implementation
> for small payloads, that's one that really works very well.

I meant only large payload buffers above but failed to write it down.
Smaller ones could stay as they are.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@xxxxxx	XMPP: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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