From patchwork Wed Oct 7 07:54:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 9987 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0BEFBBEEE0 for ; Wed, 7 Oct 2020 07:55:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9459663BE4; Wed, 7 Oct 2020 09:55:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xv9dPwxe"; dkim-atps=neutral Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9296463B27 for ; Wed, 7 Oct 2020 09:55:21 +0200 (CEST) Received: by mail-lj1-x244.google.com with SMTP id a15so1027453ljk.2 for ; Wed, 07 Oct 2020 00:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IxMU2snczU8fMNu2/y2pDX4Kt0A8jJl4bZcrTWU4+9Y=; b=xv9dPwxeFXWoNzoiSdTL0sAVTP90roJW8B0hrzNWDtuB4j/Sgl160rbYW7s8Ii+gPR YrVdUUfmv2XYnKTs1SuU00QcXIU9ISm1j09sAtWWhi71rndMRAmWOsAfyCxokHVU2QMH dI0RNuju4mW1Ibz4SMZAFuyIj0Rgpv+e/ydgNg9d2iCZvLjYuZEuWPlqyHSPJFnhDHy+ VNIuFDgZpdDCsW/4m+Z3r5CxxMDdZ8hYTAeyAO8PVXanm6/9g5dACuqFkdOjYxHXnG9q sUip9DvxGIF+7+OcOj1KV2epaGjghmykEmReskFBh+UtlS6a0ghF1et8SCojfjcA1/4q oGzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IxMU2snczU8fMNu2/y2pDX4Kt0A8jJl4bZcrTWU4+9Y=; b=MvNo8YA1iwKDCAARDi23ice1IoqOyJ96Go8quvHkkcn+12DZnRjtQ8OH9LEz4m5kBm NHEQO40m69jBttKoV/1NH1Llx3sFrjcJC8Ns6WHLuCk7KRB/rWog7/NNjPfWefmG4j79 vl000tPjIjYUNnYdIC8RIXpmCXM2nzNIAMV20R6jukxU7aWG+XncNwnbI5HTcBFtMMgK YjRAX2JWl17LWL1TOfe6DrYLw928ebD1mqSlSouSiJw9Jb8GVfXN5GGat50Nds97Kd0W rF6AsZOunyLH8Gcv2ZAUpzENQmV25uA+yyW+V3HG443xnUBtz+GOlvu4/WfbLvY6DFxl OjTg== X-Gm-Message-State: AOAM531UUL1wj04YprRWDVNR1kIIB8gyqEuPZkhmR84KEMf5+OymZvBC rwbAsr1ZcbS1gVF5jq18bQj3U3LHcXg4Fw== X-Google-Smtp-Source: ABdhPJz4D7LrWMBxRrLRk70h6lEvnyH8rtsJCo7LrKUu+vFVZtKrf/kPU4Xr8BaGBxL6++4pC5EAXA== X-Received: by 2002:a2e:6f0d:: with SMTP id k13mr687084ljc.250.1602057320460; Wed, 07 Oct 2020 00:55:20 -0700 (PDT) Received: from localhost.localdomain (37-144-159-139.broadband.corbina.ru. [37.144.159.139]) by smtp.googlemail.com with ESMTPSA id v143sm213885lfa.248.2020.10.07.00.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 00:55:19 -0700 (PDT) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 10:54:57 +0300 Message-Id: <20201007075457.4455-1-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH] libcamera: pipeline: simple: enable mplane devices using contiguous memory X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The current simple pipeline handler refuses to work with capture devices which have V4L2_CAP_VIDEO_CAPTURE_MPLANE flag set in the device capabilities field. This is too restrictive, as devices supporting the multi-planar API can be using contiguous memory for semi-planar and planar formats, and this would just work without any changes to libcamera. Drop the guard against MPLANE devices, and replace it with the check of the number of planes in the format the simple pipeline handler is going to use for capture. This will let MPLANE devices which don't use non-contiguous memory for frame buffers to work with the simple pipeline handler. Signed-off-by: Andrey Konovalov Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 10223a9b..8dc23623 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -592,6 +592,12 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) if (ret) return ret; + if (captureFormat.planesCount != 1) { + LOG(SimplePipeline, Error) + << "Planar formats using non-contiguous memory not supported"; + return -EINVAL; + } + if (captureFormat.fourcc != videoFormat || captureFormat.size != pipeConfig.captureSize) { LOG(SimplePipeline, Error) @@ -845,12 +851,6 @@ V4L2VideoDevice *SimplePipelineHandler::video(const MediaEntity *entity) if (video->open() < 0) return nullptr; - if (video->caps().isMultiplanar()) { - LOG(SimplePipeline, Error) - << "V4L2 multiplanar devices are not supported"; - return nullptr; - } - video->bufferReady.connect(this, &SimplePipelineHandler::bufferReady); auto element = videos_.emplace(entity, std::move(video));