From patchwork Mon Dec 11 18:27:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo F. Padovan" X-Patchwork-Id: 45901 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOSpv-0001Lu-Cs; Mon, 11 Dec 2017 18:29:55 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752704AbdLKS3k (ORCPT + 1 other); Mon, 11 Dec 2017 13:29:40 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:43968 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbdLKS2A (ORCPT ); Mon, 11 Dec 2017 13:28:00 -0500 Received: by mail-qt0-f194.google.com with SMTP id w10so40956119qtb.10; Mon, 11 Dec 2017 10:27:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9vQBb3scCBFVQFD3jgkRtNlMvFYDzOtRu2PZ1/NUiIM=; b=ERpHzL+3NHnZzRFVneVU4xofv86+YhxsjYs0UOgjtm1G8OhZ/6Z9JCkX07fguqcmdm snKwng8MfyETV6RAAV6z47TvI/V2xEwKGG+0MI1BOt+pBqlHjhUuL+3WYwTw24exD9M7 uBL2fXhFSQeHdSxr9sC6euwITuacgCObiaSemXjSVSmAUxOWbpl6gk2sFJHW+2LMvx1J DkSrvTxzuYhmVpoxGkubcWmL2EtbDLu4KGn3dGQEccOQ4fNc/sfiNxbM7hhU8NAQj8PO 2r82stGYxtz58f933m9150hW31PF6OMLhFwr4+342XZRg1/q6FZmEStfwslpUrh5aEZS dE6w== X-Gm-Message-State: AKGB3mKsQCFHET/2HTPXT1T0wMlTzDfTtnM/eQYpoFwQLdcCQxB4j5N5 LCL+0HXwolGtHBJmtCmLPJ45iQE6 X-Google-Smtp-Source: ACJfBosqzjzMh2brdKyQy+8Hw06/KYRmddOxWFgetL2pzarsd1OfiYjdKqTpE2wQyMI/afFSNqbQEw== X-Received: by 10.55.97.214 with SMTP id v205mr1919320qkb.216.1513016879080; Mon, 11 Dec 2017 10:27:59 -0800 (PST) Received: from localhost.localdomain ([177.68.185.72]) by smtp.gmail.com with ESMTPSA id v129sm4547126qkd.42.2017.12.11.10.27.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 10:27:58 -0800 (PST) From: Gustavo Padovan To: linux-media@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , Thierry Escande , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [PATCH v6 1/6] [media] vb2: add is_unordered callback for drivers Date: Mon, 11 Dec 2017 16:27:36 -0200 Message-Id: <20171211182741.29712-2-gustavo@padovan.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171211182741.29712-1-gustavo@padovan.org> References: <20171211182741.29712-1-gustavo@padovan.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Gustavo Padovan Explicit synchronization benefits a lot from ordered queues, they fit better in a pipeline with DRM for example so create a opt-in way for drivers notify videobuf2 that the queue is unordered. Drivers don't need implement it if the queue is ordered. Signed-off-by: Gustavo Padovan --- include/media/videobuf2-core.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index ef9b64398c8c..eddb38a2a2f3 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -368,6 +368,9 @@ struct vb2_buffer { * callback by calling vb2_buffer_done() with either * %VB2_BUF_STATE_DONE or %VB2_BUF_STATE_ERROR; may use * vb2_wait_for_all_buffers() function + * @is_unordered: tell if the queue format is unordered. The default is + * assumed to be ordered and this function only needs to + * be implemented for unordered queues. * @buf_queue: passes buffer vb to the driver; driver may start * hardware operation on this buffer; driver should give * the buffer back by calling vb2_buffer_done() function; @@ -391,6 +394,7 @@ struct vb2_ops { int (*start_streaming)(struct vb2_queue *q, unsigned int count); void (*stop_streaming)(struct vb2_queue *q); + int (*is_unordered)(struct vb2_queue *q); void (*buf_queue)(struct vb2_buffer *vb); }; @@ -564,6 +568,7 @@ struct vb2_queue { u32 cnt_wait_finish; u32 cnt_start_streaming; u32 cnt_stop_streaming; + u32 cnt_is_unordered; #endif };