Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp351345iob; Wed, 18 May 2022 03:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6nbGALDEksa3Un/jiOnWPjJiFmi+769DN8OaMFlTENh4xYXkpMLhjIyyJCpk6vWwDtpVa X-Received: by 2002:a17:903:2286:b0:161:afab:f47d with SMTP id b6-20020a170903228600b00161afabf47dmr6328727plh.113.1652870570031; Wed, 18 May 2022 03:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652870570; cv=none; d=google.com; s=arc-20160816; b=HjBF0VyE7bPzBWp8Na5+Mql4wb7NIFYm7TtMH2UUrlsbuqfikWwtRs8Uv0yrJOBK05 5hxObX6rJ8LYwRoNYmMzGLebDwp2FWaDaGhhdEEH3QERDUGRniYkxFCccyRY+9Z7orfT NT1GnnHDq+Yq2Yt8OzvkF8k0kpBnZjrhY106Q4OWiL0uVCZ/ZFMA0KM+XJOh9/MKQwx5 LHkqV3ERMV7hDDxAS9OwbBMLNI28GHdq23jbXjZWVAhjbFanhfiv3ZriBFQJW2f+kYHJ 5caiOUyMIo6DHonR26pyG+1NjO0XN4VUF/mE8LQY7yXvnu/R8iTQ3BZxDFGo5+jqNB4l yC3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MgRpXx9YxVpOeOM7/vHuhu/tl913uA1PALhsXA9P1Ec=; b=TX9YtsBMB1tbLftGboDkZauOZWw4DaqemuXkMan/koqPBX8sm6gTT7F5cIZGgjyQwd yQTd/KbmTzdnlmLnIx2NC9hp/57ml+hkHZyY5c2uFGlA6r/Ww7BNhEkrDAftpiBC4RH6 eHo1GMLsYY2QBPXo8e/Qso0t16WEhCgkBH2MzfWSRhM41jTqzgZZ0FXtbArHs6EqfJKB HUo/ux83wCAd63yoWWN2yY9RDOi4IUJP7R9yKO38FtmbXmh60i7N38b2CleJOE1zy0zH moHOBzMVZdUBNEAq9HU1zlXoCyiUhh4SOazrL4mjJhN1/AfjAyQUnxJYr+JAT7lzPvRw veRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k15-20020a170902d58f00b0015e91bd566esi2299230plh.27.2022.05.18.03.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 03:42:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E05F17659; Wed, 18 May 2022 03:26:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235089AbiERK0j (ORCPT + 99 others); Wed, 18 May 2022 06:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235098AbiERK0d (ORCPT ); Wed, 18 May 2022 06:26:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD85B869; Wed, 18 May 2022 03:26:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 188CD61830; Wed, 18 May 2022 10:26:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFA72C385A5; Wed, 18 May 2022 10:26:27 +0000 (UTC) Message-ID: <1c1fda82-334a-04ec-fc2e-d1ea2da466e9@xs4all.nl> Date: Wed, 18 May 2022 12:26:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v1] media: videobuf2: Allow applications customize data offsets of capture buffers Content-Language: en-US To: Nicolas Dufresne , Dmitry Osipenko , Mauro Carvalho Chehab , Tomasz Figa , Marek Szyprowski , Benjamin Gaignard , Andrzej Pietrasiewicz , Gustavo Padovan , Boris Brezillon , Daniel Almeida , Sebastian Fricke , Laura Nao Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Osipenko References: <20220322132329.6527-1-dmitry.osipenko@collabora.com> <9ec970d6-ea09-802c-419b-b2ef26800990@collabora.com> <5be83f0b343c04d877a2c2d805fb5f71ca9973b1.camel@ndufresne.ca> From: Hans Verkuil In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 On 3/25/22 13:32, Nicolas Dufresne wrote: > Le jeudi 24 mars 2022 à 21:20 +0300, Dmitry Osipenko a écrit : >> The root of the problem is that DRM UAPI is more flexible and allows to >> customize offsets for both S/MPLANEs, while V4L doesn't allow to do it >> at all. I'm exploring all the potential options, so far neither of the >> proposed variants is ideal. > > In GStreamer kmssink, the way DRM is used, is that if you have 2 planes in your > pixel format, but only received 1 DMABuf, we will pass this DMABuf twice (well > GEM handles, but twice), with appropriate offset. > > With this in mind, the idea for V4L2 could be to always resort to MPLANE for > this purpose. The tricky part for userland is that it needs to know the dual > pixel format and map that accordingly. That is a bit difficult and this is > something Helen was trying to address with the v4l2_buffer_ext (that and > allowing space to store DRM Modifiers in the future). FYI: here is Helen's last patch series. Since Helen is no longer active in the media subsystem, someone else who is sufficiently motivated would have to take over. https://patchwork.linuxtv.org/project/linux-media/cover/20210114180738.1758707-1-helen.koike@collabora.com/ I'm not enthusiastic about messing with data_offset: it was - in hindsight - a bad idea. Regards, Hans > > The second challenge is the overhead. In DRM, as we "prime" the DMABuf into > handles, this gives a kernel object to store any relevant information about the > buffer. So having it duplicate can be done at no cost. In V4L2, the driver would > need to handle that more often. Specially that despite the recommendation > (except for primary buffer decoder, were this is mandatory), we don't force a > strict DMABuf / Buffer IDX mapping. > > Nicolas