From patchwork Fri May 9 07:51:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 888982 Received: from ni.piap.pl (ni.piap.pl [195.187.100.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB72A3595D; Fri, 9 May 2025 08:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.187.100.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746777694; cv=none; b=C0qk5R9yWtF+x95bQg6oc5lhAtXOyzXJ2t1wiG5YLjNz1VuxWqTijA8QbR8+3NI4rP5Y9KxX+US3RsbOrakd0qOx7zO5/kpJGwmRDB/45jnG2tmXh+aOJGtyDcpePYL52n1wh3HPZCzEqV3IXCIfWJ/mBvLfAMoDLP264cBkF58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746777694; c=relaxed/simple; bh=dej6BJ/BdNbyO9nEVexiAWQNIoCwvzx+mOSf+vwFstA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pjPUsBVqi5g6jrHzpMqSXgSmHHY+2F/M2hdLbOzratjnJyrtiTdgLZnVbHAx9Bk2cYA/V1YroCClizAtuN299xMSyWf1Qx1x+ClbOFzLTHCacQwNucXIYsKuWHBVweZj1Hfid8C4N26EUUxN148zfEnoUbKP+wJXu8S1kN+Yauk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=piap.pl; spf=pass smtp.mailfrom=piap.pl; arc=none smtp.client-ip=195.187.100.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=piap.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=piap.pl Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTPS id 28A09C405A46; Fri, 9 May 2025 09:51:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 ni.piap.pl 28A09C405A46 From: =?utf-8?q?Krzysztof_Ha=C5=82asa?= To: Dafna Hirschfeld Cc: Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacopo Mondi , Paul Elder , Ondrej Jirman , Tomi Valkeinen Subject: [PATCH] RKISP1: correct histogram window size Sender: khalasa@piap.pl Date: Fri, 09 May 2025 09:51:46 +0200 Message-ID: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Without the patch (i.MX8MP, all-white RGGB-12 full HD input from the sensor, YUV NV12 output from ISP, full range, histogram Y mode). HIST_STEPSIZE = 3 (lowest permitted): isp_hist_h_size: 383 (= 1920 / 5 - 1) isp_hist_v_size: 215 (= 1080 / 5 - 1) histogram_measurement_result[16]: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 229401 Apparently the histogram is missing the last column (3-pixel wide, though only single pixels count) and the last (same idea) row of the input image: 1917 * 1077 / 3 / 3 = 229401 with the patch applied: isp_hist_h_size: 384 (= 1920 / 5) isp_hist_v_size: 216 (= 1080 / 5) histogram_measurement_result[16]: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 230400 1920 * 1080 / 3 / 3 = 230400 Signed-off-by: Krzysztof HaƂasa diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c index b28f4140c8a3..ca9b3e711e5f 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c @@ -819,8 +819,8 @@ static void rkisp1_hst_config_v10(struct rkisp1_params *params, arg->meas_window.v_offs); block_hsize = arg->meas_window.h_size / - RKISP1_CIF_ISP_HIST_COLUMN_NUM_V10 - 1; - block_vsize = arg->meas_window.v_size / RKISP1_CIF_ISP_HIST_ROW_NUM_V10 - 1; + RKISP1_CIF_ISP_HIST_COLUMN_NUM_V10; + block_vsize = arg->meas_window.v_size / RKISP1_CIF_ISP_HIST_ROW_NUM_V10; rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_HIST_H_SIZE_V10, block_hsize);