Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp782809ybj; Tue, 5 May 2020 07:29:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJgyrOnIxEfb3mdJoRSpXYs180k3YY5/4TIzpU3W2r8rXa4AN+vA8hclOtsOibdmKuGiOnN X-Received: by 2002:aa7:d4d3:: with SMTP id t19mr2796273edr.144.1588688962317; Tue, 05 May 2020 07:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588688962; cv=none; d=google.com; s=arc-20160816; b=Kz9ArsagSHGHsfFhrvx2USsJCct2RndPvcBntZ2o/HTMXKopQJbZcw7wwOfV15X4cl IJFyLsG89ZHh/cocjZvHA3cs3ZXpv27JxKOnHcxP4I7IQyGC+NJJiG1q+V5M0aGym9jE VuVB4eQEHV1vqJWJLp+yFUIFca1n7RxZvB7h92LIAZwoAbAixJUGw5z10rAJhwAz8HHF etvtdsPT60jPGpiO7cJ0+KPRa/3/2WQVRs0960m4BFnxBvVGPqn9JdGwVMV3Np0ngQHb R1eRajDSXY+qv7b4jzVHrVcsH+tO/3RWxWGLBUpA/u60yfmrBONzGjOrHFyt2N8meu77 a6Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=9pOB7FFM0d8yQpUO/A8QyAzbmq1gffBWuN/g6Aa6w9c=; b=0ytY6SDAIit2cB4Jf2I0fAHWWdkuNvKu3CJySb66kpV13B1er7+r6+dMgZocgMEiyJ VZ2RbIqG5NuGe0LSlUnADR7Z6bDQ1qr1RI8FoYD8qMkCpLnJJjE0g2vhVXLV3q+XD7PY Q6ZamaPqvzTgzOGnILYaX+HBqkoIdtxJ4NyvQXz61dHoYomjtz6yo1Fp7KORippSErvo MBrjWj1nXMXsvUVDVRneECJkUjXLBDkMhELTrQw/HnMyAQ8oes6mUmwUX5T8SJwsKwNs 5YXHWHLJIYk2ytVi7iFpeWZ5UcPsXU0N5UOlJqJFXjlAl42i0i1DgyAEEtn5JMYQPYgf f80g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t26si1577304edf.183.2020.05.05.07.28.58; Tue, 05 May 2020 07:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729406AbgEEO1l (ORCPT + 99 others); Tue, 5 May 2020 10:27:41 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42808 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729123AbgEEO1k (ORCPT ); Tue, 5 May 2020 10:27:40 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 84EAE2A1EA1 Message-ID: Subject: Re: [PATCH v3 1/3] media: rkvdec: Fix .buf_prepare From: Ezequiel Garcia To: Tomasz Figa Cc: Linux Media Mailing List , "open list:ARM/Rockchip SoC..." , Linux Kernel Mailing List , kernel@collabora.com, Jonas Karlman , Heiko Stuebner , Hans Verkuil , Alexandre Courbot , Jeffrey Kardatzke , Gustavo Padovan Date: Tue, 05 May 2020 11:27:30 -0300 In-Reply-To: References: <20200505134110.3435-1-ezequiel@collabora.com> <20200505134110.3435-2-ezequiel@collabora.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-05-05 at 16:05 +0200, Tomasz Figa wrote: > On Tue, May 5, 2020 at 3:59 PM Ezequiel Garcia wrote: > > On Tue, 2020-05-05 at 15:56 +0200, Tomasz Figa wrote: > > > Hi Ezequiel, > > > > > > On Tue, May 5, 2020 at 3:41 PM Ezequiel Garcia wrote: > > > > The driver should only set the payload on .buf_prepare > > > > if the buffer is CAPTURE type, or if an OUTPUT buffer > > > > has a zeroed payload. > > > > > > Thanks for the patch. Just one question below. > > > > > > Where does the requirement to set OUTPUT buffer bytesused to sizeimage > > > if the original bytesused is 0 come from? > > > > > > > If I'm reading english correctly, it's here: > > > > https://www.kernel.org/doc/html/latest/media/uapi/v4l/buffer.html > > > > """ > > The number of bytes occupied by the data in the buffer. It depends on the negotiated data format and may change with each buffer for compressed > > variable size data like JPEG images. Drivers must set this field when type refers to a capture stream, applications when it refers to an output > > stream. If the application sets this to 0 for an output stream, then bytesused will be set to the size of the buffer (see the length field of this > > struct) by the driver. For multiplanar formats this field is ignored and the planes pointer is used instead. > > """ > > Okay, thanks. I wonder if this shouldn't be handled by the core, > though. Especially given that the document refers to the length field > specifically and not the sizeimage set in the format. > Yes, either core or helper, this definitely calls for a generic solution. Ezequiel