Show a patch.

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

{
    "id": 24742,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24742/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24742/",
    "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": "<20251023144841.403689-15-stefan.klug@ideasonboard.com>",
    "date": "2025-10-23T14:48:15",
    "name": "[v2,14/35] libcamera: rkisp1: Move useDewarper_ flag into RkISP1CameraData",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "17eac80d72eb489aafb90945ba0eca6a4246d820",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24742/mbox/",
    "series": [],
    "comments": "https://patchwork.libcamera.org/api/patches/24742/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24742/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 265DEC32DB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Oct 2025 14:49:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD76460811;\n\tThu, 23 Oct 2025 16:49:29 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D693960805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Oct 2025 16:49:27 +0200 (CEST)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:7328:357b:4ce1:72b6])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E15F1177F; \n\tThu, 23 Oct 2025 16:47:42 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Y9ZZdY27\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761230863;\n\tbh=HVD73afMb0bw6wU4gD7q2miON5ah/pqLM5Z7zL2MDUk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Y9ZZdY27+ZR6uQv1R2zXKZmia+/ABJiuhq4jp1mB77Tjri0QbbBrE0ReTwoPxEwq/\n\tybUTNiSPtpPh5yL9XDhyqp8FG6dlU6vLTmkafgKM/6azv0h4HxLvTPWZAovD09zswh\n\tUjFhKxOi9IUdGwz95ZpOhVRukSBGW89JXwHLLuEE=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v2 14/35] libcamera: rkisp1: Move useDewarper_ flag into\n\tRkISP1CameraData",
        "Date": "Thu, 23 Oct 2025 16:48:15 +0200",
        "Message-ID": "<20251023144841.403689-15-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.48.1",
        "In-Reply-To": "<20251023144841.403689-1-stefan.klug@ideasonboard.com>",
        "References": "<20251023144841.403689-1-stefan.klug@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 decision if the dewarper shall be used is not per pipeline but per\ncamera and per configuration (raw streams can't use it). Move the\ncorresponding flag into the camera data class. Rename the flag to\n\"usesDewarper\" which is easier understand when we later add the ability\nto enable/disable the dewarper on a per camera basis which will be\nexpressed using a \"canUseDewarper\" flag.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 28 ++++++++++++------------\n 1 file changed, 14 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 05409bc46ee3..241c83f4125b 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -123,6 +123,8 @@ public:\n \t */\n \tMediaPipeline pipe_;\n \n+\tbool usesDewarper_;\n+\n private:\n \tvoid paramsComputed(unsigned int frame, unsigned int bytesused);\n \tvoid setSensorControls(unsigned int frame,\n@@ -234,7 +236,6 @@ private:\n \n \tstd::unique_ptr<V4L2M2MConverter> dewarper_;\n \tRectangle scalerMaxCrop_;\n-\tbool useDewarper_;\n \n \tstd::optional<Rectangle> activeCrop_;\n \n@@ -285,7 +286,7 @@ RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *req\n \t\tstatBuffer = pipe_->availableStatBuffers_.front();\n \t\tpipe_->availableStatBuffers_.pop();\n \n-\t\tif (pipe_->useDewarper_) {\n+\t\tif (data->usesDewarper_) {\n \t\t\tmainPathBuffer = pipe_->availableMainPathBuffers_.front();\n \t\t\tpipe_->availableMainPathBuffers_.pop();\n \t\t}\n@@ -715,8 +716,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n  */\n \n PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager)\n-\t: PipelineHandler(manager, kRkISP1MaxQueuedRequests),\n-\t  hasSelfPath_(true), useDewarper_(false)\n+\t: PipelineHandler(manager, kRkISP1MaxQueuedRequests), hasSelfPath_(true)\n {\n }\n \n@@ -879,7 +879,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tconst PixelFormat &streamFormat = config->at(0).pixelFormat;\n \tconst PixelFormatInfo &info = PixelFormatInfo::info(streamFormat);\n \tisRaw_ = info.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n-\tuseDewarper_ = dewarper_ && !isRaw_;\n+\tdata->usesDewarper_ = dewarper_ && !isRaw_;\n \n \t/* YUYV8_2X8 is required on the ISP source path pad for YUV output. */\n \tif (!isRaw_)\n@@ -893,7 +893,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t\t/* imx8mp has only a single path. */\n \t\tconst auto &cfg = config->at(0);\n \t\tSize ispCrop = format.size.boundedToAspectRatio(cfg.size);\n-\t\tif (useDewarper_)\n+\t\tif (data->usesDewarper_)\n \t\t\tispCrop = dewarper_->adjustInputSize(cfg.pixelFormat,\n \t\t\t\t\t\t\t     ispCrop);\n \t\telse\n@@ -934,7 +934,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t\t\tstreamConfig[0] = IPAStream(cfg.pixelFormat,\n \t\t\t\t\t\t    cfg.size);\n \t\t\t/* Configure dewarp */\n-\t\t\tif (dewarper_ && !isRaw_) {\n+\t\t\tif (data->usesDewarper_) {\n \t\t\t\toutputCfgs.push_back(const_cast<StreamConfiguration &>(cfg));\n \t\t\t\tret = dewarper_->configure(cfg, outputCfgs);\n \t\t\t\tif (ret)\n@@ -999,7 +999,7 @@ int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, S\n \t\t * It has mainpath and no self path. Hence, export buffers from\n \t\t * dewarper just for the main path stream, for now.\n \t\t */\n-\t\tif (useDewarper_)\n+\t\tif (data->usesDewarper_)\n \t\t\treturn dewarper_->exportBuffers(&data->mainPathStream_, count, buffers);\n \t\telse\n \t\t\treturn mainPath_.exportBuffers(count, buffers);\n@@ -1033,7 +1033,7 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)\n \t}\n \n \t/* If the dewarper is being used, allocate internal buffers for ISP. */\n-\tif (useDewarper_) {\n+\tif (data->usesDewarper_) {\n \t\tret = mainPath_.exportBuffers(kRkISP1MinBufferCount, &mainPathBuffers_);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n@@ -1153,7 +1153,7 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n \t\t}\n \t\tactions += [&]() { stat_->streamOff(); };\n \n-\t\tif (useDewarper_) {\n+\t\tif (data->usesDewarper_) {\n \t\t\tret = dewarper_->start();\n \t\t\tif (ret) {\n \t\t\t\tLOG(RkISP1, Error) << \"Failed to start dewarper\";\n@@ -1208,7 +1208,7 @@ void PipelineHandlerRkISP1::stopDevice(Camera *camera)\n \t\t\tLOG(RkISP1, Warning)\n \t\t\t\t<< \"Failed to stop parameters for \" << camera->id();\n \n-\t\tif (useDewarper_)\n+\t\tif (data->usesDewarper_)\n \t\t\tdewarper_->stop();\n \t}\n \n@@ -1304,7 +1304,7 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n {\n \tControlInfoMap::Map controls;\n \n-\tif (dewarper_) {\n+\tif (data->usesDewarper_) {\n \t\tstd::pair<Rectangle, Rectangle> cropLimits;\n \t\tif (dewarper_->isConfigured(&data->mainPathStream_))\n \t\t\tcropLimits = dewarper_->inputCropBounds(&data->mainPathStream_);\n@@ -1474,7 +1474,7 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \t\t\t\tthis, &PipelineHandlerRkISP1::dewarpBufferReady);\n \n \t\t\tLOG(RkISP1, Info)\n-\t\t\t\t<< \"Using DW100 dewarper \" << dewarper_->deviceNode();\n+\t\t\t\t<< \"Found DW100 dewarper \" << dewarper_->deviceNode();\n \t\t} else {\n \t\t\tLOG(RkISP1, Warning)\n \t\t\t\t<< \"Found DW100 dewarper \" << dewarper_->deviceNode()\n@@ -1579,7 +1579,7 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \t\t\tinfo->metadataProcessed = true;\n \t}\n \n-\tif (!useDewarper_) {\n+\tif (!data->usesDewarper_) {\n \t\tcompleteBuffer(request, buffer);\n \t\ttryCompleteRequest(info);\n \n",
    "prefixes": [
        "v2",
        "14/35"
    ]
}