Show a patch.

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

{
    "id": 10486,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10486/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10486/",
    "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": "<20201123221234.485933-7-niklas.soderlund@ragnatech.se>",
    "date": "2020-11-23T22:12:32",
    "name": "[libcamera-devel,v3,6/8] libcamera: pipeline: rkisp1: Use CameraSensor and delayed controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4fd8f9ffcdf5d71feb9b71acc571a16c3f6dad7b",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": {
        "id": 16,
        "url": "https://patchwork.libcamera.org/api/1.1/users/16/?format=api",
        "username": "neg",
        "first_name": "Niklas",
        "last_name": "Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10486/mbox/",
    "series": [
        {
            "id": 1478,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1478/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1478",
            "date": "2020-11-23T22:12:26",
            "name": "libcamera: Add helper for controls that take effect with a delay",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1478/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10486/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10486/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 4D3A4BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Nov 2020 22:12:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F6FD6340B;\n\tMon, 23 Nov 2020 23:12:55 +0100 (CET)",
            "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 4D98D633F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Nov 2020 23:12:51 +0100 (CET)",
            "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 284e5541-2dd8-11eb-a076-005056917f90;\n\tMon, 23 Nov 2020 23:06:37 +0100 (CET)"
        ],
        "X-Halon-ID": "284e5541-2dd8-11eb-a076-005056917f90",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org,\n\tnaush@raspberrypi.com",
        "Date": "Mon, 23 Nov 2020 23:12:32 +0100",
        "Message-Id": "<20201123221234.485933-7-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20201123221234.485933-1-niklas.soderlund@ragnatech.se>",
        "References": "<20201123221234.485933-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 6/8] libcamera: pipeline: rkisp1: Use\n\tCameraSensor and delayed controls",
        "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>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Instead of setting controls using the RkISP1 local Timeline helper use\nthe DelayedControls interface provided by the CameraSensor. The result\nare the same, the controls are applied with a delay.\n\nThe values of the delays are however different between the two methods.\nThe values used in the Timeline solution was chosen after some\nexperimentation and the values used in DelayedControls are taken from a\ngeneric sensor. None of the two are a perfect match as the delays can be\ndifferent for different sensors used with the pipeline.\n\nHowever using the interface provided by CameraSensor we prepare for the\nfuture where sensor specific delays will provided by the CameraSensor\nand used without any change in the pipeline.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 35 +++++++++---------------\n 1 file changed, 13 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 6e74a49abfda1b55..c3c4b5a65e3d9afe 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -121,8 +121,9 @@ class RkISP1CameraData : public CameraData\n public:\n \tRkISP1CameraData(PipelineHandler *pipe, RkISP1MainPath *mainPath,\n \t\t\t RkISP1SelfPath *selfPath)\n-\t\t: CameraData(pipe), sensor_(nullptr), frame_(0),\n-\t\t  frameInfo_(pipe), mainPath_(mainPath), selfPath_(selfPath)\n+\t\t: CameraData(pipe), sensor_(nullptr), delayedCtrls_(nullptr),\n+\t\t  frame_(0), frameInfo_(pipe), mainPath_(mainPath),\n+\t\t  selfPath_(selfPath)\n \t{\n \t}\n \n@@ -136,6 +137,7 @@ public:\n \tStream mainPathStream_;\n \tStream selfPathStream_;\n \tCameraSensor *sensor_;\n+\tDelayedControls *delayedCtrls_;\n \tunsigned int frame_;\n \tstd::vector<IPABuffer> ipaBuffers_;\n \tRkISP1Frames frameInfo_;\n@@ -346,23 +348,6 @@ RkISP1FrameInfo *RkISP1Frames::find(Request *request)\n \treturn nullptr;\n }\n \n-class RkISP1ActionSetSensor : public FrameAction\n-{\n-public:\n-\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, const ControlList &controls)\n-\t\t: FrameAction(frame, SetSensor), sensor_(sensor), controls_(controls) {}\n-\n-protected:\n-\tvoid run() override\n-\t{\n-\t\tsensor_->setControls(&controls_);\n-\t}\n-\n-private:\n-\tCameraSensor *sensor_;\n-\tControlList controls_;\n-};\n-\n class RkISP1ActionQueueBuffers : public FrameAction\n {\n public:\n@@ -430,9 +415,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n \tswitch (action.operation) {\n \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n \t\tconst ControlList &controls = action.controls[0];\n-\t\ttimeline_.scheduleAction(std::make_unique<RkISP1ActionSetSensor>(frame,\n-\t\t\t\t\t\t\t\t\t\t sensor_,\n-\t\t\t\t\t\t\t\t\t\t controls));\n+\t\tdelayedCtrls_->push(controls);\n \t\tbreak;\n \t}\n \tcase RKISP1_IPA_ACTION_PARAM_FILLED: {\n@@ -906,6 +889,8 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \t\t};\n \t}\n \n+\tisp_->setFrameStartEnabled(true);\n+\n \tactiveCamera_ = camera;\n \n \t/* Inform IPA of stream configuration and sensor controls. */\n@@ -933,6 +918,8 @@ void PipelineHandlerRkISP1::stop(Camera *camera)\n \tRkISP1CameraData *data = cameraData(camera);\n \tint ret;\n \n+\tisp_->setFrameStartEnabled(false);\n+\n \tselfPath_.stop();\n \tmainPath_.stop();\n \n@@ -1051,6 +1038,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \t/* Initialize the camera properties. */\n \tdata->properties_ = data->sensor_->properties();\n \n+\tdata->delayedCtrls_ = data->sensor_->delayedContols();\n+\tisp_->frameStart.connect(data->delayedCtrls_,\n+\t\t\t\t &DelayedControls::frameStart);\n+\n \tret = data->loadIPA();\n \tif (ret)\n \t\treturn ret;\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "6/8"
    ]
}