From patchwork Thu May 27 10:11:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 12446 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 153B0BDB80 for ; Thu, 27 May 2021 10:11:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 69F1B602AE; Thu, 27 May 2021 12:11:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="sfmN2iDk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 62F53602AA for ; Thu, 27 May 2021 12:11:08 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:563e:3c07:6748:2112]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D3569B2C; Thu, 27 May 2021 12:11:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1622110267; bh=xQ3rGEbvdPp8ciEdEiC3XANRTEqfEnb+ihNPcDMRzJM=; h=From:To:Cc:Subject:Date:From; b=sfmN2iDkc/37bpowdokGtTuzDQKS77/jfhBMWIOgxdIE6x0LlP0zOZ4eG7asLQrAE bRjLpU1jqg6bk+bCr3CiG6eKyv02lobmeYRTzDzoWkLOnY34AmlBc7UkBBhdeytRCi fWg3RcdpyTpDuvrhFloQxgoiFugGmcx03/0gJZ2c= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 27 May 2021 12:11:05 +0200 Message-Id: <20210527101105.32789-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] ipa: ipu3: Use a default gamma LUT at startup 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" A custom gamma LUT is used, but the table is not calculated at startup, resulting in an all 0's frame. Use the drfault LUT specified in the Linux kernel as a first estimation. Reported-by: Paul Elder Signed-off-by: Jean-Michel Hautbois Tested-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- src/ipa/ipu3/ipu3_awb.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp index f8788065..54ce8e67 100644 --- a/src/ipa/ipu3/ipu3_awb.cpp +++ b/src/ipa/ipu3/ipu3_awb.cpp @@ -134,6 +134,31 @@ static const struct ipu3_uapi_ccm_mat_config imguCssCcmDefault = { 0, 0, 8191, 0 }; +/* Default settings for Gamma correction */ +const struct ipu3_uapi_gamma_corr_lut imguCssGammaLut = { { + 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, 271, 287, + 303, 319, 335, 351, 367, 383, 399, 415, 431, 447, 463, 479, 495, 511, + 527, 543, 559, 575, 591, 607, 623, 639, 655, 671, 687, 703, 719, 735, + 751, 767, 783, 799, 815, 831, 847, 863, 879, 895, 911, 927, 943, 959, + 975, 991, 1007, 1023, 1039, 1055, 1071, 1087, 1103, 1119, 1135, 1151, + 1167, 1183, 1199, 1215, 1231, 1247, 1263, 1279, 1295, 1311, 1327, 1343, + 1359, 1375, 1391, 1407, 1423, 1439, 1455, 1471, 1487, 1503, 1519, 1535, + 1551, 1567, 1583, 1599, 1615, 1631, 1647, 1663, 1679, 1695, 1711, 1727, + 1743, 1759, 1775, 1791, 1807, 1823, 1839, 1855, 1871, 1887, 1903, 1919, + 1935, 1951, 1967, 1983, 1999, 2015, 2031, 2047, 2063, 2079, 2095, 2111, + 2143, 2175, 2207, 2239, 2271, 2303, 2335, 2367, 2399, 2431, 2463, 2495, + 2527, 2559, 2591, 2623, 2655, 2687, 2719, 2751, 2783, 2815, 2847, 2879, + 2911, 2943, 2975, 3007, 3039, 3071, 3103, 3135, 3167, 3199, 3231, 3263, + 3295, 3327, 3359, 3391, 3423, 3455, 3487, 3519, 3551, 3583, 3615, 3647, + 3679, 3711, 3743, 3775, 3807, 3839, 3871, 3903, 3935, 3967, 3999, 4031, + 4063, 4095, 4127, 4159, 4223, 4287, 4351, 4415, 4479, 4543, 4607, 4671, + 4735, 4799, 4863, 4927, 4991, 5055, 5119, 5183, 5247, 5311, 5375, 5439, + 5503, 5567, 5631, 5695, 5759, 5823, 5887, 5951, 6015, 6079, 6143, 6207, + 6271, 6335, 6399, 6463, 6527, 6591, 6655, 6719, 6783, 6847, 6911, 6975, + 7039, 7103, 7167, 7231, 7295, 7359, 7423, 7487, 7551, 7615, 7679, 7743, + 7807, 7871, 7935, 7999, 8063, 8127, 8191 +} }; + IPU3Awb::IPU3Awb() : Algorithm() { @@ -174,6 +199,7 @@ void IPU3Awb::initialise(ipu3_uapi_params ¶ms, const Size &bdsOutputSize, st params.acc_param.ccm = imguCssCcmDefault; params.use.acc_gamma = 1; + params.acc_param.gamma.gc_lut = imguCssGammaLut; params.acc_param.gamma.gc_ctrl.enable = 1; zones_.reserve(kAwbStatsSizeX * kAwbStatsSizeY);