{"id":10026,"url":"https://patchwork.libcamera.org/api/patches/10026/?format=json","web_url":"https://patchwork.libcamera.org/patch/10026/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201009111739.10824-1-andrey.konovalov@linaro.org>","date":"2020-10-09T11:17:39","name":"[libcamera-devel,v2] libcamera: pipeline: simple: enable mplane devices using contiguous memory","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"53e2da59b2bda85d8de5db04ee9ca12e3be2bf52","submitter":{"id":25,"url":"https://patchwork.libcamera.org/api/people/25/?format=json","name":"Andrey Konovalov","email":"andrey.konovalov@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10026/mbox/","series":[{"id":1369,"url":"https://patchwork.libcamera.org/api/series/1369/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1369","date":"2020-10-09T11:17:39","name":"[libcamera-devel,v2] libcamera: pipeline: simple: enable mplane devices using contiguous memory","version":2,"mbox":"https://patchwork.libcamera.org/series/1369/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10026/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10026/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 D2638BEEE0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Oct 2020 11:18:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55E8E60359;\n\tFri,  9 Oct 2020 13:18:10 +0200 (CEST)","from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D65E660358\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Oct 2020 13:18:08 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id a5so9206817ljj.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Oct 2020 04:18:08 -0700 (PDT)","from localhost.localdomain (37-144-159-139.broadband.corbina.ru.\n\t[37.144.159.139]) by smtp.googlemail.com with ESMTPSA id\n\tu14sm118581lfg.156.2020.10.09.04.18.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Oct 2020 04:18:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"VczE4X9d\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id;\n\tbh=GSgVdC2R6mUKQ9GnhXcv2ymGxgkiKb3RgBds3bj68to=;\n\tb=VczE4X9dPoIAHkkWtWjKFH3Qk148RNTbGZ3k0odo+ae9HFsUDrdF6UflI72NpjlMlt\n\tK60UKvNxDgdgGIQHWMt6VqBX/IFvGZCFNy9z0g80fXHT62cyEr610zvgkcjdjT9Nnpop\n\tRMeK26NBaeavett9eKRD+Lyp8bUlUvNF+oP9yAYw2uOmPM10UAq4LPCvLuBDGZJ0Xx0Y\n\tRP+z5qpi5DzChr24kD0RHmKmcLs6gJhi89pr9WtfrWX31yF8RtmnXkzTCfmXALABlQFN\n\tC4h2Wxs+faOfFvx/KnF0s/l73tXXKIDVLS7Pz6Q/s85gZsoxo2lghDU7pENRbfxC4D6O\n\t5vDQ==","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;\n\tbh=GSgVdC2R6mUKQ9GnhXcv2ymGxgkiKb3RgBds3bj68to=;\n\tb=GB6QG3ytRz11ALBdg9seU5EZdqYN7dnpvZDjw8a6Qa6Kg/XV4Vnn63ruN/aVbfx8uC\n\tk7mHu82cf8qc5gqfXBnneqIi2eD8nefQzNEbyuDPRmo6rWaoQVnrFClIDN4QxN4RSmzV\n\t6BBXwfPVnbmvOGe3Bfn9YwdZTbo/YIW4xsDwv3JB6PNwvNSz8qPPDjs4lcDjiCGLejiT\n\t3nwl1xXBozYKYRnCbPVwO3aI9uJwo0lEIsRXQhQCMc6eE5jCEaPmZlJuoeTMxoTna+Vv\n\tGF2vsI0/k/wYUHKkYjbbIzGx6mOlMrk6kxwkFXUKbU5yASW7yFczZUGijwYWCj1fYMKX\n\ttkLQ==","X-Gm-Message-State":"AOAM533hSAqWQztFgoH1jpvYDEFQMuTIercpk16ri4z1grFlmtPHSsBn\n\tWpFdNL6JEIukrlqH+f49FAacyNRLAAIhdg==","X-Google-Smtp-Source":"ABdhPJwj9sSBwdY87rA9AM8k5j0ffMN03FVKOguerSvaxqJiuyFCey8/s2CvJAGBW3Xb7ZRfUZiMpg==","X-Received":"by 2002:a2e:958f:: with SMTP id\n\tw15mr5333210ljh.449.1602242287610; \n\tFri, 09 Oct 2020 04:18:07 -0700 (PDT)","From":"Andrey Konovalov <andrey.konovalov@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  9 Oct 2020 14:17:39 +0300","Message-Id":"<20201009111739.10824-1-andrey.konovalov@linaro.org>","X-Mailer":"git-send-email 2.17.1","Subject":"[libcamera-devel] [PATCH v2] libcamera: pipeline: simple: enable\n\tmplane devices using contiguous memory","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>","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":"The current simple pipeline handler refuses to work with capture devices\nwhich have V4L2_CAP_VIDEO_CAPTURE_MPLANE flag set in the device capabilities\nfield. This is too restrictive, as devices supporting the multi-planar API\ncan be using contiguous memory for semi-planar and planar formats, and this\nwould just work without any changes to libcamera.\n\nDrop the guard against MPLANE devices, and replace it with the check of\nthe number of planes in the format the simple pipeline handler is going to\nuse for capture. This will let MPLANE devices which don't use non-contiguous\nmemory for frame buffers to work with the simple pipeline handler.\n\nThe following code in SimpleCameraData::init() filters out the pixel formats\nlibcamera doesn't support:\n\n\tPixelFormat pixelFormat = videoFormat.first.toPixelFormat();\n\tif (!pixelFormat)\n\t\tcontinue;\n\nSo the check for the number of memory planes this patch adds would not\ntrigger until non-contiguous planar formats becomes supported in libcamera,\nand video devices using these formats are enabled in the simple pipeline\nhandler. Then this check will remind one to review the simple pipeline\nhandler code.\n\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n Changes in v2:\n - The commit message extended to explain how the simple pipeline handler\n   filters out pixel formats not supported in libcamera. No changes to\n   the code vs v1.\n\n src/libcamera/pipeline/simple/simple.cpp | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 10223a9b..8dc23623 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -592,6 +592,12 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tif (ret)\n \t\treturn ret;\n \n+\tif (captureFormat.planesCount != 1) {\n+\t\tLOG(SimplePipeline, Error)\n+\t\t\t<<  \"Planar formats using non-contiguous memory not supported\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (captureFormat.fourcc != videoFormat ||\n \t    captureFormat.size != pipeConfig.captureSize) {\n \t\tLOG(SimplePipeline, Error)\n@@ -845,12 +851,6 @@ V4L2VideoDevice *SimplePipelineHandler::video(const MediaEntity *entity)\n \tif (video->open() < 0)\n \t\treturn nullptr;\n \n-\tif (video->caps().isMultiplanar()) {\n-\t\tLOG(SimplePipeline, Error)\n-\t\t\t<< \"V4L2 multiplanar devices are not supported\";\n-\t\treturn nullptr;\n-\t}\n-\n \tvideo->bufferReady.connect(this, &SimplePipelineHandler::bufferReady);\n \n \tauto element = videos_.emplace(entity, std::move(video));\n","prefixes":["libcamera-devel","v2"]}