From patchwork Thu Sep 7 18:42:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9942707 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 3E940604D7 for ; Thu, 7 Sep 2017 18:46:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A6E128800 for ; Thu, 7 Sep 2017 18:46:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CF0C2880B; Thu, 7 Sep 2017 18:46:09 +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=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 0285B28800 for ; Thu, 7 Sep 2017 18:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755629AbdIGSnK (ORCPT ); Thu, 7 Sep 2017 14:43:10 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37073 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755468AbdIGSnH (ORCPT ); Thu, 7 Sep 2017 14:43:07 -0400 Received: by mail-qt0-f194.google.com with SMTP id h21so324219qth.4; Thu, 07 Sep 2017 11:43:07 -0700 (PDT) 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=BXCv2uVsMMpbEVp/gmURUNA6WU03EW+tMP5MvSYq3Js=; b=ta2vFw4ziacJz7DsXjd1fTPfw/OcOILH6dmpWwqsBVFaYt6Mz2muvn8P6YhC6YzYry 6QFFWtTd3M5dyh6R+zZx5cSUydasKA8Tds7Vj0bu0S6DtYByP0wYb/F9kc/4mhdTrHnz OkmHI8lUACsOd/TsVRq2ktrWz764nLserU6zuFYej4gJQEXEmm6vb0Gkiok8Pj4MJjkD HWLSszTfjScquywz5YD4dDJ1Nk9VoWbVpCayCv77sP1wTkqrAcCkma3mkl/OmH4aamGz 46ZKoWuv9PF/eMCk3nnTR6ZmhF0pOySsh8StnnF1h3zOZaD+JAh5xsjmPiYdHACmexdW aO+Q== X-Gm-Message-State: AHPjjUif9iMkkU3n1C3vzGl1oTf3sXS5NjZDF8vYrGWKkJF1YfQ0LtPZ h5dnMNEhXLAPRsaks/A= X-Google-Smtp-Source: AOwi7QCwJX4hb65NonVoj7Ay/QYvU+4noLT4xSlhBIgkz2rwv7zi+VBDaGFyNmqLOXmvkSooWvgbAw== X-Received: by 10.237.37.91 with SMTP id w27mr364206qtc.71.1504809786981; Thu, 07 Sep 2017 11:43:06 -0700 (PDT) Received: from localhost.localdomain ([187.10.21.246]) by smtp.gmail.com with ESMTPSA id v30sm213216qtg.70.2017.09.07.11.43.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 11:43:06 -0700 (PDT) From: Gustavo Padovan To: linux-media@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [PATCH v3 10/15] [media] vb2: add 'ordered' property to queues Date: Thu, 7 Sep 2017 15:42:21 -0300 Message-Id: <20170907184226.27482-11-gustavo@padovan.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907184226.27482-1-gustavo@padovan.org> References: <20170907184226.27482-1-gustavo@padovan.org> 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 From: Gustavo Padovan For explicit synchronization (and soon for HAL3/Request API) we need the v4l2-driver to guarantee the ordering in which the buffers were queued by userspace. This is already true for many drivers, but we never needed to say it. Signed-off-by: Gustavo Padovan --- include/media/videobuf2-core.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 5ed8d3402474..20099dc22f26 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -508,6 +508,9 @@ struct vb2_buf_ops { * @last_buffer_dequeued: used in poll() and DQBUF to immediately return if the * last decoded buffer was already dequeued. Set for capture queues * when a buffer with the V4L2_BUF_FLAG_LAST is dequeued. + * @ordered: if the driver can guarantee that the queue will be ordered or not. + * The default is not ordered unless the driver sets this flag. It + * is mandatory for using explicit fences. * @fileio: file io emulator internal data, used only if emulator is active * @threadio: thread io internal data, used only if thread is active */ @@ -560,6 +563,7 @@ struct vb2_queue { unsigned int is_output:1; unsigned int copy_timestamp:1; unsigned int last_buffer_dequeued:1; + unsigned int ordered:1; struct vb2_fileio_data *fileio; struct vb2_threadio_data *threadio;