Show a patch.

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

{
    "id": 4129,
    "url": "https://patchwork.libcamera.org/api/patches/4129/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/4129/",
    "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": "<20200623020930.1781469-3-niklas.soderlund@ragnatech.se>",
    "date": "2020-06-23T02:09:22",
    "name": "[libcamera-devel,v3,02/10] libcamera: ipu3: Fold mediaBusToFormat() into only caller",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b8e091647c0151f9eab68d879b5e33164e750ae4",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/4129/mbox/",
    "series": [
        {
            "id": 1027,
            "url": "https://patchwork.libcamera.org/api/series/1027/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1027",
            "date": "2020-06-23T02:09:20",
            "name": "libcamera: ipu3: Allow zero-copy RAW stream",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1027/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/4129/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/4129/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A079609B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jun 2020 04:09:44 +0200 (CEST)",
            "from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 9a3f21d2-b4f6-11ea-933e-005056917a89;\n\tTue, 23 Jun 2020 04:09:43 +0200 (CEST)"
        ],
        "X-Halon-ID": "9a3f21d2-b4f6-11ea-933e-005056917a89",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 23 Jun 2020 04:09:22 +0200",
        "Message-Id": "<20200623020930.1781469-3-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200623020930.1781469-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200623020930.1781469-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 02/10] libcamera: ipu3: Fold\n\tmediaBusToFormat() into only caller",
        "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>",
        "X-List-Received-Date": "Tue, 23 Jun 2020 02:09:44 -0000"
    },
    "content": "Make the code easier to read and refactor.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 38 ++++++++++++++--------------\n 1 file changed, 19 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 1a59de0c58975b3c..c525e30a5ad35011 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -134,8 +134,6 @@ public:\n \tint start();\n \tint stop();\n \n-\tstatic V4L2PixelFormat mediaBusToFormat(unsigned int code);\n-\n \tV4L2VideoDevice *output_;\n \tV4L2Subdevice *csi2_;\n \tCameraSensor *sensor_;\n@@ -1503,7 +1501,25 @@ int CIO2Device::configure(const Size &size,\n \tif (ret)\n \t\treturn ret;\n \n-\toutputFormat->fourcc = mediaBusToFormat(sensorFormat.mbus_code);\n+\tV4L2PixelFormat v4l2Format;\n+\tswitch (sensorFormat.mbus_code) {\n+\tcase MEDIA_BUS_FMT_SBGGR10_1X10:\n+\t\tv4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10);\n+\t\tbreak;\n+\tcase MEDIA_BUS_FMT_SGBRG10_1X10:\n+\t\tv4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10);\n+\t\tbreak;\n+\tcase MEDIA_BUS_FMT_SGRBG10_1X10:\n+\t\tv4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10);\n+\t\tbreak;\n+\tcase MEDIA_BUS_FMT_SRGGB10_1X10:\n+\t\tv4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10);\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t}\n+\n+\toutputFormat->fourcc = v4l2Format;\n \toutputFormat->size = sensorFormat.size;\n \toutputFormat->planesCount = 1;\n \n@@ -1577,22 +1593,6 @@ int CIO2Device::stop()\n \treturn output_->streamOff();\n }\n \n-V4L2PixelFormat CIO2Device::mediaBusToFormat(unsigned int code)\n-{\n-\tswitch (code) {\n-\tcase MEDIA_BUS_FMT_SBGGR10_1X10:\n-\t\treturn V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10);\n-\tcase MEDIA_BUS_FMT_SGBRG10_1X10:\n-\t\treturn V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10);\n-\tcase MEDIA_BUS_FMT_SGRBG10_1X10:\n-\t\treturn V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10);\n-\tcase MEDIA_BUS_FMT_SRGGB10_1X10:\n-\t\treturn V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10);\n-\tdefault:\n-\t\treturn {};\n-\t}\n-}\n-\n REGISTER_PIPELINE_HANDLER(PipelineHandlerIPU3);\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "02/10"
    ]
}