From patchwork Tue Nov 24 09:11:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 29077 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 0215BC3304 for ; Tue, 24 Nov 2026 09:11:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C4E196A9B9; Tue, 24 Nov 2026 10:11:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bdVscjZz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87B536A8C7 for ; Tue, 24 Nov 2026 10:11:11 +0100 (CET) Received: from pb-laptop.local (185.182.215.119.nat.pool.zt.hu [185.182.215.119]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A237ABE1 for ; Tue, 24 Nov 2026 10:08:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1795511318; bh=D2jLr3ATNLuoaq+ISPqOknVudjvN7mrD+mINt/T9TDk=; h=From:To:Subject:Date:From; b=bdVscjZzh+rqvUBNb7D+B1/bo5HDsCyoA/2yFzpsbouELa9dNq6bWNsbM6zOFB7d0 tXcx1pR68v6SPpl624hkDJRlmUntdGnVYmr8dGnVVY2FWQq4zf66XGghREJ1BC2sxt yitInb6prdB4yQKXc+WIFGrIVG5ZzegkExBGi/Ok= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] ipa: rkisp1: Handle missing histogram Date: Tue, 24 Nov 2026 10:11:08 +0100 Message-ID: <20261124091108.1068218-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.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" Check if a valid histogram is actually contained in the statistics, and skip processing if not. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/agc.cpp | 5 +++-- src/ipa/rkisp1/algorithms/lux.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 1c323ede87..bdc78a9ff6 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -355,10 +355,11 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, const rkisp1_cif_isp_stat *params = nullptr; if (stats) { - if (stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP) + if ((stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP) && + (stats->meas_type & RKISP1_CIF_ISP_STAT_HIST)) params = &stats->params; else - LOG(RkISP1Agc, Error) << "AUTOEXP data is missing in statistics"; + LOG(RkISP1Agc, Error) << "AUTOEXP / HIST data is missing in statistics"; } if (params) { diff --git a/src/ipa/rkisp1/algorithms/lux.cpp b/src/ipa/rkisp1/algorithms/lux.cpp index 5f47ce37eb..70062b79ba 100644 --- a/src/ipa/rkisp1/algorithms/lux.cpp +++ b/src/ipa/rkisp1/algorithms/lux.cpp @@ -58,7 +58,7 @@ void Lux::process(IPAContext &context, const rkisp1_stat_buffer *stats, ControlList &metadata) { - if (!stats) { + if (!stats || !(stats->meas_type & RKISP1_CIF_ISP_STAT_HIST)) { lux_.process(context.activeState.lux, frameContext.lux, metadata, {}); return; }