From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37CC1C04AAF for ; Thu, 16 May 2019 10:40:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1298220848 for ; Thu, 16 May 2019 10:40:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727128AbfEPKkx (ORCPT ); Thu, 16 May 2019 06:40:53 -0400 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:42829 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfEPKkx (ORCPT ); Thu, 16 May 2019 06:40:53 -0400 Received: from [IPv6:2001:420:44c1:2579:5556:9d1d:75e4:9919] ([IPv6:2001:420:44c1:2579:5556:9d1d:75e4:9919]) by smtp-cloud7.xs4all.net with ESMTPA id RDobhFLI43qlsRDofhJXO9; Thu, 16 May 2019 12:40:51 +0200 Subject: Re: [PATCH v2] media/doc: Allow sizeimage to be set by v4l clients To: Tomasz Figa , Stanimir Varbanov Cc: Linux Media Mailing List , Mauro Carvalho Chehab , linux-arm-msm , Linux Kernel Mailing List References: <20190412155915.16849-1-stanimir.varbanov@linaro.org> From: Hans Verkuil Message-ID: Date: Thu, 16 May 2019 12:40:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfC+pZ2cLL5l2NoiBDT5OW7alsgmlwSoHeajG/jN5qLCRulIzhbjF3XyUAcun4KZfinyIJJuo39QnHsIYprgmoq21cRVYRrpfT0gKF18m++gZp+JB1Szf 5iShmic5kPvsHGh6BbNgf4g3h7nVs2sfWfhYssh9ui8ZiNftgsMQ6K9L9FlxITHoBTpRyOXEiOGpV2vsNktg7QkSoUxeFduhQoAPg5vAv0sf36FZgeLpv2M/ 7gXmfjzJ+IK0TIDkPl9wpCRFLrBuc8/GA10BPah1a1N85xJhPtCqICMguyzxXH2Er+l31K0GXsZPvYEo53hvDarqvhnHsuzCgmJdRtUWY1iPa6SrjiUJvVfR hTY2ncAtJlA3F3RhY52TCQvCuIVuEUmMYDYeu46loTn7zJJf/pMaqrDFxyt9ebZmWDBvdXawhW8MbziQRSwfzmunREFGHpk9c3r+AX1xHK5tn1Oe/3avuKe5 NrKitm6MFNYjDEPU Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 5/16/19 11:56 AM, Tomasz Figa wrote: > On Thu, May 16, 2019 at 5:09 PM Stanimir Varbanov > wrote: >> >> Hi Hans, >> >> On 5/14/19 11:54 AM, Hans Verkuil wrote: >>> Hi Stanimir, >>> >>> On 4/12/19 5:59 PM, Stanimir Varbanov wrote: >>>> This changes v4l2_pix_format and v4l2_plane_pix_format sizeimage >>>> field description to allow v4l clients to set bigger image size >>>> in case of variable length compressed data. >>> >>> I've been reconsidering this change. The sizeimage value in the format >>> is the minimum size a buffer should have in order to store the data of >>> an image of the width and height as described in the format. >>> >>> But there is nothing that prevents userspace from calling VIDIOC_CREATEBUFS >>> instead of VIDIOC_REQBUFS to allocate larger buffers. >> >> Sometimes CREATEBUFS cannot be implemented for a particular fw/hw. >> >> CC: Tomasz for his opinion. >> > > Thanks Stanimir. > > Actually, if called at the same point in time as REQBUFS, CREATE_BUFS > doesn't really differ to much, except that it gives more flexibility > for allocating the buffers and that shouldn't depend on any specific > features of hardware or firmware. > > Actually, one could even allocate any buffers any time regardless of > hardware/firmware support, but the ability to use such buffers would > actually depend on such. > > Perhaps we should just let the drivers return -EBUSY from CREATE_BUFS > if called at the wrong time? > >>> >>> So do we really need this change? >>> > > Yes, because this has worked like this all the time, but it was just > not documented. Disallowing this would break quite a bit of existing > userspace. Which drivers allow this today? I think that would be useful information for the commit log of a v4 of this patch. Regards, Hans > > Best regards, > Tomasz > >>> The more I think about this, the more uncomfortable I become with this change. >>> >>> Regards, >>> >>> Hans >>> >> >> >> >> -- >> regards, >> Stan