Patch Detail
Show a patch.
GET /api/patches/8921/?format=api
{ "id": 8921, "url": "https://patchwork.libcamera.org/api/patches/8921/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8921/", "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-5-kgupta@es.iitr.ac.in>", "date": "2020-07-22T13:30:06", "name": "[libcamera-devel,4/7] libcamera: pipeline: vimc: Configure the entities of VIMC pipeline", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6c172fb2736a192aa90c47bd17b422eca5f72214", "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/8921/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/8921/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8921/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 D2951BDB1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Jul 2020 13:30:33 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C0FE60991;\n\tWed, 22 Jul 2020 15:30:33 +0200 (CEST)", "from mail-pf1-x442.google.com (mail-pf1-x442.google.com\n\t[IPv6:2607:f8b0:4864:20::442])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9257260540\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jul 2020 15:30:32 +0200 (CEST)", "by mail-pf1-x442.google.com with SMTP id a14so1298822pfi.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jul 2020 06:30:32 -0700 (PDT)", "from kaaira-HP-Pavilion-Notebook ([103.113.213.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tz2sm24295928pff.36.2020.07.22.06.30.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Jul 2020 06:30:30 -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=\"v5RGy43m\"; 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=K57dU5fR3o0ZZW/FaxLXeft1XT7kjvlbON2oY1sl2kk=;\n\tb=v5RGy43m4TNVUy1PHjWkwp42aOAXKjc9UwKTk81xhEey2XU0fOR3J/hSXZtkZpD64Z\n\tKJKqFpARMPY/g7paceCDnYYtL+IIJwgsknkqEFtndhM/6OudWToEqVO3c9BnlVDKf5JY\n\ttd71E9b6+j23rWN/DV2GywCA9gTzs5bby8LFqb10mQpqwsjztQS7Tw2UF6aEsvSDHh46\n\tlC1WxGTcVsyf8W6GxSHBli37hlsnEmTgnaOIfDQ2jZn65ErnzHb5vZNWYAhpXLwPbJpV\n\tOSuGY1tKrIOn/58T/Kl8DRhZZrnbeQ5+j39Na5gnmi/ImcqB5Go/UNlOjdqMrNUxWz9I\n\tNNGA==", "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=K57dU5fR3o0ZZW/FaxLXeft1XT7kjvlbON2oY1sl2kk=;\n\tb=Y+yDU0SmGuZ4EzI1rRc6Hi+RVT+0UcaxAFkW7d0S+EVbib/Kb68OlJLCqnEI60sUvt\n\tjLzrVcueYyzTHCEeLU0Vjhat1k3rPOyoTEHep970edtsTdkfUSODv5Zs2oj6VhYnEDGJ\n\t1iW50Zzge6mX2nKVkaz6FSDXiScJgha1bkQqLFWd0bo3rGYCY6Z1KHbokRlNhD7FPwOH\n\tbaG1EKPm/NN407KUjQ2aFk4vlShw2KTbK1yKSXwzKmtlKCGLc6cQdJv7n+FIRY26qRSL\n\tOIGdVyJwkhQzjhnn9fi7/RPlF28Fv+QCaXRWN5E76T8R2QqUosa/ln7+WgnzPou+NDtx\n\tUdXA==", "X-Gm-Message-State": "AOAM5313rMlfHLZQAJtbnUmzWWWRZeptViQ62L4Pjrq9iQXcL3Kr9Hoi\n\tqX08eE4tnHk6wY6b6q3E6LZDbURtBwA=", "X-Google-Smtp-Source": "ABdhPJwFc7TOj7Fz78taJsBoyNhO/ep1FTUFYdECs3pio5mV5r80pmq2PoKkPVe2bjiffh6jkuZC2w==", "X-Received": "by 2002:aa7:8f03:: with SMTP id x3mr27392325pfr.64.1595424631094;\n\tWed, 22 Jul 2020 06:30:31 -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:06 +0530", "Message-Id": "<20200722133009.26528-5-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 4/7] libcamera: pipeline: vimc: Configure\n\tthe entities of VIMC pipeline", "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": "Configure the pads according to the configuration asked for. In case\nonly one stream (RBG or RAW) is asked for, configurations still need to\nbe set on the other entities in the pipeline.\n\nSigned-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n---\n src/libcamera/pipeline/vimc/vimc.cpp | 175 ++++++++++++++++++---------\n 1 file changed, 121 insertions(+), 54 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 83dd541..c2ed5b6 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -295,68 +295,135 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n {\n \tVimcCameraData *data = cameraData(camera);\n-\tStreamConfiguration &cfg = config->at(0);\n-\tint ret;\n+\tfor (unsigned i = 0; i < config->size(); i++) {\n+\t\tStreamConfiguration &cfg = config->at(i);\n+\t\tconst PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);\n+\t\tint ret;\n+\t\tif (info.isRaw(cfg.pixelFormat)) {\n+\t\t\tV4L2SubdeviceFormat subformat = {};\n+\t\t\tsubformat.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8;\n+\t\t\tsubformat.size = cfg.size;\n+\t\t\tret = data->sensor_->setFormat(&subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tV4L2DeviceFormat format = {};\n+\t\t\tformat.fourcc = data->raw_->toV4L2PixelFormat(cfg.pixelFormat);\n+\t\t\tformat.size = cfg.size;\n+\t\t\tret = data->raw_->setFormat(&format);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\t/*\n+\t\t\t * Formats have to be set on debayer, scaler, and RGB/YUB Capture\n+\t\t\t * otherwise the VIMC driver will fail pipeline validation\n+\t\t\t */\n+\n+\t\t\tret = data->debayer_->setFormat(0, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tsubformat.mbus_code = MEDIA_BUS_FMT_RGB888_1X24;\n+\t\t\tret = data->debayer_->setFormat(1, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tret = data->scaler_->setFormat(0, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tif (data->media_->version() >= KERNEL_VERSION(5, 6, 0)) {\n+\t\t\t\tRectangle crop = {\n+\t\t\t\t\t.x = 0,\n+\t\t\t\t\t.y = 0,\n+\t\t\t\t\t.width = subformat.size.width,\n+\t\t\t\t\t.height = subformat.size.height,\n+\t\t\t\t};\n+\t\t\t\tret = data->scaler_->setSelection(0, V4L2_SEL_TGT_CROP, &crop);\n+\t\t\t\tif (ret)\n+\t\t\t\t\treturn ret;\n+\t\t\t}\n \n-\t/* The scaler hardcodes a x3 scale-up ratio. */\n-\tV4L2SubdeviceFormat subformat = {};\n-\tsubformat.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8;\n-\tsubformat.size = { cfg.size.width / 3, cfg.size.height / 3 };\n+\t\t\tsubformat.mbus_code = MEDIA_BUS_FMT_RGB888_1X24;\n+\t\t\tsubformat.size = { cfg.size.width * 3, cfg.size.height * 3 };\n+\t\t\tret = data->scaler_->setFormat(1, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n \n-\tret = data->sensor_->setFormat(&subformat);\n-\tif (ret)\n-\t\treturn ret;\n+\t\t\tformat.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_RGB24);\n+\t\t\tformat.size = { cfg.size.width * 3, cfg.size.height * 3 };\n+\t\t\tret = data->video_->setFormat(&format);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n \n-\tret = data->debayer_->setFormat(0, &subformat);\n-\tif (ret)\n-\t\treturn ret;\n+\t\t\tcfg.setStream(&data->rawStream_);\n \n-\tsubformat.mbus_code = pixelformats.find(cfg.pixelFormat)->second;\n-\tret = data->debayer_->setFormat(1, &subformat);\n-\tif (ret)\n-\t\treturn ret;\n+\t\t} else {\n+\t\t\t/* The scaler hardcodes a x3 scale-up ratio. */\n+\t\t\tV4L2SubdeviceFormat subformat = {};\n+\t\t\tsubformat.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8;\n+\t\t\tsubformat.size = { cfg.size.width / 3, cfg.size.height / 3 };\n+\n+\t\t\tret = data->sensor_->setFormat(&subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tret = data->debayer_->setFormat(0, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tsubformat.mbus_code = pixelformats.find(cfg.pixelFormat)->second;\n+\t\t\tret = data->debayer_->setFormat(1, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tret = data->scaler_->setFormat(0, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tif (data->media_->version() >= KERNEL_VERSION(5, 6, 0)) {\n+\t\t\t\tRectangle crop = {\n+\t\t\t\t\t.x = 0,\n+\t\t\t\t\t.y = 0,\n+\t\t\t\t\t.width = subformat.size.width,\n+\t\t\t\t\t.height = subformat.size.height,\n+\t\t\t\t};\n+\t\t\t\tret = data->scaler_->setSelection(0, V4L2_SEL_TGT_CROP, &crop);\n+\t\t\t\tif (ret)\n+\t\t\t\t\treturn ret;\n+\t\t\t}\n \n-\tret = data->scaler_->setFormat(0, &subformat);\n-\tif (ret)\n-\t\treturn ret;\n+\t\t\tsubformat.size = cfg.size;\n+\t\t\tret = data->scaler_->setFormat(1, &subformat);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n \n-\tif (data->media_->version() >= KERNEL_VERSION(5, 6, 0)) {\n-\t\tRectangle crop{ 0, 0, subformat.size };\n-\t\tret = data->scaler_->setSelection(0, V4L2_SEL_TGT_CROP, &crop);\n-\t\tif (ret)\n-\t\t\treturn ret;\n+\t\t\tV4L2DeviceFormat format = {};\n+\t\t\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n+\t\t\tformat.size = cfg.size;\n+\t\t\tret = data->video_->setFormat(&format);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tif (format.size != cfg.size ||\n+\t\t\t format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n+\t\t\t\treturn -EINVAL;\n+\n+\t\t\t/*\n+\t\t\t * Format has to be set on the raw capture video node, otherwise the\n+\t\t\t * vimc driver will fail pipeline validation.\n+\t\t\t */\n+\t\t\tformat.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8);\n+\t\t\tformat.size = { cfg.size.width / 3, cfg.size.height / 3 };\n+\n+\t\t\tret = data->raw_->setFormat(&format);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tcfg.setStream(&data->rgbStream_);\n+\t\t}\n \t}\n \n-\tsubformat.size = cfg.size;\n-\tret = data->scaler_->setFormat(1, &subformat);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tV4L2DeviceFormat format = {};\n-\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n-\tformat.size = cfg.size;\n-\n-\tret = data->video_->setFormat(&format);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tif (format.size != cfg.size ||\n-\t format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n-\t\treturn -EINVAL;\n-\n-\t/*\n-\t * Format has to be set on the raw capture video node, otherwise the\n-\t * vimc driver will fail pipeline validation.\n-\t */\n-\tformat.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8);\n-\tformat.size = { cfg.size.width / 3, cfg.size.height / 3 };\n-\n-\tret = data->raw_->setFormat(&format);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tcfg.setStream(&data->rgbStream_);\n-\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel", "4/7" ] }