Show a patch.

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

{
    "id": 804,
    "url": "https://patchwork.libcamera.org/api/patches/804/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/804/",
    "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": "<20190326083902.26121-10-jacopo@jmondi.org>",
    "date": "2019-03-26T08:38:52",
    "name": "[libcamera-devel,v5,09/19] libcamera: ipu3: Set stream configuration from sensor",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "37b1d31fc2033b391e265942b3ffec728b5ecc38",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/804/mbox/",
    "series": [
        {
            "id": 219,
            "url": "https://patchwork.libcamera.org/api/series/219/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=219",
            "date": "2019-03-26T08:38:43",
            "name": "libcamera: ipu3: Add ImgU support",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/219/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/804/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/804/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E5F96110D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2019 09:38:36 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 9939E240005;\n\tTue, 26 Mar 2019 08:38:35 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 26 Mar 2019 09:38:52 +0100",
        "Message-Id": "<20190326083902.26121-10-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190326083902.26121-1-jacopo@jmondi.org>",
        "References": "<20190326083902.26121-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 09/19] libcamera: ipu3: Set stream\n\tconfiguration from sensor",
        "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": "Tue, 26 Mar 2019 08:38:36 -0000"
    },
    "content": "Inspect all image sizes provided by the sensor and select the\nbiggest of them, associated with an image format code supported by the\nCIO2 unit.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 35 +++++++++++++---------------\n 1 file changed, 16 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex d42c81273cc6..04cd02653711 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -5,6 +5,7 @@\n  * ipu3.cpp - Pipeline handler for Intel IPU3\n  */\n \n+#include <iomanip>\n #include <memory>\n #include <vector>\n \n@@ -94,6 +95,8 @@ private:\n \t\tstd::pair<unsigned int, SizeRange> maxSizes_;\n \t};\n \n+\tstatic constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n+\n \tIPU3CameraData *cameraData(const Camera *camera)\n \t{\n \t\treturn static_cast<IPU3CameraData *>(\n@@ -124,26 +127,20 @@ std::map<Stream *, StreamConfiguration>\n PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n \t\t\t\t\t std::set<Stream *> &streams)\n {\n-\tIPU3CameraData *data = cameraData(camera);\n \tstd::map<Stream *, StreamConfiguration> configs;\n-\tV4L2SubdeviceFormat format = {};\n-\n-\t/*\n-\t * FIXME: As of now, return the image format reported by the sensor.\n-\t * In future good defaults should be provided for each stream.\n-\t */\n-\tif (data->sensor_->getFormat(0, &format)) {\n-\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n-\t\treturn configs;\n-\t}\n-\n-\tStreamConfiguration config = {};\n-\tconfig.width = format.width;\n-\tconfig.height = format.height;\n-\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n-\tconfig.bufferCount = 4;\n-\n-\tconfigs[&data->stream_] = config;\n+\tIPU3CameraData *data = cameraData(camera);\n+\tStreamConfiguration *config = &configs[&data->stream_];\n+\tSizeRange &maxRange = data->maxSizes_.second;\n+\n+\tconfig->width = maxRange.maxWidth;\n+\tconfig->height = maxRange.maxHeight;\n+\tconfig->pixelFormat = data->maxSizes_.first;\n+\tconfig->bufferCount = IPU3_BUFFER_COUNT;\n+\n+\tLOG(IPU3, Debug)\n+\t\t<< \"Stream format set to: \" << config->width << \"x\"\n+\t\t<< config->height << \"-0x\" << std::hex << std::setfill('0')\n+\t\t<< std::setw(4) << config->pixelFormat;\n \n \treturn configs;\n }\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "09/19"
    ]
}