{"id":18083,"url":"https://patchwork.libcamera.org/api/patches/18083/?format=json","web_url":"https://patchwork.libcamera.org/patch/18083/","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":"<20230103113313.5423-2-david.plowman@raspberrypi.com>","date":"2023-01-03T11:33:12","name":"[libcamera-devel,v2,1/2] libcamera: camera: fix validateColorSpaces to choose the correct \"main\" colour space","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a193144c6ea10790a796c81e2a8fd68e5dc228ac","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18083/mbox/","series":[{"id":3698,"url":"https://patchwork.libcamera.org/api/series/3698/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3698","date":"2023-01-03T11:33:11","name":"Fix colour spaces on Raspberry Pi","version":2,"mbox":"https://patchwork.libcamera.org/series/3698/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18083/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18083/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 8A8AEC3291\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 Jan 2023 11:33:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 950F661F0F;\n\tTue,  3 Jan 2023 12:33:19 +0100 (CET)","from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com\n\t[IPv6:2a00:1450:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD75861F0F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Jan 2023 12:33:17 +0100 (CET)","by mail-wr1-x42a.google.com with SMTP id az7so4724520wrb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 03 Jan 2023 03:33:17 -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\th10-20020a5d4fca000000b00281eab50380sm24325767wrw.117.2023.01.03.03.33.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 03 Jan 2023 03:33:16 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1672745599;\n\tbh=AjsZ5OBxjl+SqU7Re2waHsIwAPXf1FOEa0JjUaSIn9U=;\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=XkZq/EkE48brT5PuOVlYoQLL/GJiN6kyTOOYf4+Hk8RRhc8aj0Bzb/rq0J1kvc/hl\n\tfPkGrxp6cMdC1BhQ4rH9+j3FynyhQ2CrI2iwGWfZOYyiUN3Xeq8PZXOxY4+AQbU9+b\n\tFrIkrBcBGHsMz3xTU3QoBewM7zXgtaiXtQLHKFueRc8zFcOOzgD2Z7AzN6Hhb8WFX0\n\tf/vUPskhLNGStvgKhZVeY8Us1FweulsxohxjcSWiQL1NO5tUdiiOk/PQm208hEREwe\n\t3+kFMxHrQ6yD2tG9V4sPwCEhtV9OxL8wTrhRaH+grd6RPZqt6qPEOp/CtvxJg1IV5i\n\tU+BoJWIL02Qkg==","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=K49KIMd4v47JvPDJ6npG1gv54cNQtVc9KB/uy2SBRng=;\n\tb=OYQUy6h9b67uzVQft6YChIjHChYSysnGu3Zx9IvyxbdstPduoPn5srqD8bU5l5wJPw\n\tEDs6+/BnDSCFNQQT3rZTvHRb6ZG+k13cQTCNFsyHGXCXHkWbaz1aOJFZiqhHG2jsAN25\n\tHl7jOgl3XCT3gptTn167zfwmm83wgN9FUX6v9r5bNyZ5WT6YYWFiEqKIl8F0ndo1qzJJ\n\tDPMx60RcTd/pAoTh14b7Nm7mo5IB0/T3EM8QWNbMavk7gDWSEofpDr6bB21i7ugmyj82\n\tYNOCgbpeAwgwCcF85ZcnU8nHC9ttz03M76BruDqbUi5kfSzbraPDYOq9D8S703MZfFnz\n\tIS+A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"OYQUy6h9\"; 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=K49KIMd4v47JvPDJ6npG1gv54cNQtVc9KB/uy2SBRng=;\n\tb=IDvP8ep6Ob5o8ClnHANMIg50i4SdgX395ORDLfZTWhMNnq+NoEk48O7sHWRgCbpCJ9\n\taBK+tPnH3Pz7c69YFWtJ2J+s9aGIjdw8hiwLIgXAhJ1/IMApK3ci02KJfLGjjmWiC/jp\n\tQOgxXADOQD2fqEYfxzerQ6EsLyYRMw2DaDdie6Lo1i0IoUaolOGDrFmNEGNE///bTcq6\n\tvL3PBFC4jPgeFsSsqzniTyl3WywNMoQ/XTm80LebYq89bbTnwOETAbRM/6yVZ6CbHYtF\n\thi4kBoqLD5OAZxj8WnAsjyHnRBCq7nKeY/6fhrVNtGw165Fcgi5Wcqk4hOlqN+uH8Yym\n\tXzXA==","X-Gm-Message-State":"AFqh2krNSU4ftPrT3TYBC7eWfRgmO4Y0c2e8Xozo2gT9bsQxE1kKKLVk\n\twQI3/RWkoX24uaHDDC4pIMpCBUVcftdU+Sr3","X-Google-Smtp-Source":"AMrXdXvDPrLVf7pt9S7UNbU1IN0crpI8RFDYz85+T5zKGuIh5oivuxzi6GV4MPA4Kay/7OqAkHURQQ==","X-Received":"by 2002:a5d:4645:0:b0:27f:fb47:2362 with SMTP id\n\tj5-20020a5d4645000000b0027ffb472362mr16893604wrs.49.1672745597112; \n\tTue, 03 Jan 2023 03:33:17 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  3 Jan 2023 11:33:12 +0000","Message-Id":"<20230103113313.5423-2-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20230103113313.5423-1-david.plowman@raspberrypi.com>","References":"<20230103113313.5423-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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>\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","v2","1/2"]}