Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2118640pxb; Fri, 25 Mar 2022 11:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWp0V+1xySVsI7nAjIhqnTbJqGbQL7+NMy/sbMuFd0Xrgn0qnMu3el4k6El/26TB6wb4vB X-Received: by 2002:a17:90b:3b81:b0:1c6:f22c:60f3 with SMTP id pc1-20020a17090b3b8100b001c6f22c60f3mr14258820pjb.109.1648232682482; Fri, 25 Mar 2022 11:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648232682; cv=none; d=google.com; s=arc-20160816; b=Slvy8+D9/Uvj9chz5NUR0L035O4iuRXTaCInYiSSukdsNgBcK554oi+nk8DqUGtVmN VosYu2DJGbVJbGXqvpwe87Ohk/KnUi+jexvytVvSFgnHNM/wN6en66evKprCM+1nsDrB oZEBW/eLhfoJ7+NBO6PtAF4eSUdnqP7p5Uj/cP91XGbpItqdTtJLOWqeSP+yn5+K/0my dUaHh8lqFRb0xEJzJYJ39ew0VS3qlkRKbgae5jNhHA+ygiqG8v+BO88JRroRW6zyl/6L Dtvx/PyvvaBte9atUrPahsmVx2l14n4UNa+l+9ww+7YwP57beTVLxLm4GzXfSYHoehWM GrQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=30XACj7MPd58k847MdVpAvMgBiu+f7RKwoRCwiRj2M0=; b=LedqKstgN8Rd1FRx3ZjCccgPBv5uAGhrh/kWXcTp71pytF5M1t/jrjVdZzou9Vmyml XQ8PnmOF2gPCL8BTD8IopfvhBU8v3vvkvPLKq9DQMo4awY61MPoZcFIYn8Ni/oWrYmPO kuYGN9zs8gmy1fFiR2smzU1F+l8LrL1O3+MA4QfBEiAJzUsMp20hlVDLFMP8UtvKeZUB CE1qnLmgDq+1dkSAHvdsYpmcKvz5WlsmQ/LGb4XPro5eyfYP1f2V6QWdwulusTxBqsZr BkG6yd0ceLfsyty6Hty52CSEobg8bLDJ7sF5RO6tiLbCuZ46VBqjgN61tYWgorT9JvAM 9s6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="1/NHMBlM"; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c2-20020a170902724200b00153b2d1661asi2831969pll.546.2022.03.25.11.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:24:42 -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; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b="1/NHMBlM"; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B85B6E349; Fri, 25 Mar 2022 10:48:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354065AbiCYMdo (ORCPT + 99 others); Fri, 25 Mar 2022 08:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355069AbiCYMdi (ORCPT ); Fri, 25 Mar 2022 08:33:38 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03A3D082E for ; Fri, 25 Mar 2022 05:32:03 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id e22so6052520qvf.9 for ; Fri, 25 Mar 2022 05:32:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=30XACj7MPd58k847MdVpAvMgBiu+f7RKwoRCwiRj2M0=; b=1/NHMBlMYr4S0tmnHJKQ1f0aW5m7ZbjeTgsJFToM+Np2p06XtO28uIwvqjpeaBwFrc CoxMmjLhXUK3mF/YrXlidIrQ4Cet/DoXiSYLOFSfBT9oOQSrvE8Y6thLB+4eEin7LyWH ChKLuVY1EpJhr8KBvKtkemqI5T9ogjhN34If0J5MqBGG9raCWGRFJzanax9S3ChXS9ln M31syk/lXoBjd8fAjNTNIuDsDHioKLAqRdR5wT0YnCvLrtJKRx1zlrtsvb537R59e+Ir UiOqGIHPEMXkYORMWFSj1QfT5pZ90P31+0yGw2IOATq9Nr6q4Rq//Aamjv2BNohm+qDm 2gXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=30XACj7MPd58k847MdVpAvMgBiu+f7RKwoRCwiRj2M0=; b=AKW3wwmoDWP4rgxNW0Lzpf4Dx6eiP+zRr2bOe6rp/oOCgVExurj0LO8bAFnYkp7k7b zhGplI1ihXriUE3COBfuzxVZKjT2hgtkDItXDZhe9zVMAZ8656AAqK3x8uceV1TEivMC XiAok3+XkzNfepNTJi6tQvUxvpAqaRzlYgmzI/rAP5GRnLMd8Sq2fqH6B/oYasv9aY/d 3oMLysfs+d1DXDEULPoL2KgRfMJw9gGKgeprK7oPW7b4psT2jzORO2NEMkRtGkSbh7UT 9VCs6znmB3iqZJOgmXDfouD6gtqAZHj0xefjYcF8ilcsDfAsk8M0oS03ntNlSGjNowG2 IaMg== X-Gm-Message-State: AOAM532HYmbq/fReul8/jO55KM9JHMRLzru8itVbvHHWg56mO0gSGemW tcVMxLSfT3Ae5AJ7D+dLKtd0fg== X-Received: by 2002:ad4:5de6:0:b0:441:6595:72cd with SMTP id jn6-20020ad45de6000000b00441659572cdmr8431975qvb.73.1648211522828; Fri, 25 Mar 2022 05:32:02 -0700 (PDT) Received: from nicolas-tpx395.localdomain (173-246-12-168.qc.cable.ebox.net. [173.246.12.168]) by smtp.gmail.com with ESMTPSA id c10-20020ac87dca000000b002e1db1b7b10sm4949196qte.25.2022.03.25.05.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 05:32:02 -0700 (PDT) Message-ID: Subject: Re: [PATCH v1] media: videobuf2: Allow applications customize data offsets of capture buffers From: Nicolas Dufresne To: Dmitry Osipenko , Mauro Carvalho Chehab , Tomasz Figa , Marek Szyprowski , Hans Verkuil , 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 Date: Fri, 25 Mar 2022 08:32:01 -0400 In-Reply-To: References: <20220322132329.6527-1-dmitry.osipenko@collabora.com> <9ec970d6-ea09-802c-419b-b2ef26800990@collabora.com> <5be83f0b343c04d877a2c2d805fb5f71ca9973b1.camel@ndufresne.ca> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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). 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