{"id":18104,"url":"https://patchwork.libcamera.org/api/1.1/patches/18104/?format=json","web_url":"https://patchwork.libcamera.org/patch/18104/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20230112121044.28003-2-david.plowman@raspberrypi.com>","date":"2023-01-12T12:10:43","name":"[libcamera-devel,v3,1/2] libcamera: camera: fix validateColorSpaces to choose the correct \"main\" colour space","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a193144c6ea10790a796c81e2a8fd68e5dc228ac","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/1.1/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18104/mbox/","series":[{"id":3706,"url":"https://patchwork.libcamera.org/api/1.1/series/3706/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3706","date":"2023-01-12T12:10:42","name":"Fix colour spaces on Raspberry Pi","version":3,"mbox":"https://patchwork.libcamera.org/series/3706/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18104/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18104/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 00084C3293\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Jan 2023 12:10:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 949EA625E7;\n\tThu, 12 Jan 2023 13:10:49 +0100 (CET)","from mail-wr1-x430.google.com (mail-wr1-x430.google.com\n\t[IPv6:2a00:1450:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8401625D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Jan 2023 13:10:47 +0100 (CET)","by mail-wr1-x430.google.com with SMTP id co23so17886119wrb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Jan 2023 04:10:47 -0800 (PST)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tl7-20020a5d6747000000b002b57bae7174sm16318578wrw.5.2023.01.12.04.10.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 12 Jan 2023 04:10:46 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1673525449;\n\tbh=5qJSv9qloZbp4WTYuHb9d7+EK8c+aWU6h8/633U5MD4=;\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:\n\tFrom;\n\tb=ROM10voV7VHcmA4wFfb7f9g9jiw74MZ+Yhik9YbJnvDtR0tJ+pX4JRGR/xDpK8l2M\n\tG2z10agvbh+qL7hVL4zK71LO0zkjDWFhdc4Qq9FL/awjrKds1TJiuH3UbDlMaIFN5F\n\tiUmKwFsdtrhTC6znVG84x/cPYbOFPKUIrzzaRHazc0e+UK0JH/Z99CERhXvkxYfa63\n\tPImXkbHVDDYV8FVzkpKaVZ32Paeykq1W6mFajjgukaP17tIrV37qQjAc6STv4bbsOg\n\thDVqcMuJb/Ko/+2g6DiN/GMm9pAnAXVfgkf2FEcYvMB35O+c57wKJc0W2vozzLE2u7\n\tR4kF+UflyXsYQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=U8BY1Hbj/TP4UpyBoupossfU1k5vI8GWk2bScUkfbYg=;\n\tb=bB9V5AMSWOwKrJMlZbC+tWeER9kX7k7/tuLaBOvmS67zysnQkrnXXH/O4ReNi7eWmb\n\tSAmYFxqQtNett+UEX9G4V1k49Z7C4BDz9guor3+FF7mB4rNa2n7vNVvN0fR04RsQjCbz\n\tmnOKZG32iLXoNuadvb6AMHFI4hVGiFkL3NNmZpKfbRUrbi4C412lE7JDfWuCzaI5a34E\n\tEJR9kCL6JTYsmq9BJnkvH/H0pTZO3IRBbfY9EVlcVP1tyBZfNLA9gI1EXFkj4Y7zWwAa\n\tX1bH8K/P7yxZG0D1wl3z0jrGCd45Lf5p/nu58aMyamTfQl1dd2j6xq1JE3TNnBOuquSo\n\tjNgg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"bB9V5AMS\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=U8BY1Hbj/TP4UpyBoupossfU1k5vI8GWk2bScUkfbYg=;\n\tb=f7FSR+nLtQooTKLpo1gv4GVtaDRQXVionsq5N48zrvu447b5pKm18fUrBB/XnrR7/K\n\tu0V5nmW+MimftB4IkJ4Jm8wkLtKD4Gn/Ew9Gm0ELPw+1CsioY9Cb66g8xiG0jSAoeY1e\n\tykiTQI5xWMEgKPYvyUy8NwF9ibYhjXsoPcKoTxsikzRK7Y+sifjwCR4OE254BamHfzYX\n\triyikGjJ2XFhxTKJfV3ZVTzsToudmP7EmvAz60F/Ps3CcIyTeXiiwfuJ/Nycu2AvyfhL\n\tc4avx1d4duHZ2FqMoaQu+7SFw/XAhCWiIYpTtBnjarAg07G/qzS6HXRMAqMFeWqEicz7\n\tqOPA==","X-Gm-Message-State":"AFqh2kq1J3sF8p+U/MNmNvyvhNIVQjVur67LhuhgGo2IWjrb7IHg3k6Q\n\ty1PEqw3VED2cBDFQqtCmQlyR2dV0sIw6BdMD","X-Google-Smtp-Source":"AMrXdXvwdbE9DhQCNRAGdeXE9YbrX8GJZWj9x+oa3siJ2rBPKkXwuRJ99cKy67EBE6pGu4mau0wsuw==","X-Received":"by 2002:a05:6000:a1d:b0:2bb:dcf9:482b with SMTP id\n\tco29-20020a0560000a1d00b002bbdcf9482bmr12752788wrb.47.1673525447026; \n\tThu, 12 Jan 2023 04:10:47 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 12 Jan 2023 12:10:43 +0000","Message-Id":"<20230112121044.28003-2-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20230112121044.28003-1-david.plowman@raspberrypi.com>","References":"<20230112121044.28003-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 1/2] libcamera: camera: fix\n\tvalidateColorSpaces to choose the correct \"main\" colour space","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":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The intention is that the \"main\" colour space is the colour space of\nthe largest non-raw stream. Unfortunately the use of \"config_[i].size\"\nis clearly incorrect, and has been copied from prior versions of the\ncode. This small change merely corrects the error.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/camera.cpp | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 2d947a44..0da167a7 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -361,6 +361,7 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF\n \t * largest non-raw stream with a defined color space (if there is one).\n \t */\n \tstd::optional<ColorSpace> colorSpace;\n+\tSize size;\n \n \tfor (auto [i, cfg] : utils::enumerate(config_)) {\n \t\tif (!cfg.colorSpace)\n@@ -369,9 +370,10 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF\n \t\tif (cfg.colorSpace->adjust(cfg.pixelFormat))\n \t\t\tstatus = Adjusted;\n \n-\t\tif (cfg.colorSpace != ColorSpace::Raw &&\n-\t\t    (!colorSpace || cfg.size > config_[i].size))\n+\t\tif (cfg.colorSpace != ColorSpace::Raw && cfg.size > size) {\n \t\t\tcolorSpace = cfg.colorSpace;\n+\t\t\tsize = cfg.size;\n+\t\t}\n \t}\n \n \tif (!colorSpace || !(flags & ColorSpaceFlag::StreamsShareColorSpace))\n","prefixes":["libcamera-devel","v3","1/2"]}