__s32 fd;
} m;
__u32 length;
- __s32 fence_fd;
- __u32 reserved;
+ __s32 reserved2;
+ union {
+ __u32 fence_fd;
+ __u32 reserved;
+ };
};
static int get_v4l2_plane32(struct v4l2_plane __user *up,
if (V4L2_TYPE_IS_OUTPUT(type))
if (assign_in_user(&kp->bytesused, &up->bytesused) ||
assign_in_user(&kp->reserved2, &up->reserved2) ||
+ assign_in_user(&kp->fence_fd, &up->fence_fd) ||
assign_in_user(&kp->field, &up->field) ||
assign_in_user(&kp->timestamp.tv_sec,
&up->timestamp.tv_sec) ||
state = VB2_BUF_STATE_ERROR;
vb2_process_buffer_done(vb, state);
-
- /*
- * Check if there is any buffer with error in the next position of the queue,
- * buffers whose in-fence signaled with error are not queued to the driver
- * and kept on the queue until the buffer before them is done, so to not
- * delivery buffers back to userspace in the wrong order. Here we process
- * any existing buffers with errors and wake up userspace.
- */
- for (;;) {
- vb = list_next_entry(vb, queued_entry);
- if (!vb || vb->state != VB2_BUF_STATE_ERROR)
- break;
-
- vb2_process_buffer_done(vb, VB2_BUF_STATE_ERROR);
- }
}
EXPORT_SYMBOL_GPL(vb2_buffer_done);
static void __enqueue_in_driver(struct vb2_buffer *vb)
{
struct vb2_queue *q = vb->vb2_queue;
+ unsigned long flags;
- if (vb->in_fence && !dma_fence_is_signaled(vb->in_fence))
+ spin_lock_irqsave(&vb->fence_cb_lock, flags);
+ if (vb->in_fence && !dma_fence_is_signaled(vb->in_fence)) {
+ spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
return;
+ }
+ spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
vb->state = VB2_BUF_STATE_ACTIVE;
atomic_inc(&q->owned_by_drv_count);
spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
return;
}
+ spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
if (q->start_streaming_called)
__enqueue_in_driver(vb);
- spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
}
int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
goto unlock;
}
}
+ spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
/*
* If already streaming and there is no fence to wait on
goto unlock;
}
- spin_unlock_irqrestore(&vb->fence_cb_lock, flags);
-
/* Fill buffer information for the userspace */
if (pb)
call_void_bufop(q, fill_user_buffer, vb, pb);