Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp452655yba; Thu, 16 May 2019 03:43:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEL9BF+7dwxeigcqtDC4HGf4hEAc2KpMTLc9vFTSmV4B6aEA+MfHsvPjupJ+bRilhJzTtA X-Received: by 2002:a17:902:8609:: with SMTP id f9mr47589523plo.32.1558003396307; Thu, 16 May 2019 03:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558003396; cv=none; d=google.com; s=arc-20160816; b=IjKhePD6o7IkCikyqBsQ/uPPj/Vkc6Zyjyf/gb0IMUGj8n7eHzCgtn5httq/qsOMDG PB0LGs6ytrV1i450WAE5fQssfh0sqKWTgv7P06J6lHLj1R5I+V+DQywobAXyQYjMvbIG 2xL0TpOLbZg3kzF1ybiZp8UBt2tx/iJYL3b2cDVqK9s37yk8AfjA+Cyz1Op+zHs2+hKr +xT/ACu7lpslJckRp4tcd29EaX/0sVJMTVt0lDvg6zZypFIB3OOK4TGhwP5L9ysW3YmN 6CUUg3tU/EvtTXobJgRh8/RTtUP3FzWkpv7Pvbevis/m2Pl8ZzAIu68Q5oIvHsfT6rCJ 48Ug== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=RqRJgDzPyB6MC0WdYUspHS0MfWsBq8pZ+C+zbvYsKpU=; b=SeUe0+6PfHkgiYH/2JC+qOMM7UF+364arJ/xqYd6A4aZZZ+oCEGhrgVTZZoYZUyyJx ec2ogH7zKYsCRi9wqMSQTSSDwSxR6P9MvAE5pXLTm4GJeriRdCr+NntiX0QSWfzpW1hq Njwxp75RCcb+ewUkbVPNtls0EVYt2hCqWnIzhqFPf2wLS/h27bR17qkjI6omfjF+qlVW +aBDaR0M1G0W59VXYh/QIfQ7N4q4Jwn52Fw4qLGU+gSO2LYGs1p7+72z9P3y1w4bLfrs weAMHGZqk9H/udB08WrGQ4/HYqbc585mzcQuM1B+LOz0V2ncpgu6hNhcWzW2nXXxMaoI 3ozA== 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 l10si4604278pgq.334.2019.05.16.03.42.59; Thu, 16 May 2019 03:43:16 -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 S1727224AbfEPKkx (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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