Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7342713rwb; Tue, 6 Dec 2022 04:41:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf7kDLDm/1HGDkqfo14nhmsBo3c3X/fO+iARmAj9MEnFlrpY6Zl7XgLhkAF9JQIi8zh7a7se X-Received: by 2002:a17:906:1b48:b0:7c1:706:d63c with SMTP id p8-20020a1709061b4800b007c10706d63cmr3301147ejg.697.1670330498397; Tue, 06 Dec 2022 04:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670330498; cv=none; d=google.com; s=arc-20160816; b=ZFmy8EJfusQo0TbaHDV4Tg6WRfcZORQjJmp7KGTHo/DEwKabkP9xiVHrOPOiYRG3p9 Tpw5S9JX31cCKAfgVcroBDIMIXkL2r3lCz4vBxUKgsCa2edwGa0ImAhjeZsYj30lgXw1 9G9ddOjRKeTpSKvNwVnh83BFUzL7/GMwFZ2MfZi2ZYomHcD8T2r//QztRWlSHBc2N/42 mocsAVocTwQhcoO+7Lk8BeFJeCBHRZijT4xZ8L8V/GFA/dnl1qVomCWHDmVXGA9cGzKQ yel8ZJCntib52/0ZgIgNzLjG3m2IKjDrGRiKN8OvMq0F/1wk52L4Eppeb0vs/6WdY9/n W9Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FS41pdVPPftlkxjfAeNNX5m/JobiqQJnQqPs/qKrQKU=; b=zBDDYjWs9s5ZPmxG+NhKMqohvgJmOuGZBSvJirSX36QHkHQtumwfxyb5RnSBAWQ6aw rcwqhbTlYI8h2qVODfCK0dz1+fFqdO8pGz20d+GnE4crk9A35KiiY9YfRUaVfPL11ltL ZLwOq6yK6Rn4vI/oaAkrMoa5WKjJCUz7KVCFiU2UejK4sPEArscWO/JRaVDE8JjnbtE0 PY1qoRsQmFl8zooqMiOf7bmluFkxYQRC6LsEBTUHQxRl9I1/0isL3xZ1HwR6SNVEpiaZ 8tNF6ncr+L0Lx6KmcjvWPDL2KQ3nkBo7qQgb9IKmDUR+mpBMwzZJ1UTORP9HsbxdFCJ0 +wbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j70Ofvcx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a05640251d300b00467ad3f4426si2057391edd.312.2022.12.06.04.41.18; Tue, 06 Dec 2022 04:41:38 -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=@chromium.org header.s=google header.b=j70Ofvcx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbiLFMXk (ORCPT + 79 others); Tue, 6 Dec 2022 07:23:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbiLFMXi (ORCPT ); Tue, 6 Dec 2022 07:23:38 -0500 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD3FD2613B for ; Tue, 6 Dec 2022 04:23:33 -0800 (PST) Received: by mail-vs1-xe32.google.com with SMTP id 125so13963895vsi.9 for ; Tue, 06 Dec 2022 04:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FS41pdVPPftlkxjfAeNNX5m/JobiqQJnQqPs/qKrQKU=; b=j70OfvcxJivYV3jV9dIlvoC9BNn2MYMRSVLucnWH895vZoCq980rebl6a9/UqWIBdM 3P0EvrkWWODPFvC78By6kuYcw+EMeJnHxb1NP5nq1lXfbLX+8mE2VTXby5bCBclYSdHO iEBZSqPMhcinbId1+ejPOAfhXxXBBEPP4zhL4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FS41pdVPPftlkxjfAeNNX5m/JobiqQJnQqPs/qKrQKU=; b=tQzv0Gzd8hIw9apxvmXY+PPsWQSlykTUtquRE4+d8iqMrOb5Vb2V7lrBNTUvXnR8RC 8gL/eHM7tuiSK3UkDDeOhV5kZAmIrnF81qf2jSQs1Sb8a1O0cVaJVEwyeknY2EyQ9BuX CFsqRKqx1nfjkpFrzA6eMSL5LphRZKvIaG7heegEqU63u1ANS/8/1cXGn5FhIYZsYEL5 L/uezgFR9o23pWayHjyovM49KOrnmAq3YfmvASd7CxZUe098j2RuWndSKzftG5h1meFs JP7Dzs56zUZ94j9Z8RnIrPes/uXGm2+yI0+et7sC3fKOt9R7W9vAzpZzBg6taCqsVibE s+Lg== X-Gm-Message-State: ANoB5pmh3IIl24lkx6t3cCD8Q4KCmvQMvGwqIlzouKSdLbv8wdrA11Ry tj3tLEpS6odc/7C6E5h6PNHWNErXTw0fEDgRZ3fzOg== X-Received: by 2002:a05:6102:e0c:b0:3b0:6da7:39ba with SMTP id o12-20020a0561020e0c00b003b06da739bamr35260338vst.26.1670329412933; Tue, 06 Dec 2022 04:23:32 -0800 (PST) MIME-Version: 1.0 References: <20221129074530.640251-1-wenst@chromium.org> <45143854.fMDQidcC6G@kista> <5d79ed06-15c0-3564-97b6-5fd4433acabf@xs4all.nl> In-Reply-To: <5d79ed06-15c0-3564-97b6-5fd4433acabf@xs4all.nl> From: Chen-Yu Tsai Date: Tue, 6 Dec 2022 20:23:21 +0800 Message-ID: Subject: Re: [PATCH] media: cedrus: Convert to MPLANE uAPI To: Hans Verkuil Cc: =?UTF-8?Q?Jernej_=C5=A0krabec?= , Mauro Carvalho Chehab , Samuel Holland , linux-media@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicolas Dufresne Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Tue, Dec 6, 2022 at 4:35 PM Hans Verkuil wrot= e: > > On 05/12/2022 22:01, Jernej =C5=A0krabec wrote: > > Hi Chen-Yu! > > > > Dne torek, 29. november 2022 ob 08:45:30 CET je Chen-Yu Tsai napisal(a)= : > >> The majority of the V4L2 stateless video decoder drivers use the MPLAN= E > >> interface. > >> > >> On the userspace side, Gstreamer supports non-MPLANE and MPLANE > >> interfaces. Chromium only supports the MPLANE interface, and is not ye= t > >> usable with standard desktop Linux. FFmpeg support for either has not > >> landed. > > > > I don't like fixing userspace issues in kernel, if kernel side works fi= ne. > > Implementing missing non-MPLANE support in Chromium will also allow it = to work > > with older kernels. > > > > Hans, what's linux-media politics about such changes? > > Not keen on this. Does the cedrus HW even have support for multiple plane= s? > I suspect not, in which case the driver shouldn't suggest that it can do = that. > > Now, if the hardware *can* support this, then there is an argument to be = made > for the cedrus driver to move to the multiplanar API before moving it out > of staging to allow such future enhancements. AFAIK it can, but has some limitations on how far apart the buffers for the separate planes can be. Nicolas mentioned that I could support the multiplanar API, but only allow the contiguous single planar formats, so NV12 instead of NV12M. And I suspect that reference frames have to be contiguous as well. So I guess the overall answer is that it can't. But the same goes for Hantro or rkvdec, which both use the multiplanar API. This conversion was done so that I could use Cedrus as a testbed for developing new codec support, as I already own an H6 device. Added bonus is trying to get V4L2 decoder support to work for desktop Linux, without the libraries that ChromeOS ships. > Note that you have to choose whether to support single or multiplanar, yo= u > can't support both at the same time. > > So the decision to move to multiplanar should be led by the HW capabiliti= es. > > And Chromium really needs to support non-multiplanar formats as well. I'm > really surprised to hear that it doesn't, to be honest. Chromium does support non-multiplanar formats, such as NV12. In fact this is the preferred format, unless it's on MediaTek, in which it switches to MM21 as the capture format, and does untiling in software. This support for formats is separate from using the multiplanar API. Support for video decoders is mostly driven by ChromeOS. Currently all the hardware ChromeOS supports, be it stateful or stateless, use the multiplana= r API, so there hasn't been a real need to support it yet. Regards ChenYu > Regards, > > Hans > > > > > Best regards, > > Jernej > > > >> > >> A fallback route using libv4l is also available. The library translate= s > >> MPLANE interface ioctl calls to non-MPLANE ones, provided that the pix= el > >> format used is single plane. > >> > >> Convert the Cedrus driver to the MPLANE interface, while keeping the > >> supported formats single plane. Besides backward compatibility through > >> the plugin, the hardware requires that different planes not be located > >> too far apart in memory. Keeping the single plane pixel format makes > >> this easy to enforce. > >> > >> Signed-off-by: Chen-Yu Tsai > >> --- > >> > >> This has been tested with Fluster. The score remained the same with or > >> without the patch. This also helps with getting VP8 decoding working > >> with Chromium's in-tree test program "video_decode_accelerator_tests", > >> though Chromium requires other changes regarding buffer allocation and > >> management. > > > > >