Received: by 10.192.165.148 with SMTP id m20csp123898imm; Wed, 9 May 2018 09:48:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr8hy9YUdeZ/NGJGOn9xCjMoRaTdBskFG0lsQFUXSPSxrgjEPjAGOZZdkcVufdrVy5+tBw+ X-Received: by 2002:a63:a555:: with SMTP id r21-v6mr2016332pgu.426.1525884499105; Wed, 09 May 2018 09:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525884499; cv=none; d=google.com; s=arc-20160816; b=ndJpKXPsH0WK9VQE4lgxXjBhq4t7gzVVxjHEhQG5QINUs/BgpIWKe2DrS9fvjnanlr 1LuDwRwjPjnj2Tq8dk1SFhxzIDRE37r3MAo0KST6DjRVIAxBPvWp+LKoyJxdCtSGW3gW MmPcXLrv5MHkFUHQc9BPzteE6Onaq954ZxzMdxexe6kmp/E4pLN2OYNHU6Rnd/J0rKZH qzOfnnKLx6M9OYHqnPz0jYsjas5NAjRvQ5KPmhcHMZRedi62VQUkyCG7SPqF1Vyhkr/H fBAfRzCfZOtegZqvfBQYZuKuckzYuxtozX2XR1Z0N5zBO1kbez1bBZIyAsBIxWgB4lN6 7GSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=jA9RWSOBPvCJhtkm9dIK1uRGZmphEkxPvNkZbiImqE4=; b=oNsZU6WlMTA8KyI7FC7XkJUSu+cMMdItkSjonOZPlO9TNjnA1qkgdb4bVxEFinmmRc eEeYPbeno4GbhNofRZC91k7Zw8XIqFDtwJVkZuUXEIrqsDRUefsAUdZ59Oj83EdmhGIs 3OFDah7+kZJC3fCfNPWQ1qImxD0MNvF6jr50p/T6eujALfKgypIhYxMKuRXMq2spnmjh MbHtrI+h0HXbvOw94GVrx6tlrAF+IkvfSDbKEJjN7h3bqeN6sr6mUSZWl2SlMX7ep8Uc WCZoBy6nU1YWkIWESb7RK++OFdz6til9/UKaeIDCXKIUU6Bi+GgzD0H6b7XWjCHGWx8P EIDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2-v6si26555774plh.259.2018.05.09.09.48.04; Wed, 09 May 2018 09:48:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965630AbeEIQpK (ORCPT + 99 others); Wed, 9 May 2018 12:45:10 -0400 Received: from foss.arm.com ([217.140.101.70]:46874 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964989AbeEIQpJ (ORCPT ); Wed, 9 May 2018 12:45:09 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E187B1650; Wed, 9 May 2018 09:45:08 -0700 (PDT) Received: from e107564-lin.cambridge.arm.com (e107564-lin.cambridge.arm.com [10.2.131.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 003813F25D; Wed, 9 May 2018 09:45:06 -0700 (PDT) Date: Wed, 9 May 2018 17:45:05 +0100 From: Brian Starkey To: Ezequiel Garcia Cc: linux-media@vger.kernel.org, kernel@collabora.com, Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: Re: [PATCH v9 11/15] vb2: add in-fence support to QBUF Message-ID: <20180509164504.GB23664@e107564-lin.cambridge.arm.com> References: <20180504200612.8763-1-ezequiel@collabora.com> <20180504200612.8763-12-ezequiel@collabora.com> <20180509103639.GC39838@e107564-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 01:03:15PM -0300, Ezequiel Garcia wrote: >On Wed, 2018-05-09 at 11:36 +0100, Brian Starkey wrote: > >[..] >> > @@ -203,9 +215,14 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) >> > b->timestamp = ns_to_timeval(vb->timestamp); >> > b->timecode = vbuf->timecode; >> > b->sequence = vbuf->sequence; >> > - b->fence_fd = 0; >> > b->reserved = 0; >> > >> > + b->fence_fd = 0; >> >> I didn't understand why we're returning 0 instead of -1. Actually the >> doc in patch 10 seems to say it will be -1 or 0 depending on whether >> we set one of the fence flags? I'm not sure: >> >> For all other ioctls V4L2 sets this field to -1 if >> ``V4L2_BUF_FLAG_IN_FENCE`` and/or ``V4L2_BUF_FLAG_OUT_FENCE`` are set, >> otherwise this field is set to 0 for backward compatibility. >> > >Well, I think that for backwards compatibility (userspace not knowing >about fence_fd field), we should return 0, unless the flags are explicitly >set. > >That is what the doc says and it sounds sane. On the line below where you snipped, is this: + if (vb->in_fence) + b->flags |= V4L2_BUF_FLAG_IN_FENCE; + else + b->flags &= ~V4L2_BUF_FLAG_IN_FENCE; If the "if (vb->in_fence)" condition is true, then the flag is set, and the fence_fd field is 0. I think that's the opposite of what the doc says: For all other ioctls V4L2 sets this field to -1 if ``V4L2_BUF_FLAG_IN_FENCE`` and/or ``V4L2_BUF_FLAG_OUT_FENCE`` are set, otherwise this field is set to 0 for backward compatibility. V4L2_BUF_FLAG_IN_FENCE is set, therefore the doc says V4L2 will set this field to -1. (Or at least the comment should be made less ambiguous). > >The bits are implemented in patch 12, but as I mentioned in my reply to >patch 10, I will move it to patch 10, for consistency. Yeah as you say, it looks like you change this behaviour in path 12, so I'm not totally sure which is right or expected. But consistency is good :-) -Brian > >Thanks, >Eze