{"id":18572,"url":"https://patchwork.libcamera.org/api/patches/18572/?format=json","web_url":"https://patchwork.libcamera.org/patch/18572/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230427144740.64075-7-jacopo.mondi@ideasonboard.com>","date":"2023-04-27T14:47:40","name":"[libcamera-devel,v3,6/6] libcamera: imx8-isi: Remove mbusCode from formatsMap_","commit_ref":"ad1cd9e33fc019c0601472444b4889a09f48eaa6","pull_url":null,"state":"accepted","archived":false,"hash":"13c9c34bd7a5593beb9c6c96ee78e97723837f94","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18572/mbox/","series":[{"id":3852,"url":"https://patchwork.libcamera.org/api/series/3852/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3852","date":"2023-04-27T14:47:34","name":"libcamera: imx8-isi: Remove pixelformat-2-media-bus map","version":3,"mbox":"https://patchwork.libcamera.org/series/3852/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18572/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18572/checks/","tags":{},"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 35F06C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Apr 2023 14:48:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B73D6627F5;\n\tThu, 27 Apr 2023 16:48:06 +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 D0052627E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Apr 2023 16:48:01 +0200 (CEST)","from uno.lan (unknown\n\t[IPv6:2001:b07:5d2e:52c9:1cf0:b3bc:c785:4625])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8A8DB9B9;\n\tThu, 27 Apr 2023 16:47:49 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682606886;\n\tbh=7wheYTd0ZXcOF+QAuyhvx8SRQyE3fS+ZS+7n/Gjj01s=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=rBmlCYOhHl/mqcncA+6oc5rzsM9/30sgjclanlPL9P7T59O3S9M61y7k/2CjeRwRe\n\tYV5SofpouyHxRF1CyyM38tJpXQl0+wzhaHe4Ma31gHNdhrfu6BCMyVsQigF8n/85FI\n\tKJlEJZ5uZGphdVqSH95q2B0qZSpvX++kko94AHwZx6BlXu0NeDNUS/82KRqgSjMUti\n\tcFXllPy9tdYLUPxbnL8759RXoqyDeAukWPTEmdM+EpL5mUZ304Q6H55nxMkLFjvcEk\n\tzkRPshO0wLiTExmZSvqCbamY+k9pEmmiO9XrPbrpPpnyrqi4tZQqxRMryiJ0khh3yU\n\tRbTBgcXxxzEnw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1682606869;\n\tbh=7wheYTd0ZXcOF+QAuyhvx8SRQyE3fS+ZS+7n/Gjj01s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=g/B5kmJsuSpsyL3twQ0VuF5RdwRritYiC0Dgf7ijLtTIEwZ2nR42C7D0rW8Ax/oum\n\tNoE4vlMD+4BSb16gxVbtw7BDPDUxsQ4ThiQg1GRvDq5RKrGasOvdJHXgvidIoao0gq\n\tvHzxC+QMjHmUQszUow9M9Y+FCOI4pm/L/oLnyOaE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"g/B5kmJs\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 27 Apr 2023 16:47:40 +0200","Message-Id":"<20230427144740.64075-7-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.40.0","In-Reply-To":"<20230427144740.64075-1-jacopo.mondi@ideasonboard.com>","References":"<20230427144740.64075-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 6/6] libcamera: imx8-isi: Remove\n\tmbusCode from formatsMap_","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Now that the media bus code selection procedure does not depend\non the ISICameraConfiguration::formatsMap_ remove the association\nbetween PixelFormat supported by the ISI and the media bus code produced\nby the sensor.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\nTested-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 159 ++++---------------\n 1 file changed, 29 insertions(+), 130 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\nindex a8bb36e38c8a..449d90122c4c 100644\n--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n@@ -76,18 +76,6 @@ public:\n class ISICameraConfiguration : public CameraConfiguration\n {\n public:\n-\t/*\n-\t * formatsMap_ records the association between an output pixel format\n-\t * and the combination of V4L2 pixel format and media bus codes that have\n-\t * to be applied to the pipeline.\n-\t */\n-\tstruct PipeFormat {\n-\t\tunsigned int isiCode;\n-\t\tunsigned int sensorCode;\n-\t};\n-\n-\tusing FormatMap = std::map<PixelFormat, PipeFormat>;\n-\n \tISICameraConfiguration(ISICameraData *data)\n \t\t: data_(data)\n \t{\n@@ -95,7 +83,7 @@ public:\n \n \tStatus validate() override;\n \n-\tstatic const FormatMap formatsMap_;\n+\tstatic const std::map<PixelFormat, unsigned int> formatsMap_;\n \n \tV4L2SubdeviceFormat sensorFormat_;\n \n@@ -336,121 +324,33 @@ unsigned int ISICameraData::getMediaBusFormat(PixelFormat *pixelFormat) const\n  * Camera Configuration\n  */\n \n-/**\n- * \\todo Do not associate the sensor format to non-RAW pixelformats, as\n- * the ISI can do colorspace conversion.\n+/*\n+ * ISICameraConfiguration::formatsMap_ records the association between an output\n+ * pixel format and the ISI source pixel format to be applied to the pipeline.\n  */\n-const ISICameraConfiguration::FormatMap ISICameraConfiguration::formatsMap_ = {\n-\t{\n-\t\tformats::YUYV,\n-\t\t{ MEDIA_BUS_FMT_YUV8_1X24,\n-\t\t  MEDIA_BUS_FMT_UYVY8_1X16 },\n-\t},\n-\t{\n-\t\tformats::AVUY8888,\n-\t\t{ MEDIA_BUS_FMT_YUV8_1X24,\n-\t\t  MEDIA_BUS_FMT_UYVY8_1X16 },\n-\t},\n-\t{\n-\t\tformats::NV12,\n-\t\t{ MEDIA_BUS_FMT_YUV8_1X24,\n-\t\t  MEDIA_BUS_FMT_UYVY8_1X16 },\n-\t},\n-\t{\n-\t\tformats::NV16,\n-\t\t{ MEDIA_BUS_FMT_YUV8_1X24,\n-\t\t  MEDIA_BUS_FMT_UYVY8_1X16 },\n-\t},\n-\t{\n-\t\tformats::YUV444,\n-\t\t{ MEDIA_BUS_FMT_YUV8_1X24,\n-\t\t  MEDIA_BUS_FMT_UYVY8_1X16 },\n-\t},\n-\t{\n-\t\tformats::RGB565,\n-\t\t{ MEDIA_BUS_FMT_RGB888_1X24,\n-\t\t  MEDIA_BUS_FMT_RGB565_1X16 },\n-\t},\n-\t{\n-\t\tformats::BGR888,\n-\t\t{ MEDIA_BUS_FMT_RGB888_1X24,\n-\t\t  MEDIA_BUS_FMT_RGB565_1X16 },\n-\t},\n-\t{\n-\t\tformats::RGB888,\n-\t\t{ MEDIA_BUS_FMT_RGB888_1X24,\n-\t\t  MEDIA_BUS_FMT_RGB565_1X16 },\n-\t},\n-\t{\n-\t\tformats::XRGB8888,\n-\t\t{ MEDIA_BUS_FMT_RGB888_1X24,\n-\t\t  MEDIA_BUS_FMT_RGB565_1X16 },\n-\t},\n-\t{\n-\t\tformats::ABGR8888,\n-\t\t{ MEDIA_BUS_FMT_RGB888_1X24,\n-\t\t  MEDIA_BUS_FMT_RGB565_1X16 },\n-\t},\n-\t{\n-\t\tformats::SBGGR8,\n-\t\t{ MEDIA_BUS_FMT_SBGGR8_1X8,\n-\t\t  MEDIA_BUS_FMT_SBGGR8_1X8 },\n-\t},\n-\t{\n-\t\tformats::SGBRG8,\n-\t\t{ MEDIA_BUS_FMT_SGBRG8_1X8,\n-\t\t  MEDIA_BUS_FMT_SGBRG8_1X8 },\n-\t},\n-\t{\n-\t\tformats::SGRBG8,\n-\t\t{ MEDIA_BUS_FMT_SGRBG8_1X8,\n-\t\t  MEDIA_BUS_FMT_SGRBG8_1X8 },\n-\t},\n-\t{\n-\t\tformats::SRGGB8,\n-\t\t{ MEDIA_BUS_FMT_SRGGB8_1X8,\n-\t\t  MEDIA_BUS_FMT_SRGGB8_1X8 },\n-\t},\n-\t{\n-\t\tformats::SBGGR10,\n-\t\t{ MEDIA_BUS_FMT_SBGGR10_1X10,\n-\t\t  MEDIA_BUS_FMT_SBGGR10_1X10 },\n-\t},\n-\t{\n-\t\tformats::SGBRG10,\n-\t\t{ MEDIA_BUS_FMT_SGBRG10_1X10,\n-\t\t  MEDIA_BUS_FMT_SGBRG10_1X10 },\n-\t},\n-\t{\n-\t\tformats::SGRBG10,\n-\t\t{ MEDIA_BUS_FMT_SGRBG10_1X10,\n-\t\t  MEDIA_BUS_FMT_SGRBG10_1X10 },\n-\t},\n-\t{\n-\t\tformats::SRGGB10,\n-\t\t{ MEDIA_BUS_FMT_SRGGB10_1X10,\n-\t\t  MEDIA_BUS_FMT_SRGGB10_1X10 },\n-\t},\n-\t{\n-\t\tformats::SBGGR12,\n-\t\t{ MEDIA_BUS_FMT_SBGGR12_1X12,\n-\t\t  MEDIA_BUS_FMT_SBGGR12_1X12 },\n-\t},\n-\t{\n-\t\tformats::SGBRG12,\n-\t\t{ MEDIA_BUS_FMT_SGBRG12_1X12,\n-\t\t  MEDIA_BUS_FMT_SGBRG12_1X12 },\n-\t},\n-\t{\n-\t\tformats::SGRBG12,\n-\t\t{ MEDIA_BUS_FMT_SGRBG12_1X12,\n-\t\t  MEDIA_BUS_FMT_SGRBG12_1X12 },\n-\t},\n-\t{\n-\t\tformats::SRGGB12,\n-\t\t{ MEDIA_BUS_FMT_SRGGB12_1X12,\n-\t\t  MEDIA_BUS_FMT_SRGGB12_1X12 },\n-\t},\n+const std::map<PixelFormat, unsigned int> ISICameraConfiguration::formatsMap_ = {\n+\t{ formats::YUYV, MEDIA_BUS_FMT_YUV8_1X24 },\n+\t{ formats::AVUY8888, MEDIA_BUS_FMT_YUV8_1X24 },\n+\t{ formats::NV12, MEDIA_BUS_FMT_YUV8_1X24 },\n+\t{ formats::NV16, MEDIA_BUS_FMT_YUV8_1X24 },\n+\t{ formats::YUV444, MEDIA_BUS_FMT_YUV8_1X24 },\n+\t{ formats::RGB565, MEDIA_BUS_FMT_RGB888_1X24 },\n+\t{ formats::BGR888, MEDIA_BUS_FMT_RGB888_1X24 },\n+\t{ formats::RGB888, MEDIA_BUS_FMT_RGB888_1X24 },\n+\t{ formats::XRGB8888, MEDIA_BUS_FMT_RGB888_1X24 },\n+\t{ formats::ABGR8888, MEDIA_BUS_FMT_RGB888_1X24 },\n+\t{ formats::SBGGR8, MEDIA_BUS_FMT_SBGGR8_1X8 },\n+\t{ formats::SGBRG8, MEDIA_BUS_FMT_SGBRG8_1X8 },\n+\t{ formats::SGRBG8, MEDIA_BUS_FMT_SGRBG8_1X8 },\n+\t{ formats::SRGGB8, MEDIA_BUS_FMT_SRGGB8_1X8 },\n+\t{ formats::SBGGR10, MEDIA_BUS_FMT_SBGGR10_1X10 },\n+\t{ formats::SGBRG10, MEDIA_BUS_FMT_SGBRG10_1X10 },\n+\t{ formats::SGRBG10, MEDIA_BUS_FMT_SGRBG10_1X10 },\n+\t{ formats::SRGGB10, MEDIA_BUS_FMT_SRGGB10_1X10 },\n+\t{ formats::SBGGR12, MEDIA_BUS_FMT_SBGGR12_1X12 },\n+\t{ formats::SGBRG12, MEDIA_BUS_FMT_SGBRG12_1X12 },\n+\t{ formats::SGRBG12, MEDIA_BUS_FMT_SGRBG12_1X12 },\n+\t{ formats::SRGGB12, MEDIA_BUS_FMT_SRGGB12_1X12 },\n };\n \n /*\n@@ -988,11 +888,10 @@ int PipelineHandlerISI::configure(Camera *camera, CameraConfiguration *c)\n \t\t * size is taken from the sink's COMPOSE (or source's CROP,\n \t\t * if any) rectangles.\n \t\t */\n-\t\tconst ISICameraConfiguration::PipeFormat &pipeFormat =\n-\t\t\tISICameraConfiguration::formatsMap_.at(config.pixelFormat);\n+\t\tunsigned int isiCode = ISICameraConfiguration::formatsMap_.at(config.pixelFormat);\n \n \t\tV4L2SubdeviceFormat isiFormat{};\n-\t\tisiFormat.mbus_code = pipeFormat.isiCode;\n+\t\tisiFormat.mbus_code = isiCode;\n \t\tisiFormat.size = config.size;\n \n \t\tret = pipe->isi->setFormat(1, &isiFormat);\n","prefixes":["libcamera-devel","v3","6/6"]}