FROMGIT: usb: gadget: uvc: remove pause flag use
The pause flag doesn't appear to serve a purpose as it is possible for the pump worker thread to not be running when new buffers are queued. Before the following change was introduced: "43cd0023872e usb: gadget: uvc_video: add worker to handle the frame pumping", the pause flag status was discarded and never returned. This masked a current issues of the userspace receiving non-zero values (considered unsuccessful) and prevents trace_v4l2_qbuf() from being called. Signed-off-by: Dan Vacura <w36195@motorola.com> Link: https://lore.kernel.org/r/20220413192402.26063-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 229140375 (cherry picked from commit be30e3502771ac0b5080ec61223d915354cde1cc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) Change-Id: Id841e7f0dc6c79f74ca41bb93f2504effc2fefd8 Signed-off-by: Dan Vacura <w36195@motorola.com>
This commit is contained in:
@@ -169,18 +169,7 @@ int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
|
|||||||
|
|
||||||
int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
|
int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
return vb2_qbuf(&queue->queue, NULL, buf);
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = vb2_qbuf(&queue->queue, NULL, buf);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&queue->irqlock, flags);
|
|
||||||
ret = (queue->flags & UVC_QUEUE_PAUSED) != 0;
|
|
||||||
queue->flags &= ~UVC_QUEUE_PAUSED;
|
|
||||||
spin_unlock_irqrestore(&queue->irqlock, flags);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -348,8 +337,6 @@ struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue)
|
|||||||
if (!list_empty(&queue->irqqueue))
|
if (!list_empty(&queue->irqqueue))
|
||||||
buf = list_first_entry(&queue->irqqueue, struct uvc_buffer,
|
buf = list_first_entry(&queue->irqqueue, struct uvc_buffer,
|
||||||
queue);
|
queue);
|
||||||
else
|
|
||||||
queue->flags |= UVC_QUEUE_PAUSED;
|
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,6 @@ struct uvc_buffer {
|
|||||||
|
|
||||||
#define UVC_QUEUE_DISCONNECTED (1 << 0)
|
#define UVC_QUEUE_DISCONNECTED (1 << 0)
|
||||||
#define UVC_QUEUE_DROP_INCOMPLETE (1 << 1)
|
#define UVC_QUEUE_DROP_INCOMPLETE (1 << 1)
|
||||||
#define UVC_QUEUE_PAUSED (1 << 2)
|
|
||||||
|
|
||||||
struct uvc_video_queue {
|
struct uvc_video_queue {
|
||||||
struct vb2_queue queue;
|
struct vb2_queue queue;
|
||||||
|
Reference in New Issue
Block a user