All of lore.kernel.org
 help / color / mirror / Atom feed
* dqbuf in blocking mode
@ 2009-10-01 11:56 Aguirre Rodriguez, Sergio Alberto
  2009-10-01 13:34 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Aguirre Rodriguez, Sergio Alberto @ 2009-10-01 11:56 UTC (permalink / raw)
  To: Linux Media Mailing List

Hi all,

I was wondering how acceptable is to requeue a buffer in a dqbuf call
if the videbuf_dqbuf returns error?

See, here's our current omap3 camera dqbuf function code:

static int vidioc_dqbuf(struct file *file, void *fh, struct v4l2_buffer *b)
{
	struct omap34xxcam_fh *ofh = fh;
	int rval;

videobuf_dqbuf_again:
	rval = videobuf_dqbuf(&ofh->vbq, b, file->f_flags & O_NONBLOCK);

	/*
	 * This is a hack. We don't want to show -EIO to the user
	 * space. Requeue the buffer and try again if we're not doing
	 * this in non-blocking mode.
	 */
	if (rval == -EIO) {
		videobuf_qbuf(&ofh->vbq, b);
		if (!(file->f_flags & O_NONBLOCK))
			goto videobuf_dqbuf_again;
		/*
		 * We don't have a videobuf_buffer now --- maybe next
		 * time...
		 */
		rval = -EAGAIN;
	}

	return rval;
}

Is anything wrong with doing this? Or perhaphs something better to do?

Regards,
Sergio

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-02 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 11:56 dqbuf in blocking mode Aguirre Rodriguez, Sergio Alberto
2009-10-01 13:34 ` Laurent Pinchart
2009-10-01 16:58   ` Aguirre Rodriguez, Sergio Alberto
2009-10-02 12:37   ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.