From patchwork Thu Sep 7 18:42:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9942675 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 EE579602CC for ; Thu, 7 Sep 2017 18:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E89FD287FA for ; Thu, 7 Sep 2017 18:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD6B4287FD; Thu, 7 Sep 2017 18:43:06 +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 6BD69287FA for ; Thu, 7 Sep 2017 18:43:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755953AbdIGSnE (ORCPT ); Thu, 7 Sep 2017 14:43:04 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:38364 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755468AbdIGSnB (ORCPT ); Thu, 7 Sep 2017 14:43:01 -0400 Received: by mail-qk0-f195.google.com with SMTP id c69so301687qke.5; Thu, 07 Sep 2017 11:43:00 -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=vDCnk3ulR+rEUQYo68WcxWvcI1kc1u6Q+Ip/CBTuZik=; b=J3xm8Npg5gbovVlKJpk+ysdIVPn6r2W7aQfhAWNex4KjlcdqOcBACfRxKeVGLdgAb9 9dWJM4Y3iuQ0rjdEM3WBci4jdmZbVMfk+fioq9K0QuzD93PMmo+PTiCkfrRMaiuJdqZQ liGYVWEqqpa2RtHeRzR+UNkBUQBirJBbDUJdWXaoTRoDJFmPqeGpFqK1Jw1WcHNIEOJq DrsB2e8Kii4i5/1jqzh0rp14Zidb7b2qaU5cYHZpZQEMQf1LmAIQWxV/Y+j3HeA0x9IO 0EJVrLZj/usaCQ3wTqWcYCJYaSte0Lr9gF1pzlNEgbYoEK/0K0t6a/0WVQ8vUEyPQGfI n3TQ== X-Gm-Message-State: AHPjjUhSYPEQ85Pg7ILAXMBYx3pP9ZXGDfFPS5iU0X3Bi2ct7ekKQdp4 cptrRMcAT9pgtVsRyLI= X-Google-Smtp-Source: AOwi7QClKRVUSddtlGRrdomPIGC1lRC0Cad3SHnMEpp/fHcHoUZvSGoSVUFNMiKmK/sJia0LJ2f2Pg== X-Received: by 10.55.77.72 with SMTP id a69mr362541qkb.196.1504809780364; Thu, 07 Sep 2017 11:43:00 -0700 (PDT) Received: from localhost.localdomain ([187.10.21.246]) by smtp.gmail.com with ESMTPSA id v30sm213216qtg.70.2017.09.07.11.42.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 11:42:59 -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 08/15] [media] vb2: add .buffer_queued() to notify queueing in the driver Date: Thu, 7 Sep 2017 15:42:19 -0300 Message-Id: <20170907184226.27482-9-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 With the upcoming explicit synchronization support to V4L2 we need a way to notify userspace when buffers are queued to the driver - buffers with fences attached to it can only be queued once the fence signal, so the queueing to the driver might be deferred. Yet, userspace still wants to be notified, so the buffer_queued() callback was added to vb2_buf_ops for that purpose. Signed-off-by: Gustavo Padovan --- include/media/videobuf2-core.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 41cda762ff0a..5ed8d3402474 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -415,6 +415,8 @@ struct vb2_ops { * will return an error. * @copy_timestamp: copy the timestamp from a userspace structure to * the vb2_buffer struct. + * @buffer_queued: VB2 uses this to notify the VB2-client that the buffer + * was queued to the driver. */ struct vb2_buf_ops { int (*verify_planes_array)(struct vb2_buffer *vb, const void *pb); @@ -422,6 +424,7 @@ struct vb2_buf_ops { int (*fill_vb2_buffer)(struct vb2_buffer *vb, const void *pb, struct vb2_plane *planes); void (*copy_timestamp)(struct vb2_buffer *vb, const void *pb); + void (*buffer_queued)(struct vb2_buffer *vb); }; /**