[{"id":12941,"web_url":"https://patchwork.libcamera.org/comment/12941/","msgid":"<20201002140930.udjtgiagw7roxurc@uno.localdomain>","date":"2020-10-02T14:09:30","subject":"Re: [libcamera-devel] [PATCH v2 2/6] libcamera: pipeline: rkisp1:\n\tFix media bus propagation for NV{12, 21}","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Thu, Oct 01, 2020 at 05:45:56PM +0200, Niklas Söderlund wrote:\n> The upstream driver has changed how the link formats are validated when\n> starting to stream [1]. This revealed that libcamera did not adjust the\n> media bus format from the link between {main,self} resizer source pad\n> and the capture video device as expected by the driver.\n>\n> The media bus code YUYV8_2X8 was hardcoded to MEDIA_BUS_FMT_YUYV8_2X8\n> for all pixel formats while it must be adjusted to YUYV8_1_5X8 for NV12\n> and NV21, fix this.\n\n5X8 ?\n\nI've seen comments on this but didn't get if that should be fixed\nupstream ?\n\n>\n> 1. 6803a9e0e1e43e9e (\"media: staging: rkisp1: cap: simplify link validation by comparing media bus code\")\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n> * Changes since v1\n> - Spelling commit message.\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 410e9f5d94607f44..63c643f22affc74a 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> @@ -7,6 +7,8 @@\n>\n>  #include \"rkisp1_path.h\"\n>\n> +#include <linux/media-bus-format.h>\n> +\n>  #include <libcamera/formats.h>\n>  #include <libcamera/stream.h>\n>\n> @@ -125,6 +127,16 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n>  \t\t<< \"Configuring \" << name_ << \" resizer output pad with \"\n>  \t\t<< ispFormat.toString();\n>\n> +\tswitch (config.pixelFormat) {\n> +\tcase formats::NV12:\n> +\tcase formats::NV21:\n> +\t\tispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8;\n> +\t\tbreak;\n> +\tdefault:\n> +\t\tispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8;\n> +\t\tbreak;\n> +\t}\n> +\n>  \tret = resizer_->setFormat(1, &ispFormat);\n>  \tif (ret < 0)\n>  \t\treturn ret;\n> --\n> 2.28.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C1493C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Oct 2020 14:05:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3922663B6E;\n\tFri,  2 Oct 2020 16:05:35 +0200 (CEST)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65E6D60360\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Oct 2020 16:05:34 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id D866660019;\n\tFri,  2 Oct 2020 14:05:33 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Fri, 2 Oct 2020 16:09:30 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20201002140930.udjtgiagw7roxurc@uno.localdomain>","References":"<20201001154600.2722718-1-niklas.soderlund@ragnatech.se>\n\t<20201001154600.2722718-3-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201001154600.2722718-3-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] libcamera: pipeline: rkisp1:\n\tFix media bus propagation for NV{12, 21}","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12946,"web_url":"https://patchwork.libcamera.org/comment/12946/","msgid":"<20201002144344.4plrtnemqyfrlrlf@oden.dyn.berto.se>","date":"2020-10-02T14:43:44","subject":"Re: [libcamera-devel] [PATCH v2 2/6] libcamera: pipeline: rkisp1:\n\tFix media bus propagation for NV{12, 21}","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nOn 2020-10-02 16:09:30 +0200, Jacopo Mondi wrote:\n> Hi Niklas,\n> \n> On Thu, Oct 01, 2020 at 05:45:56PM +0200, Niklas Söderlund wrote:\n> > The upstream driver has changed how the link formats are validated when\n> > starting to stream [1]. This revealed that libcamera did not adjust the\n> > media bus format from the link between {main,self} resizer source pad\n> > and the capture video device as expected by the driver.\n> >\n> > The media bus code YUYV8_2X8 was hardcoded to MEDIA_BUS_FMT_YUYV8_2X8\n> > for all pixel formats while it must be adjusted to YUYV8_1_5X8 for NV12\n> > and NV21, fix this.\n> \n> 5X8 ?\n> \n> I've seen comments on this but didn't get if that should be fixed\n> upstream ?\n\nIt looks like this should be fixed upstream, but what is in this patch \nmatches current upstream and without it NV12 is broken. As it's fixed \nupstream an accompanying patch should be submitted to libcamera.\n\n> \n> >\n> > 1. 6803a9e0e1e43e9e (\"media: staging: rkisp1: cap: simplify link validation by comparing media bus code\")\n> >\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> > ---\n> > * Changes since v1\n> > - Spelling commit message.\n> > ---\n> >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 12 ++++++++++++\n> >  1 file changed, 12 insertions(+)\n> >\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > index 410e9f5d94607f44..63c643f22affc74a 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> > @@ -7,6 +7,8 @@\n> >\n> >  #include \"rkisp1_path.h\"\n> >\n> > +#include <linux/media-bus-format.h>\n> > +\n> >  #include <libcamera/formats.h>\n> >  #include <libcamera/stream.h>\n> >\n> > @@ -125,6 +127,16 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n> >  \t\t<< \"Configuring \" << name_ << \" resizer output pad with \"\n> >  \t\t<< ispFormat.toString();\n> >\n> > +\tswitch (config.pixelFormat) {\n> > +\tcase formats::NV12:\n> > +\tcase formats::NV21:\n> > +\t\tispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8;\n> > +\t\tbreak;\n> > +\tdefault:\n> > +\t\tispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8;\n> > +\t\tbreak;\n> > +\t}\n> > +\n> >  \tret = resizer_->setFormat(1, &ispFormat);\n> >  \tif (ret < 0)\n> >  \t\treturn ret;\n> > --\n> > 2.28.0\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EC9F0C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Oct 2020 14:43:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B89C863BBF;\n\tFri,  2 Oct 2020 16:43:47 +0200 (CEST)","from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE57E63BA7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Oct 2020 16:43:45 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id u21so1391580ljl.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 02 Oct 2020 07:43:45 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq6sm257214ljg.115.2020.10.02.07.43.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 02 Oct 2020 07:43:44 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"jZKUH3Lg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=33OkD6Q2k0Z97+mFgOhwO34zQLkCQE0cnTAQyLrZ7Tg=;\n\tb=jZKUH3LgmJ9ME4Uu6cf5Y+Mpb4/YmVL3xTTZk0LS7nUuHn2F8Djw7L5IOIwL+4X2r5\n\tcGaN9kiA3ZbuskBaTP4lk33qLYt4qqFrYDiRVrAkX9+OVVZ74/rs3d8DH+Yk1LpQRwlT\n\tSQJTxePLSaU3vLAODrQviEThLm7mCyjA0vjaP84A+U8qpdaoNuEX2S6rBNs3IzXFHVU1\n\tFgKQesJuoGTDrjd4lyxJ7inZm+cdgqgnjEFpax4uDLt4n7ZC7zwGzj06G8QSFoV8UTir\n\tANRIR/XEmzchCJnmDoNK9SAQLfLZ56GsrkjZpJxZPhDkCFC7cLGqK+asbTtl+aENFPg2\n\tKh9A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=33OkD6Q2k0Z97+mFgOhwO34zQLkCQE0cnTAQyLrZ7Tg=;\n\tb=AnNoI7lE2rTJOysFFn6EGbjocqoQOUqk+/PyEuMrg4D1NxUrPMHF5tQkJCWWB5pERZ\n\t3+lt/FoSMRtf0Wx9h9z4cZRsZxMA+wALYWXGSMD3oIzHLcoT3ivMP5IQCPdCMtXWfJVa\n\tqCJdLVv01+soGOGynJFAOBU3/ClWk7MwQ37jrEzI3SpoznzP/8c0wmYfkC16cMStygTN\n\tePa9R3yi2Hr8gTF4El/cOOJ1Ix2hLq/Z3rvWoKjXtuBRA69YZjxFqHJPwGb+lKEWF8eg\n\tsGp9BHwN8A5Md/0MT/5PKInEnMRp0FzpSwtPYXw+PJHanxrMPFRWoxxt4R7eKiVnl6op\n\t1SLA==","X-Gm-Message-State":"AOAM531W3hWZyM3XjSnUjUa7ZulACaVrLw4fIsDRLt1QxN8DInl55O3K\n\tprXxq5lriT8UmQGoEGY6I7gmaQ==","X-Google-Smtp-Source":"ABdhPJwkW8cEnRhHhsrM9U73HhT2oXbbWicLtKs1zCpizwNfuqeNAFcNL+rkDn234KWroGh9RRDJhQ==","X-Received":"by 2002:a05:651c:203:: with SMTP id\n\ty3mr791941ljn.93.1601649825097; \n\tFri, 02 Oct 2020 07:43:45 -0700 (PDT)","Date":"Fri, 2 Oct 2020 16:43:44 +0200","From":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20201002144344.4plrtnemqyfrlrlf@oden.dyn.berto.se>","References":"<20201001154600.2722718-1-niklas.soderlund@ragnatech.se>\n\t<20201001154600.2722718-3-niklas.soderlund@ragnatech.se>\n\t<20201002140930.udjtgiagw7roxurc@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201002140930.udjtgiagw7roxurc@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v2 2/6] libcamera: pipeline: rkisp1:\n\tFix media bus propagation for NV{12, 21}","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]