From patchwork Wed Nov 18 16:46:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GuyliandeJong X-Patchwork-Id: 29022 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 62DFBC3304 for ; Wed, 18 Nov 2026 16:46:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 073776A90B; Wed, 18 Nov 2026 17:46:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=proton.me header.i=@proton.me header.b="KvLkU2Ed"; dkim-atps=neutral Received: from mail-43103.protonmail.ch (mail-43103.protonmail.ch [185.70.43.103]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C891D6A8F2 for ; Wed, 18 Nov 2026 17:46:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1795020401; x=1795279601; bh=DW23DH4z+kQwIlw+fwd7nWOxo3OFDMRRfF+A/2wK4wk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KvLkU2Ed2CpqQJ4kwSQ4TpeKvWlRjwoZBajTw6HnOW4/DK37wQDZcrg1NklQ0/PUs c0MolcUOImXMxfZ5JrgPzKrLwIvXqw8439d4eVfCBnrEHeWW6YsQmsV7rLpGa1QtpQ +OUU+G5+/8Wzs3bA7pj9Lui2IP++3i0HUgoW9/suOsIPhd7NWG8KHxOiWpAFCQoMg/ I21c18ky79m0zNngR5HhsRX2ALv6oDKAaZ6gm13HxykPBvebEqvaua1f+cRpvrakoI duhCy5gz/jvBr70MSxyYUKm5a3lkc+LhdPoa+c8ZrQRxn9wakyQKBfvXltOgJPR9IQ B89tshC4loipw== Date: Wed, 18 Nov 2026 16:46:37 +0000 To: libcamera-devel@lists.libcamera.org From: GuyliandeJong Cc: Daniel Scally , Barnabas Pocze , Afonso Figuinha Subject: [PATCH 1/6] ipa: ipu3: lsc: Fill all rows of the shading table Message-ID: <20261118164621.15513-2-guyliandejong@proton.me> In-Reply-To: <20261118164621.15513-1-guyliandejong@proton.me> References: <20261118164621.15513-1-guyliandejong@proton.me> Feedback-ID: 112452169:user:proton X-Pm-Message-ID: 6156dd3262afd7c826345753136e420263104eb2 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" The shading LUT is split in sets of grid_height_per_slice rows of numHCells_ cells each. The number of sets to fill is computed from the number of horizontal cells instead of the number of vertical cells, so when the grid has more rows than columns, the last rows are never written and get no shading correction. This happens with the OV9734 (1296x734), where the grid is 41x46 cells with 3 rows per set: 16 sets are needed, but only 14 are filled, and the bottom 4 rows of the image are left uncorrected. Compute the number of sets from the number of vertical cells. Fixes: 279d355ef8f7 ("ipa: ipu3: Add Lens Shading Correction algorithm") Signed-off-by: GuyliandeJong --- src/ipa/ipu3/algorithms/lsc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/ipu3/algorithms/lsc.cpp b/src/ipa/ipu3/algorithms/lsc.cpp index 77e637fd..729a23ff 100644 --- a/src/ipa/ipu3/algorithms/lsc.cpp +++ b/src/ipa/ipu3/algorithms/lsc.cpp @@ -256,7 +256,7 @@ void Lsc::prepare([[maybe_unused]] IPAContext &context, [[maybe_unused]] const u unsigned int totalCells = numHCells_ * numVCells_; unsigned int cellsPerSet = numHCells_ * config->grid.grid_height_per_slice; - unsigned int numSets = (numHCells_ + config->grid.grid_height_per_slice - 1) / + unsigned int numSets = (numVCells_ + config->grid.grid_height_per_slice - 1) / config->grid.grid_height_per_slice; unsigned int i = 0;