From patchwork Fri Oct 20 21:50:03 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: 45072 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 1e5fF2-0001pv-7t; Fri, 20 Oct 2017 21:54:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753294AbdJTVux (ORCPT + 1 other); Fri, 20 Oct 2017 17:50:53 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:43951 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753184AbdJTVuv (ORCPT ); Fri, 20 Oct 2017 17:50:51 -0400 Received: by mail-qk0-f193.google.com with SMTP id w134so16027275qkb.0; Fri, 20 Oct 2017 14:50:50 -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=tfhVjUSg+/HmSakSDdGFsMNsJn1Z9pvBoWa0yQZhB3I=; b=WwV0acQedDuy1y/ZFbuxSak4T70maA+7GPoubK9u2oj+zP/FK87uM9578DjxrCel8P JXml4OLDphTcMIFWVjx/VA6XQw5k8JsfhXTz9xNQd4Oex2veoCLH1jbLDlYs6moCG9D4 I++OkDr7lFocoUDYElcxdPZEoiXyWIeUD8mwEsnddtERpvO/uCaDuetnzX3xiGkW5VgQ UltjodVFV201sJzqIa6ajeSrPsb0Y3k/XSK/usasZYwzs/qihOZrHL95m1GS49hhZnki 9xIzReMnrR8WL7avkhDUVixsezzr+z/v8U/8YsLNIefIktTZokhVGR7qbyyrIZebbeP+ p1Ig== X-Gm-Message-State: AMCzsaUa8JtOv3xK1KeW0inmFSh6Us/gknf67iSYpNq0IfFNKXy8ReMw HTuxtWmw/1CSVdwM7qrE20l9THrS X-Google-Smtp-Source: ABhQp+TQrbdmaEXUte/sr/ky+A3DCsTPs98e40JtDMMA5189CkLbe7nUTqtNZK1Qj9Sb+bXxT1/jAA== X-Received: by 10.55.156.141 with SMTP id f135mr9263501qke.309.1508536250027; Fri, 20 Oct 2017 14:50:50 -0700 (PDT) Received: from localhost.localdomain (189-19-125-192.dsl.telesp.net.br. [189.19.125.192]) by smtp.gmail.com with ESMTPSA id j4sm1167039qkf.75.2017.10.20.14.50.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 14:50:49 -0700 (PDT) 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 , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [RFC v4 08/17] [media] vb2: add 'ordered_in_driver' property to queues Date: Fri, 20 Oct 2017 19:50:03 -0200 Message-Id: <20171020215012.20646-9-gustavo@padovan.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020215012.20646-1-gustavo@padovan.org> References: <20171020215012.20646-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 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. v2: rename property to 'ordered_in_driver' to avoid confusion Signed-off-by: Gustavo Padovan --- include/media/videobuf2-core.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 96af4eb49e52..6dd3f0181107 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -500,6 +500,11 @@ 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_in_driver: if the driver can guarantee that the queue will be + * ordered or not, i.e., the buffers are queued to the driver in + * the same order they are dequeued from the driver. The default + * is not ordered unless the driver sets this flag. As of now 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 */ @@ -552,6 +557,7 @@ struct vb2_queue { unsigned int is_output:1; unsigned int copy_timestamp:1; unsigned int last_buffer_dequeued:1; + unsigned int ordered_in_driver:1; struct vb2_fileio_data *fileio; struct vb2_threadio_data *threadio;