From patchwork Fri May 11 00:17:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10392661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BDC8601A0 for ; Fri, 11 May 2018 00:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6624E28AC1 for ; Fri, 11 May 2018 00:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5897628ACE; Fri, 11 May 2018 00:18:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7749C28AC1 for ; Fri, 11 May 2018 00:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750758AbeEKASp (ORCPT ); Thu, 10 May 2018 20:18:45 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37260 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbeEKASp (ORCPT ); Thu, 10 May 2018 20:18:45 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id BD26F27D6FA From: Ezequiel Garcia To: Lubomir Rintel Cc: Hans Verkuil , linux-media@vger.kernel.org, Ezequiel Garcia Subject: [PATCH] usbtv: Implement wait_prepare and wait_finish Date: Thu, 10 May 2018 21:17:20 -0300 Message-Id: <20180511001720.6007-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.16.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This driver is currently specifying a vb2_queue lock, which means it straightforward to implement wait_prepare and wait_finish. Having these callbacks releases the queue lock while blocking, which improves latency by allowing for example streamoff or qbuf operations while waiting in dqbuf. Signed-off-by: Ezequiel Garcia --- Compile tested only. drivers/media/usb/usbtv/usbtv-video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c index 3668a04359e8..0c0d0ef71573 100644 --- a/drivers/media/usb/usbtv/usbtv-video.c +++ b/drivers/media/usb/usbtv/usbtv-video.c @@ -698,6 +698,8 @@ static const struct vb2_ops usbtv_vb2_ops = { .buf_queue = usbtv_buf_queue, .start_streaming = usbtv_start_streaming, .stop_streaming = usbtv_stop_streaming, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; static int usbtv_s_ctrl(struct v4l2_ctrl *ctrl)