Show a patch.

GET /api/patches/18812/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18812,
    "url": "https://patchwork.libcamera.org/api/patches/18812/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18812/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20230712105510.14658-2-naush@raspberrypi.com>",
    "date": "2023-07-12T10:55:08",
    "name": "[libcamera-devel,v1,1/3] libcamera: rpi: pipeline_base: Remove populateSensorFormats()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5e000fb53356d588f70c09bd089766655a38ce35",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18812/mbox/",
    "series": [
        {
            "id": 3968,
            "url": "https://patchwork.libcamera.org/api/series/3968/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3968",
            "date": "2023-07-12T10:55:07",
            "name": "Raspberry Pi: Configuration simplifications",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3968/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18812/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18812/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 9B05CBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 12 Jul 2023 10:55:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 611D9628C5;\n\tWed, 12 Jul 2023 12:55:19 +0200 (CEST)",
            "from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com\n\t[IPv6:2a00:1450:4864:20::32f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 120C8628BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Jul 2023 12:55:17 +0200 (CEST)",
            "by mail-wm1-x32f.google.com with SMTP id\n\t5b1f17b1804b1-3fbf1b82dc7so69572365e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Jul 2023 03:55:17 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th14-20020a05600c260e00b003fc05b89e5bsm4729236wma.34.2023.07.12.03.55.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 12 Jul 2023 03:55:16 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689159319;\n\tbh=GbCNopN9pW8LtUqh1yGFB6TheYb7T5Tuyy3vafgL4PE=;\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=OMsNXyzwZBP4h71izVpUQmE5u3V9O8dzPkYAP0N/7yZ+QQwCrk+PksScP1UvEBgR1\n\tUXp4sYMCfRDP68oWpzzC/ysLSximpq9MwcSOgshOHyXCTl5WjK4MqRY0Ub6Mljiluo\n\t14FFLAnU4FqV01Y8Xsp0ex2KlmLTJTrDHIW8bey4sZmf2CFoYDbCkqLcCVK9070mzQ\n\tdw42SnmA7kU7A5XOLaqJ01sW8O7K85mf5rXf+Pibf3nLQ5+P0JLU5xGd5RhmAPfk1j\n\tjVZZUOQvG+Lzu8AQN0inl77LyyS5u+Mt9v111zP5o1CJ+IC3K9NSiwg81hNft9t8Gu\n\t0NkvXQNg7g8bA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1689159316; x=1691751316;\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=3I3mQQ7p5w35xVgOx/HdcUcYkY49S25NpmzKkcobU9k=;\n\tb=ALfh0iSZU/WGHF7gvWJXhIsMGlKaFH8rXKZowmMPLWEk+G2Vef+Pjr2cmCr+0vQf8d\n\tso64oRQOoi2Q5LNt/jxLUaoW3zBsXRqyeGD2sw/3a67D4m04y/qsaBb54+W5vf6BiWSR\n\tfh0MSqTnAxvFFupQzE9eZdTbkV7TdMMqNSjpeSsLI0IXU/PP2ViS1CB1elvoPwR5/azn\n\t5iq9yKY/FXw/PP5csH3BWqDaOugHM7/pN+QCBgUIXotZQvLdTE4IL5InWP52BQHigbaY\n\tYwmhJH8yTkXLx1UpejTbU0pax2yovhF0XZVenVaIfVx5sY5btSb7+Sy1+sa32XcVuBBA\n\t0zEg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ALfh0iSZ\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1689159316; x=1691751316;\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=3I3mQQ7p5w35xVgOx/HdcUcYkY49S25NpmzKkcobU9k=;\n\tb=Ms7psF1D5RIciopSJcAXUVwdWUZael6aKiecb+qtMy9BzfhJNPBGW4PkAE1Wk0yDKS\n\tezPR8wg7V51tIumSW+Xo3eFvIFdiBC4CgKUcxyCqO4UQCvQG6dpPLk/g7Un7TZSNkXNv\n\tM4zOZUvyjnC5w6BWWruY+k0tPLuRU0N9dN+khZ4eBBa8FIpzl0edFYb2LmDGYeWr25Y9\n\tiJgOn4410QVtlUYr4STxS9nKBm5Irne/0cu21+uxbzebEO1fLoikZxMecYkgWV+1Brp7\n\tvtYd0mC1olIsbSaz/ewLGLnoFV2KyxMbfmv9Io6GJRri2ChFJ+Q8Jjeow3aTcFDIP+qN\n\tFbIg==",
        "X-Gm-Message-State": "ABy/qLYjZGKd4FcKJ/1P5gSGkrqyf1J0DolHyAuG/Vl4KXm10UdSiGaH\n\tg1facTCQAMjtLJo27TqNT/xV3qeCu6qQPU+UHWIaYw==",
        "X-Google-Smtp-Source": "APBJJlFj5u21CRGoEiRJUGOAlkVefo2HF4ugzBK/yK/7ph6wQ5QShI9zDKaZ3Xx5o6urPwRTVivGHQ==",
        "X-Received": "by 2002:a1c:750a:0:b0:3fb:c462:1833 with SMTP id\n\to10-20020a1c750a000000b003fbc4621833mr17406998wmc.30.1689159316355; \n\tWed, 12 Jul 2023 03:55:16 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 12 Jul 2023 11:55:08 +0100",
        "Message-Id": "<20230712105510.14658-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230712105510.14658-1-naush@raspberrypi.com>",
        "References": "<20230712105510.14658-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base:\n\tRemove populateSensorFormats()",
        "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>",
        "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": "From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\npopulateSensorFormats() is a static helper that is called from a single\nplace and performs a simple loop over the sensor camera formats.\n\nRemove it and in-line it in the caller to remove one static helper from\nthe pipeline_base.cpp file.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n .../pipeline/rpi/common/pipeline_base.cpp         | 15 ++++-----------\n 1 file changed, 4 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 179a5b81a516..fb3756a47590 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -66,16 +66,6 @@ PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,\n \treturn pix;\n }\n \n-SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor)\n-{\n-\tSensorFormats formats;\n-\n-\tfor (auto const mbusCode : sensor->mbusCodes())\n-\t\tformats.emplace(mbusCode, sensor->sizes(mbusCode));\n-\n-\treturn formats;\n-}\n-\n bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)\n {\n \tunsigned int mbusCode = sensor->mbusCodes()[0];\n@@ -804,7 +794,10 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n \tif (data->sensor_->init())\n \t\treturn -EINVAL;\n \n-\tdata->sensorFormats_ = populateSensorFormats(data->sensor_);\n+\t/* Populate the map of sensor supported formats and sizes. */\n+\tfor (auto const mbusCode : data->sensor_->mbusCodes())\n+\t\tdata->sensorFormats_.emplace(mbusCode,\n+\t\t\t\t\t     data->sensor_->sizes(mbusCode));\n \n \t/*\n \t * Enumerate all the Video Mux/Bridge devices across the sensor -> Fr\n",
    "prefixes": [
        "libcamera-devel",
        "v1",
        "1/3"
    ]
}