Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7190807rwb; Tue, 15 Nov 2022 08:47:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zXd1xhBTbOKUqUL7RAgkaIYh6dR7Lj5uFA6oJAM9FtB2DuGdsBDB5u5mLfzvRhcHC0YBp X-Received: by 2002:a05:6402:344f:b0:461:d726:438f with SMTP id l15-20020a056402344f00b00461d726438fmr15838334edc.333.1668530837384; Tue, 15 Nov 2022 08:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668530837; cv=none; d=google.com; s=arc-20160816; b=Hat3O5Hfr26PXC0p7wOIEQ5VESRIRd9Yc8/wtN6DwqqKjYGLNwUBntfLZ/+adwfZRE BcKj/dOdwjJthEW/n7DbJXGUMg4ryKYGqcEXFNeRZdvR0NcDVZ8B8WlZl5runXlS6VvP EcCAfOoSHGiAPhI+QpCEWRJ6M5HQUT/YM4hH3t7MRr30nUkKNZVWxgXLjacg8FU1RH0d 4iWJAT6v2Z8cHp/8PFGCbBeoKQvA1/GNe+3jce7ZlYy+Sq3Oaj9CrO61c4/b/6joi4A6 N3wbcn7bBtTlaV0ejh8T9PXOYotFzdr/8fzE7Lm2kyOwQQCoMEieLswyZTrJ2REQ52Ia LQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=bl7X7AtYz21yLn/dRe/iFEf1ZpAPljd60TEttSTNQec=; b=JY0x6WBqa9Xbf32OWGHPkfD7a7XfswWscMvPOPrqg7cVozub2BeRioqKrslU/9tsNV sMJ1hULFeyaa8FJY8nCdI9dJzAwA7yCkQ0UaKj7lF4W58aKLXPFypXlvqCW+6ZJXVXKx 58fXcGjX7fPSwg2SDfp0Y9SUa+9YsPMhMvHE5xv8211qGMX4Ik+eP9WlO4Bf04m9ZEAz FjYYRRkL2Spq7OBK0zH6wleNiM4M8avCGleGHGbpHoAnFNrJj+wj9x8q/7mgj9lzrfFB Ci42RZOCLDVYjfR2HkS9MVpequhYdErJKcqWTs4p9hTRJEtDoKO2+dcaRhWMsbr5i9SJ AO5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="HJh/aWo1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a509b16000000b00462e23be64fsi10621813edi.578.2022.11.15.08.46.54; Tue, 15 Nov 2022 08:47:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="HJh/aWo1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbiKOQDp (ORCPT + 90 others); Tue, 15 Nov 2022 11:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbiKOQDd (ORCPT ); Tue, 15 Nov 2022 11:03:33 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC6A762F7 for ; Tue, 15 Nov 2022 08:03:30 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id hh9so8961864qtb.13 for ; Tue, 15 Nov 2022 08:03:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=bl7X7AtYz21yLn/dRe/iFEf1ZpAPljd60TEttSTNQec=; b=HJh/aWo1F07VJK6tyVYY1ZPO5frNwOHC6QU21Gl7eWt+zZcxZx32yuHkLlxSCbwidn yLIqZkZY1UWas70lpqWPx5snOpa+afrzsT5FuqB5LSiAlyATF1S37ds6bUFSWZ79RHMZ 7WlpGrf4SfRxx5/LnvszocIqiaqV3wWKnF/ZqSOYnqLcEQUrRah/4G6sR/vj3p/is81z CnSSDyTtgiYSuHtHUCm17ZjXEHZvgVSNyZkaVc3iz60yI9YleeWz/7dlXv/BozvEcyrw bBgOqkKyMZ2JMc+zYz5RcTW5s0nWJycZrYGaNpSG0IsID+C07ZE/2VL3LC1P7XYOWq0w FxBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bl7X7AtYz21yLn/dRe/iFEf1ZpAPljd60TEttSTNQec=; b=xb6n8lXRbT8UQqhm8w4eGuIbwDO/NHAPI7vmQ+uFGHn97qpSGkg9sSUncPAqfdpNP0 GjPljMq9ZlkmH4Y6jgxR0yYK2xHZdRLfSwG4ZlKb3jsZkM0NY8OlZH5/4qe9yQ68COxa dpRTFFwerT3elgtTX4TXmFXLxRLApNDhXpVHmPOFDFjGeXTVhVaN5pmKUm7gjhihcpLz /nNhm4NNfkl/X+syi+mKvm2bKL7nH89RgnRxXVyTZdH+Ct0JTYVWPdtPxBodYPjqBP99 PJCefjYTnGLAq7YrAbuCuucDNDyIBCDEKlfhuKYNP8YMhaMPhSCD7pztItkj1CNAQY1r 8nPA== X-Gm-Message-State: ANoB5pksumA6i7lbNidijdgIj4j4IW7SJbiC9V8w3ATikUmF28XNaIor zBX7ReYvjANdE7WQ3LGWLRXz+w== X-Received: by 2002:a05:622a:1e13:b0:39c:bd83:d75c with SMTP id br19-20020a05622a1e1300b0039cbd83d75cmr16926500qtb.38.1668528209865; Tue, 15 Nov 2022 08:03:29 -0800 (PST) Received: from nicolas-tpx395.localdomain (192-222-136-102.qc.cable.ebox.net. [192.222.136.102]) by smtp.gmail.com with ESMTPSA id o16-20020a05620a2a1000b006fa617ac616sm8639722qkp.49.2022.11.15.08.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 08:03:29 -0800 (PST) Message-ID: Subject: Re: [RFC PATCH v6 02/11] media: v4l2: Extend pixel formats to unify single/multi-planar handling (and more) From: Nicolas Dufresne To: Tomasz Figa , Hsia-Jun Li Cc: mchehab@kernel.org, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, boris.brezillon@collabora.com, hiroh@chromium.org, Brian.Starkey@arm.com, kernel@collabora.com, narmstrong@baylibre.com, linux-kernel@vger.kernel.org, frkoenig@chromium.org, stanimir.varbanov@linaro.org, Hans Verkuil , linux-media@vger.kernel.org Date: Tue, 15 Nov 2022 11:03:26 -0500 In-Reply-To: References: <20210114180738.1758707-1-helen.koike@collabora.com> <20210114180738.1758707-3-helen.koike@collabora.com> <577c56bf-146c-f34a-2028-075170076de7@collabora.com> <708221e8-a805-c394-6958-6c7ec24bfe66@synaptics.com> <03f6fd9ff6a757f6d1cb6cc552efcb0b94327104.camel@ndufresne.ca> <3b1edf81-bcc0-0b56-7e55-93da55d7f747@synaptics.com> <91a96b4a-a91e-aae6-733f-c307ca6840f0@synaptics.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le vendredi 11 novembre 2022 =C3=A0 17:52 +0900, Tomasz Figa a =C3=A9crit= =C2=A0: > > > Memory allocation doesn't sound to me like it is related to formats o= r > > > modifiers in any way. I agree with Nicolas that if we want to allow > > > the userspace to specify if the memory should be contiguous or not, > > > that should be a separate flag and actually I'd probably see it in > > > REQBUF_EXT and CREATE_BUFS_EXT, rather than as a part of the format. > > >=20 > > I agree with that. But here is a problem, if there was a display > > device(DRM) that only supports contiguous planes in a frame buffer. > > How do we be aware of that? >=20 > That's why I think the MMAP mode is not scalable and shouldn't be > expanded anymore. Both V4L2 and DRM devices should describe their > constraints to the userspace and then the userspace should allocate > accordingly from the right DMA-buf heap. (Or as Android and ChromeOS > do, just have a central allocator library that understands the > constraints, so there is no need to query the drivers.) Just pointing out, they "hardcode" the constraints, they don't truly unders= tand them. Also, the Android/ChromeOS implementation is not a great playground, = as it completely ignores the constrait already exposed by V4L2 API (the sizeimage= and bytesperline found in the FMT structure). You would not have to implement H= antro and Rockchip motion vector size calculation there if you'd simply use the sizeimage. Nicolas