{"id":16546,"url":"https://patchwork.libcamera.org/api/patches/16546/?format=json","web_url":"https://patchwork.libcamera.org/patch/16546/","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":"<20220705135956.30444-1-naush@raspberrypi.com>","date":"2022-07-05T13:59:56","name":"[libcamera-devel,v2] pipeline: raspberrypi: Fix incorrect advertising of ScalerCrop","commit_ref":"090ac6941679a49ea3c96de492a9f0ec00b2dd0c","pull_url":null,"state":"accepted","archived":false,"hash":"ff829e2fac4e489894cc97ea8a7edab8981dc374","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16546/mbox/","series":[{"id":3253,"url":"https://patchwork.libcamera.org/api/series/3253/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3253","date":"2022-07-05T13:59:56","name":"[libcamera-devel,v2] pipeline: raspberrypi: Fix incorrect advertising of ScalerCrop","version":2,"mbox":"https://patchwork.libcamera.org/series/3253/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16546/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16546/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 73A96BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Jul 2022 14:00:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE01563310;\n\tTue,  5 Jul 2022 16:00:00 +0200 (CEST)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B246861FB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Jul 2022 15:59:59 +0200 (CEST)","by mail-wr1-x42f.google.com with SMTP id z12so8101029wrq.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Jul 2022 06:59:59 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\to4-20020a05600c378400b003a2b708c26dsm2384726wmr.40.2022.07.05.06.59.58\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Jul 2022 06:59:58 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657029600;\n\tbh=xTrqaBfoeMP/MqsW++lItxr6WK6dE1ufHkUEi/kBttA=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=qZ5w4NobvZve95k+nHd50FGnT2SKBBh5EmJKZbXNH9ATMYu4KjYp6247YyE891jee\n\tHXvo5Bm7i9yXG8GeIBp6XuErPY88dgJYCUzfUy+z9jiDqFkje/uKl0fCDwUmxhevbS\n\tLd6WK8YHM9rd9T+hPnc7kCyG7Its11TEVuKxcCNNREMlr9rGG0Er8aQy8onNYazlJC\n\tsHE0y7sBN6Bf9L5MnYe/gyBeePbPkMnxSoNw2+HRY+xSmXFIQWtoI5c4fVimrZBe1B\n\ttypkfRccvIIDOJ9FilSHYNf4VuFbwBUYTLCE3ZpuhpT7dbeNa9QpLdUqLTPQSjinFh\n\tB1BcT9Z/S5Ebg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=8Y7vGbRbzOMvWzHfn/SPxk8uOcnWTlPC+qFLWiwHB9k=;\n\tb=CJL1/XcBfSGjOixM3lH/B8Jz1jhvCmFnB+pex6Z2q4WYanZLMtLScEJttWKQKVx0Rc\n\t5y3mPDX4QUxwJkZU0QQZddkzsoznWbsXVU9w5r09rnez0gD4JOzdz5SXHT/g+wLILhUq\n\tKs9Y2OKuCbU9rPaYdo0GCzpwRUNSZ4DIyU8RgmR8Q5W3gwz9x5lq74fVVgeLHVUIXxED\n\ti+QOhiu7YJ96IVFz5Xc6nLhOTLUhxTFpZ2gm/wvKhGzEC1todcyhtrJC7uTbAdgSqwM+\n\tIkTr5mzudt0x4bQpPgMOEFE/yjijIHO6y2OGtVWRFBxFYkydkicK6u1sCJR975wVUQW8\n\tKjBg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"CJL1/XcB\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=8Y7vGbRbzOMvWzHfn/SPxk8uOcnWTlPC+qFLWiwHB9k=;\n\tb=Xlb0qVpQHdVjAkeve2fqpO8rjIQmB1L7mqsKSdi5sYA3+6Jz8uEcsURPkEaaHGWU71\n\tTqTgWem3tPqA0jbotJdhsF3JeXRVVnuBP80+UTZDupd6UIzJhhet2ZI+LLKSXRYpu20D\n\t1v9cjP8IpWztNZ7IskmSXa4Yfy9HLOj6rYNjOwgeiGXADOLMtlhrX/mU+Y/8D2Y13JjA\n\tiIgW6xyuMq8A43YWwVfXzpFwWG0S0AsXthPP6nRCnfIzE7nABF6KcRVtvnq4Jk0z1B/c\n\t0fzxl1NgxOzU8Xe0eeZvLiqWhEaoECBNLvZJEtc+tfR/JtqLW0IJFrEJoPGO64lWqolI\n\tQvgA==","X-Gm-Message-State":"AJIora8jTbuzoh/sVoUI1hi4j40smNY7WC8PvZFCabGNpdAIzw7tuQkM\n\t4nskPX0pD0BArJ6YO7J0MFjVfyU0WY8TxZvE","X-Google-Smtp-Source":"AGRyM1vmbI5vJUZo/Irv9qLx7SDf03xW7bTwJL+251YRASTWkDEYEIPf4V0FwRVr+MQWFV+Qk1JAQw==","X-Received":"by 2002:adf:e691:0:b0:21d:416f:8d16 with SMTP id\n\tr17-20020adfe691000000b0021d416f8d16mr25368686wrm.338.1657029598946; \n\tTue, 05 Jul 2022 06:59:58 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  5 Jul 2022 14:59:56 +0100","Message-Id":"<20220705135956.30444-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] pipeline: raspberrypi: Fix incorrect\n\tadvertising of ScalerCrop","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The controls::ScalerCrop in the ControlInfoMap was advertised based on the ISP\noutput Rectangle. This is incorrect, it needs to be set based on the sensor\noutput Rectangle. Fix this.\n\nAdditionally, do not use emplace to be consistent with the other controls set\nin the ControlInfoMap.\n\nFixes: 9dacde0d651d (pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handler)\nReported-by: David Plowman <david.plowman@raspberrypi.com>\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 66a84b1dfb97..fdc24cd530c2 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -946,8 +946,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t\tctrlMap.emplace(c.first, c.second);\n \n \t/* Add the ScalerCrop control limits based on the current mode. */\n-\tctrlMap.emplace(&controls::ScalerCrop,\n-\t\t\tControlInfo(Rectangle(data->ispMinCropSize_), Rectangle(data->sensorInfo_.outputSize)));\n+\tRectangle ispMinCrop(data->ispMinCropSize_);\n+\tispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);\n+\tctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));\n \n \tdata->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n \n","prefixes":["libcamera-devel","v2"]}