From patchwork Fri Jun 30 13:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18775 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 ABC8DBE175 for ; Fri, 30 Jun 2023 13:45:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E4A3360454; Fri, 30 Jun 2023 15:45:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1688132724; bh=ARehAiE3B9J2m1IlHFxhCz5OuMiL39PRjk2vDsRNMFk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Srwpg9GzvGb/HGerk3XKT0ixGNHan1bksAc1s9H/0nR4ea7l2nC6djgJ7mheNkj5Q Je8/NQzbnAfyHeIO5MnFlAGF/x+MF8NSxmho95nUeiumnWxh+vogpOGzWYtQUb7VCr hhi0MRX1rqcagLLVzLWGIbC8k+LOeVbsiDMPX2pTOHlIU7cJ9sRC20jbyeccVtVEBp bK+i5araUCuBIxa0KFBpnqIvVCFpWzP8LtSF6eaUvZ4pSv2gk0Hr6fHF6DMrwukrkk XJe5PbcbOL2zKkNoSxFKsUfOOuAid3KODyjGHMM2RfCN4aybcbN5iOEcSY+cmMV+/v h79JIzgcl/cWw== Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E69960454 for ; Fri, 30 Jun 2023 15:45:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Br6rrpeu"; dkim-atps=neutral Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fb8ede27eeso3046162e87.0 for ; Fri, 30 Jun 2023 06:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1688132722; x=1690724722; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VITRkEgIEwGUfQXNLxylUtIJOPCbRcUYZW1La62GwYc=; b=Br6rrpeuoVaieyRpVZjRqiSVM7dk9kE5easrh/jfvHN0GyBs2vN5SEcmfKnLjU5WTU 0wpcFDQfW15miW8c8dCMPEXFsqc5cA2IVUX6aXYo6ekzgSWeU1D8K3UaN6GkJsdKzngF AR4LarAyKIby2DxZAGbrnbmbgoRh+S83k3qXIFdz5yQ8NQzV1bUN6s7UqFqYNPL5T0QG IfMe8p4rTIl8pLLPf6V3fBX1+pK3DpAyhS4k31Ql1I4pEyX/sr1MyGi9+6ahOxt42C5l 5oQ0PLys/gTxnezB3pwzQhpHhyvC8uCVLheExoafdkRrES3PFBC0Yk4nOnduHm9pwBUw WLhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688132722; x=1690724722; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VITRkEgIEwGUfQXNLxylUtIJOPCbRcUYZW1La62GwYc=; b=RdRBT7fVR/xjzMaUQ2lk+85eIAJEP2pIu14lSljR2seuktxH9hoTkYdx89Aij1NriJ CWKL18KsE+cwI4eKKgl9pwB3tDBo3iE4keU0GEpyRl/F6Z4RHwL7R6pI+GkEr4RczCuT lgLurm5VSPi1SYSy+XDUkIavIGKfT4qSpc2ONO/IauQ5fVmGeJWbVSf2MROMxzYGwXTT M0/TuqGGzOB31Kn5bhbH8q4TD6GGO2KqhGxzz8FbzWuIZTJntnPyv+JAJCbYEwQNXu3F mioly6bq7VVjgSLF6eWevspl+okpHlbygTaa2EKotcJ/DDWD3kKNpUEiXb0yA0wkaBSA C5RQ== X-Gm-Message-State: ABy/qLb9wcRCBAW+dRpYQIeVb6F0xHt9ROagGWiqrIhNBecPvN1wdI9T Mml+55aM52b/ttUO/14BxRZucS5usKIlkbc/fsEiwA== X-Google-Smtp-Source: APBJJlH4ojga4Xv2J1J57T/y783+7g9DOuJQCB4Su3dxasWc5k7IhI5Lgi3ubNyaSSlBdgpadO1Tqw== X-Received: by 2002:ac2:4f14:0:b0:4f8:442c:de25 with SMTP id k20-20020ac24f14000000b004f8442cde25mr2727837lfr.5.1688132721815; Fri, 30 Jun 2023 06:45:21 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id bf11-20020a0560001ccb00b003062b2c5255sm18339176wrb.40.2023.06.30.06.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 06:45:21 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Jun 2023 14:42:32 +0100 Message-Id: <20230630134232.1295-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: Account for Bayer packing when validating format 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" RPiCameraConfiguration::validate() did not account for user supplied Bayer packing when validating the RAW stream configuration. Fix this by seeing what packing (if any) has been specified selecting the output RAW stream format. Fixes: 6c71ee1f1530 ("pipeline: raspberrypi: Introduce PipelineHandlerBase class") Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index df7482920e75..2eb71beaff55 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -288,8 +288,8 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() unsigned int bitDepth = info.isValid() ? info.bitsPerPixel : defaultRawBitDepth; V4L2SubdeviceFormat sensorFormat = findBestFormat(data_->sensorFormats_, cfg.size, bitDepth); - rawFormat.size = sensorFormat.size; - rawFormat.fourcc = raw.dev->toV4L2PixelFormat(cfg.pixelFormat); + BayerFormat::Packing packing = BayerFormat::fromPixelFormat(cfg.pixelFormat).packing; + rawFormat = PipelineHandlerBase::toV4L2DeviceFormat(raw.dev, sensorFormat, packing); int ret = raw.dev->tryFormat(&rawFormat); if (ret)