From patchwork Thu Jun 6 11:52:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20221 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 2AF9EBD87C for ; Thu, 6 Jun 2024 11:52:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3213565457; Thu, 6 Jun 2024 13:52:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="S5o4Rx1s"; dkim-atps=neutral Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C03DF634CA for ; Thu, 6 Jun 2024 13:52:30 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a68e7538cfaso112279866b.0 for ; Thu, 06 Jun 2024 04:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1717674750; x=1718279550; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vFR/ITuS5PPZLWFzKLH1uaJixrP9NmLk/7hwZSLNjrU=; b=S5o4Rx1sOTY8viUEwIEFCsWe1YQE89GrA1txIvamnNx4k7Z+IELMGDX2lwplnr5ZxT aH0JNC0DopADJb6g7diws1zeELnx5bHqdofFUT4Cdh0N9zgTt2E/Cu6uE/qXN5jJk4PI +JJ0Q6UIH+4ms8z6d8se4kTcb+kWf7p9csp4q7F3A2GMqPeePr9tBVQ8Stxx6RL9l/d+ yCaJ9DdHtN/vkMgR8ssnxRtX8Sr1H3eOKwWUs5lEsy7j9KxEpAfkH6jK7WENa2+3nxYc 4Q+EHJDppCVAazQ88Wwzp4c2ICx/po1WZQ1qYQyiKSASk4lmWye06o7/ZEhKzuwoeGb9 Dotw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717674750; x=1718279550; 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=vFR/ITuS5PPZLWFzKLH1uaJixrP9NmLk/7hwZSLNjrU=; b=Gm7h0eafLzNOgmOZY2TV4FOaV39jP/IKsLghw2r51KWPKSqgJ7SAZ/WlFaE1WccHcU +6xn1cgpkiciHqKzDK5Y52bHJ8ZxDKIvUwani7Gj7qnsKYD/Zzesrwb68eToZUf4J+uw tTNsNwFrhntQdskdEVRUwa/kdAR0sMKxxYsGADj5aMA0SLQGLLc1UzTOvXHBQVpWRLQX C52PypeC6yLJb3XS7PeMrwHeCHaB7Y8lR7NHfF/cw8F3HVwGJM3n8YbDADwP8BJwIwN0 60Zh/w4ACNZXLBJ2xMMNtrTuweZGzqIj8y5fUoSH5y3M6CoHtd0A8bXH3uWiMLA97y8I JEBQ== X-Gm-Message-State: AOJu0YyfnGRoIt3tsX+jV1nfNYlf+ZsBkSdtBdzU5ZzdDgOJexA7eu9g oilq9Fp5x9rB4+p7XQbyZTq0+nRI7L2OuJIxYXAsAMdNdwpGJgl7eyUsM0kZxKzf+MhT/HC97za 3 X-Google-Smtp-Source: AGHT+IFNJamITPjVYmioMTx99FikAquKGIFXzy54bnqCKtYvRxqJ74Sb9ArsAUyj1OYCjcxC5bEsJQ== X-Received: by 2002:a17:906:840a:b0:a68:adab:101f with SMTP id a640c23a62f3a-a699fa9c13bmr335001366b.18.1717674749656; Thu, 06 Jun 2024 04:52:29 -0700 (PDT) Received: from localhost.localdomain ([188.39.149.98]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c8072889fsm86339666b.195.2024.06.06.04.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 04:52:29 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH] pipeline: rpi: Don't validate configuration in generateConfiguration() Date: Thu, 6 Jun 2024 12:52:23 +0100 Message-Id: <20240606115223.14868-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" generateConfiguration() called validate() as a final step, causing the stride and frameSize fields in StreamConfiguration to be filled in based on the pixel format and width/height. If a user application did not clear the stride field when setting up a custom pixel format and width/height, the pipeline handler would respect this stride and possibly overallocate buffers with a larger stride than needed. Fix this by removing the call to validate() completely, leaving the stride and frameSize fields defaulting to 0. Removal of this call is inconsequential as we hard-code a valid configuration for Raspberry Pi platforms in generateConfiguration(). Bug: https://github.com/raspberrypi/libcamera/issues/138 Bug: https://github.com/raspberrypi/libcamera/issues/141 Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 289af5165766..3041fd1ed9fd 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -496,8 +496,6 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, SpanaddConfiguration(cfg); } - config->validate(); - return config; }