Patch Detail
Show a patch.
GET /api/patches/8922/?format=api
{ "id": 8922, "url": "https://patchwork.libcamera.org/api/patches/8922/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8922/", "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": "<20200722133009.26528-6-kgupta@es.iitr.ac.in>", "date": "2020-07-22T13:30:07", "name": "[libcamera-devel,5/7] libcamera: pipeline: vimc: Take care of buffers", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e2a25293fca489b6ec8ea3e395784cf370a5f96f", "submitter": { "id": 39, "url": "https://patchwork.libcamera.org/api/people/39/?format=api", "name": "Kaaira Gupta", "email": "kgupta@es.iitr.ac.in" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/8922/mbox/", "series": [ { "id": 1127, "url": "https://patchwork.libcamera.org/api/series/1127/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1127", "date": "2020-07-22T13:30:02", "name": "vimc: Introduce multiple streaming", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1127/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8922/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8922/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 6DB54BDB1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Jul 2020 13:30:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B04E6099C;\n\tWed, 22 Jul 2020 15:30:37 +0200 (CEST)", "from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D6436053C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jul 2020 15:30:36 +0200 (CEST)", "by mail-pf1-x42f.google.com with SMTP id a14so1298884pfi.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jul 2020 06:30:36 -0700 (PDT)", "from kaaira-HP-Pavilion-Notebook ([103.113.213.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tcv3sm6529541pjb.45.2020.07.22.06.30.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Jul 2020 06:30:34 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=es-iitr-ac-in.20150623.gappssmtp.com\n\theader.i=@es-iitr-ac-in.20150623.gappssmtp.com\n\theader.b=\"B8TAcVme\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=poWeSreCTal/V0s2LiZRT7HUmka+2mMTBFWoj7kaSlo=;\n\tb=B8TAcVmeDfrEsTSbCN+045mcI65NDZVdUDPUEts8Ca2jUaUrVfOPxu8ELkIAWt2mUA\n\tyYW095xlgjc6ZKk2CKIRljtXGBUPK0W6RR8UIjp4VmnjbpveeDQQ55TfXeoMp90ougdg\n\t2VeaYCwMozsifS5ShAUdxfoPx65tpw4gwFkJoRLx9+NZT3Jvb+J8oHdNyKiWi0jfkG3o\n\tvOovK/QpnMRa1LWY//Sr9LoeBaTgbXzxlOQNedXou4Q5hUUtr+h/uufYy+2gnYExrTsZ\n\tpqlWet5HEameVNmsDY5pSOz3RVWwc9z598rEVhQtwP7NRQaHY25anXOk0n79vmLJkMok\n\t+Jzg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=poWeSreCTal/V0s2LiZRT7HUmka+2mMTBFWoj7kaSlo=;\n\tb=XNmkpv12cb9+cz5oOXnQ4sVcgRorDCLceEz8rK1piSF1giY/p/J9kjOVKz1zYeqiqa\n\tFxJTWDU017cUxwg995rW1DZE3h0AjKxCftwYsx9WFrNq5jDpQP8/nfnI3pT+/cvT6lcM\n\ta0Oxe9cKilh2rdedELcp5dHPStBlfBuzMv3y6nvZ6rRWvKZ23+npnUWh9Fk/wuKM5sh3\n\tM2tJwtF1DgGqsAxrdaU8bT4ON0D9jwZecx1LujNav3mu5eaC5NJjaBsWAz0P5of5bQxl\n\t+8LWzrRHvtjtacaXojmbOn1QkoXdq008r/+flXw2D5QKwh2lfFZ9MGiS6SEORudvTDgK\n\tvYoQ==", "X-Gm-Message-State": "AOAM531PpFdzXDPKQnWwpIdrZw9dhPYEpAKgJrOSRxvOtdIsT1pfi+dJ\n\tXtREixhUB81Vw0U8cKwgoeieoA==", "X-Google-Smtp-Source": "ABdhPJzQ/OZ1ABZv/UANRJUMSdjl8fWUtRugh/g1FfRCgMTzpWr2lhV444VF0io4lH8Q4d32F60+Vg==", "X-Received": "by 2002:a62:7e51:: with SMTP id z78mr29027453pfc.3.1595424634901;\n\tWed, 22 Jul 2020 06:30:34 -0700 (PDT)", "From": "Kaaira Gupta <kgupta@es.iitr.ac.in>", "To": "libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>", "Date": "Wed, 22 Jul 2020 19:00:07 +0530", "Message-Id": "<20200722133009.26528-6-kgupta@es.iitr.ac.in>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200722133009.26528-1-kgupta@es.iitr.ac.in>", "References": "<20200722133009.26528-1-kgupta@es.iitr.ac.in>", "Subject": "[libcamera-devel] [PATCH 5/7] libcamera: pipeline: vimc: Take care\n\tof buffers", "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>", "Cc": "Kaaira Gupta <kgupta@es.iitr.ac.in>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Introduce a bufferReady function for RAW streams. Take care of exporting\nthe correct buffers according to the stream required. Also start and\nstop the correct buffers accordingly.\n\nSigned-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n---\n src/libcamera/pipeline/vimc/vimc.cpp | 52 ++++++++++++++++++++++++----\n 1 file changed, 45 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex c2ed5b6..6010e1e 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -59,6 +59,7 @@ public:\n \n \tint init();\n \tvoid bufferReady(FrameBuffer *buffer);\n+\tvoid bufferReadyRaw(FrameBuffer *buffer);\n \n \tMediaDevice *media_;\n \tCameraSensor *sensor_;\n@@ -433,29 +434,50 @@ int PipelineHandlerVimc::exportFrameBuffers(Camera *camera, Stream *stream,\n \tVimcCameraData *data = cameraData(camera);\n \tunsigned int count = stream->configuration().bufferCount;\n \n-\treturn data->video_->exportBuffers(count, buffers);\n+\tif (stream == &data->rawStream_)\n+\t\treturn data->raw_->exportBuffers(count, buffers);\n+\telse if (stream == &data->rgbStream_)\n+\t\treturn data->video_->exportBuffers(count, buffers);\n+\telse\n+\t\treturn -EINVAL;\n }\n \n int PipelineHandlerVimc::start(Camera *camera)\n {\n \tVimcCameraData *data = cameraData(camera);\n \tunsigned int count = data->rgbStream_.configuration().bufferCount;\n+\tunsigned int rCount = data->rawStream_.configuration().bufferCount;\n \n \tint ret = data->video_->importBuffers(count);\n \tif (ret < 0)\n \t\treturn ret;\n \n+\tret = data->raw_->importBuffers(rCount);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n \tret = data->ipa_->start();\n \tif (ret) {\n \t\tdata->video_->releaseBuffers();\n+\t\tdata->raw_->releaseBuffers();\n \t\treturn ret;\n \t}\n \n-\tret = data->video_->streamOn();\n-\tif (ret < 0) {\n-\t\tdata->ipa_->stop();\n-\t\tdata->video_->releaseBuffers();\n-\t\treturn ret;\n+\tif (count) {\n+\t\tret = data->video_->streamOn();\n+\t\tif (ret < 0) {\n+\t\t\tdata->ipa_->stop();\n+\t\t\tdata->video_->releaseBuffers();\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\tif (rCount) {\n+\t\tret = data->raw_->streamOn();\n+\t\tif (ret < 0) {\n+\t\t\tdata->ipa_->stop();\n+\t\t\tdata->raw_->releaseBuffers();\n+\t\t\treturn ret;\n+\t\t}\n \t}\n \n \treturn 0;\n@@ -464,8 +486,10 @@ int PipelineHandlerVimc::start(Camera *camera)\n void PipelineHandlerVimc::stop(Camera *camera)\n {\n \tVimcCameraData *data = cameraData(camera);\n+\tdata->raw_->streamOff();\n \tdata->video_->streamOff();\n \tdata->ipa_->stop();\n+\tdata->raw_->releaseBuffers();\n \tdata->video_->releaseBuffers();\n }\n \n@@ -653,7 +677,21 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)\n \tRequest *request = buffer->request();\n \n \tpipe_->completeBuffer(camera_, request, buffer);\n-\tpipe_->completeRequest(camera_, request);\n+\tif (!(request->hasPendingBuffers())) {\n+\t\tpipe_->completeRequest(camera_, request);\n+\t}\n+\treturn;\n+}\n+\n+void VimcCameraData::bufferReadyRaw(FrameBuffer *buffer)\n+{\n+\tRequest *request = buffer->request();\n+\n+\tpipe_->completeBuffer(camera_, request, buffer);\n+\tif (!(request->hasPendingBuffers())) {\n+\t\tpipe_->completeRequest(camera_, request);\n+\t}\n+\treturn;\n }\n \n REGISTER_PIPELINE_HANDLER(PipelineHandlerVimc);\n", "prefixes": [ "libcamera-devel", "5/7" ] }