Show a patch.

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

{
    "id": 1730,
    "url": "https://patchwork.libcamera.org/api/patches/1730/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1730/",
    "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": "<20190805155133.11335-4-niklas.soderlund@ragnatech.se>",
    "date": "2019-08-05T15:51:32",
    "name": "[libcamera-devel,3/4] tests: v4l2_videodevice: Propagate media bus format",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5ece0e90d0e595b060f90c5fb00f80c9a2e5d4ab",
    "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/1730/mbox/",
    "series": [
        {
            "id": 445,
            "url": "https://patchwork.libcamera.org/api/series/445/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=445",
            "date": "2019-08-05T15:51:29",
            "name": "libcamera: Fix issues with vimc and Linux v5.2",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/445/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1730/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1730/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 028CC61619\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Aug 2019 17:51:40 +0200 (CEST)",
            "from bismarck.berto.se (unknown [145.14.112.32])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid e9c3971b-b798-11e9-903a-005056917f90;\n\tMon, 05 Aug 2019 17:51:39 +0200 (CEST)"
        ],
        "X-Halon-ID": "e9c3971b-b798-11e9-903a-005056917f90",
        "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": "Mon,  5 Aug 2019 17:51:32 +0200",
        "Message-Id": "<20190805155133.11335-4-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.22.0",
        "In-Reply-To": "<20190805155133.11335-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190805155133.11335-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 3/4] tests: v4l2_videodevice: Propagate\n\tmedia bus format",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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": "Mon, 05 Aug 2019 15:51:41 -0000"
    },
    "content": "Most of the video device tests are based on vimc and Linux commit\n85ab1aa1fac17bcd (\"media: vimc: deb: fix default sink bayer format\")\nchanges the default media bus format for the debayer subdevices. This\nleads to a -EPIPE error when trying to use the raw capture video device\nnodes.\n\nFix this by propagating the media bus format used on the debayer\nsubdevcie to the sensor. This allows the same code to function on\nkernels previous to the change and after it.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n .../v4l2_videodevice_test.cpp                 | 22 +++++++++++++++++++\n test/v4l2_videodevice/v4l2_videodevice_test.h |  7 +++++-\n 2 files changed, 28 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\nindex b26d06ad45197c8f..b1d4eaf6e9e4a4b1 100644\n--- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n+++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n@@ -62,6 +62,26 @@ int V4L2VideoDeviceTest::init()\n \tif (ret)\n \t\treturn TestFail;\n \n+\tif (driver_ == \"vimc\") {\n+\t\tV4L2SubdeviceFormat subformat = {};\n+\t\tsubformat.size.width = 640;\n+\t\tsubformat.size.height = 480;\n+\n+\t\tsensor_ = new CameraSensor(media_->getEntityByName(\"Sensor A\"));\n+\t\tif (sensor_->init())\n+\t\t\treturn TestFail;\n+\n+\t\tdebayer_ = new V4L2Subdevice(media_->getEntityByName(\"Debayer A\"));\n+\t\tif (debayer_->open())\n+\t\t\treturn TestFail;\n+\n+\t\tif (debayer_->setFormat(0, &subformat))\n+\t\t\treturn TestFail;\n+\n+\t\tif (sensor_->setFormat(&subformat))\n+\t\t\treturn TestFail;\n+\t}\n+\n \tif (capture_->open())\n \t\treturn TestFail;\n \n@@ -83,5 +103,7 @@ void V4L2VideoDeviceTest::cleanup()\n \tcapture_->releaseBuffers();\n \tcapture_->close();\n \n+\tdelete debayer_;\n+\tdelete sensor_;\n \tdelete capture_;\n };\ndiff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h\nindex 3321b5a4f98fdb1d..34dd231c6d9d108d 100644\n--- a/test/v4l2_videodevice/v4l2_videodevice_test.h\n+++ b/test/v4l2_videodevice/v4l2_videodevice_test.h\n@@ -13,8 +13,10 @@\n \n #include \"test.h\"\n \n+#include \"camera_sensor.h\"\n #include \"device_enumerator.h\"\n #include \"media_device.h\"\n+#include \"v4l2_subdevice.h\"\n #include \"v4l2_videodevice.h\"\n \n using namespace libcamera;\n@@ -23,7 +25,8 @@ class V4L2VideoDeviceTest : public Test\n {\n public:\n \tV4L2VideoDeviceTest(const char *driver, const char *entity)\n-\t\t: driver_(driver), entity_(entity), capture_(nullptr)\n+\t\t: driver_(driver), entity_(entity), sensor_(nullptr),\n+\t\t  debayer_(nullptr), capture_(nullptr)\n \t{\n \t}\n \n@@ -35,6 +38,8 @@ protected:\n \tstd::string entity_;\n \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n \tstd::shared_ptr<MediaDevice> media_;\n+\tCameraSensor *sensor_;\n+\tV4L2Subdevice *debayer_;\n \tV4L2VideoDevice *capture_;\n \tBufferPool pool_;\n };\n",
    "prefixes": [
        "libcamera-devel",
        "3/4"
    ]
}