Show a patch.

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

{
    "id": 19724,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19724/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19724/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20240315001613.2033-6-laurent.pinchart@ideasonboard.com>",
    "date": "2024-03-15T00:16:04",
    "name": "[v2,05/14] libcamera: v4l2_subdevice: Drop V4L2SubdeviceFormat::bitsPerPixel()",
    "commit_ref": "4c82481fc4622c2e78ec9f426bcad27728bb7079",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "940535e55bfad49cca98f3ab2c5dbbf6334b5cc0",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19724/mbox/",
    "series": [
        {
            "id": 4226,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4226/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4226",
            "date": "2024-03-15T00:15:59",
            "name": "libcamera: Prepare for new camera sensor class",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4226/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19724/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19724/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 F409CC3273\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Mar 2024 00:16:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 645AA62C8C;\n\tFri, 15 Mar 2024 01:16:30 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 295E862C92\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Mar 2024 01:16:23 +0100 (CET)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 794DB667\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Mar 2024 01:15:59 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"beqel/AV\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710461759;\n\tbh=Pg4uQoaMWO2GUzRp2K5pv1SNBn8CsFO3mNw+aOU96RI=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=beqel/AV9iGZejITN596hkQy5CuUS0m+Tvm/wwXoarBhdLONerZe9YcS/773JG+Pg\n\tr0QPHSmLhbZDSmYktoh3zzyUJggm2pDgWDVzr7Au4u8AytRX1uZXYkCo/vq9x4B1tT\n\t7Ac+ZrAHWY4tmWpn4Sba4bMDFu6r+WfNd1Gn8uTk=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v2 05/14] libcamera: v4l2_subdevice: Drop\n\tV4L2SubdeviceFormat::bitsPerPixel()",
        "Date": "Fri, 15 Mar 2024 02:16:04 +0200",
        "Message-ID": "<20240315001613.2033-6-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.2",
        "In-Reply-To": "<20240315001613.2033-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240315001613.2033-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The V4L2SubdeviceFormat::bitsPerPixel() function is just a wrapper\naround a MediaBusFormatInfo lookup. It made sense when the\nMediaBusFormatInfo class was not exposed outside of the compilation\nunit, but is now redundant. Drop it and use MediaBusFormatInfo in the\nonly caller.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/internal/v4l2_subdevice.h |  1 -\n src/libcamera/camera_sensor.cpp             |  3 ++-\n src/libcamera/v4l2_subdevice.cpp            | 10 ----------\n 3 files changed, 2 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex c9aa90e00ec8..a87981341d75 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -66,7 +66,6 @@ struct V4L2SubdeviceFormat {\n \tstd::optional<ColorSpace> colorSpace;\n \n \tconst std::string toString() const;\n-\tuint8_t bitsPerPixel() const;\n };\n \n std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f);\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 0ef78d9c8b0a..55c9c74b10c2 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -1060,7 +1060,8 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const\n \tret = subdev_->getFormat(pad_, &format);\n \tif (ret)\n \t\treturn ret;\n-\tinfo->bitsPerPixel = format.bitsPerPixel();\n+\n+\tinfo->bitsPerPixel = MediaBusFormatInfo::info(format.mbus_code).bitsPerPixel;\n \tinfo->outputSize = format.size;\n \n \tstd::optional<int32_t> cfa = properties_.get(properties::draft::ColorFilterArrangement);\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex a508cef4dcbb..84ec93154951 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -793,16 +793,6 @@ const std::string V4L2SubdeviceFormat::toString() const\n \treturn ss.str();\n }\n \n-/**\n- * \\brief Retrieve the number of bits per pixel for the V4L2 subdevice format\n- * \\return The number of bits per pixel for the format, or 0 if the format is\n- * not supported\n- */\n-uint8_t V4L2SubdeviceFormat::bitsPerPixel() const\n-{\n-\treturn MediaBusFormatInfo::info(mbus_code).bitsPerPixel;\n-}\n-\n /**\n  * \\brief Insert a text representation of a V4L2SubdeviceFormat into an output\n  * stream\n",
    "prefixes": [
        "v2",
        "05/14"
    ]
}