[{"id":12914,"web_url":"https://patchwork.libcamera.org/comment/12914/","msgid":"<20201001031551.GZ45948@pyrite.rasen.tech>","date":"2020-10-01T03:15:51","subject":"Re: [libcamera-devel] [PATCH 2/6] libcamera: pipeline: rkisp1: Fix\n\tmedia bus propagation for NV{12, 21}","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Wed, Sep 30, 2020 at 10:08:27PM +0200, Niklas Söderlund wrote:\n> The upstream driver have changed how the link formats are validated when\n\ns/have/has\n\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> 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\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\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 86273C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Oct 2020 03:16:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 54BD76221D;\n\tThu,  1 Oct 2020 05:16:01 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D3F960394\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Oct 2020 05:16:00 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 853B143;\n\tThu,  1 Oct 2020 05:15:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RCaDardM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601522159;\n\tbh=jNb+EnH8keTHaedQo+CE8qdjPzNZEU4d8Z8jtEYuKOw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RCaDardMGldVISDyMAGgysEOGXMCE9QctLtcjilln+iVpz1IN7YJdhoqgZ6p0NGFe\n\ty3lo47suQNSBvNxidJAjKe1nJwC4WK/j1VvjHEcfQnT2+8hQjcdPxElwjuKqme0riZ\n\t1Hhur0mum/vvw2hKHc2Rz++onHXI72naIQjlIkxQ=","Date":"Thu, 1 Oct 2020 12:15:51 +0900","From":"paul.elder@ideasonboard.com","To":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20201001031551.GZ45948@pyrite.rasen.tech>","References":"<20200930200831.2066751-1-niklas.soderlund@ragnatech.se>\n\t<20200930200831.2066751-3-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200930200831.2066751-3-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 2/6] libcamera: pipeline: rkisp1: Fix\n\tmedia 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>"}}]