From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=68.232.153.233 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796195784; b=f8Vpe6z4AqFMndy/MZPsmSXBno4xicaZU4aaUFWuyII8hr1vbI61bfVTuOnGyZ4s8fGf CCiOFVAVl0kHuPsHV9jpQHdl5/gg8Uhmyn77xSBk/iEJrfRLzCmIyAqj8B2K/hK9XjIin KE0hq273dVckrb9LshklheE+lsFzwXY9Tx22DYGtwoeEBxmfWhqv1PsbhNPK2u3K4okfZ kjiRacdkY6CLcNV1e+hmlYyG1Rz64Lc+mlYJz8jUc8IWUs8/chClmH5VG28b105HOfZw7 AckhRGMvEzNGZp9GMh3daZGiPd8SRjMfwCoAWtxsTpvfmrkth78BRw0VDdfsGuuCrdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796195784; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-Amp-Result:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer; bh=N4KDp2Lbzwds1v+ldVhPnGu4/xPWJnGasvZ32R6X8zs=; b=heuru1lFXVJCwP2vQacF0jfaeMzAwX8oHO9e12TtKRWeN8DHeAV7rEjgjqWra4Rur9Yj f6oL6U3KM+7PqLSrDD/J4RAHKmdLr98QJwBmEPKY/7iqLf82lUUpZjQeOkx3matFgRmeE 0XdVnbfOaSmjxIO2frBSxuSpkN9/9t+k6SrwlQIwkfIDDZ/SizDGXhX5dGRz+LhL35yKW /QmexCRlDK5NPr+38nhfyj4CZm9a6D9Jtku+i3ahbVKIl9JSvcx1KTrNCjjY2qPLNyRQm n/ygZFiZqX28rBBE3lQFzmSB7RAhqT2q+KYHZ/2Y5p2sDfUG9kP0y+wg/xCVox7T/UA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=miojrboZ; arc=none smtp.remote-ip=68.232.153.233 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDA9C606A683 for ; Wed, 2 Dec 2026 07:16:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CDA9C606A683 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=miojrboZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1796195783; x=1827731783; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=W4Q8kAaWRiMKgweCT6ySJwxaleCUgNaJnwtGT8Ql3JM=; b=miojrboZRbpMGOtqABrNIWEvRD85PQ1G2FzfqHXO1ET/HxnsxsoS+Jlp bj6ZN0nW18Jux2jK78syev6c+YTtfpiI+YxDLHJzlrzHar+7q9yAfqgio cIHlTLe+MgK7jGx8uELgCc3xbE1LWQNAgYvxS8jomUDd5xKcWGjS8phuB sdfGlpzZzamAcT0YInQ/DVOQAn7cvEkozoP4d+V5aMLoUCalPNMvEKlmU ESCEpHC6K4ontrJbsFD0wTPuNRPxmzPOXvvlQTNbzUK7bEnjuj6GD09CA v3Yj/dl4583A7DV9QtxR4TQJuJnkTwg3mUMT6lD2VIbYCBMy6jkxO723B g==; X-CSE-ConnectionGUID: odKB8xjYRda/Q0zPBgev+Q== X-CSE-MsgGUID: 1XES6sHVT6mWozUqBly7JA== X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="67334004" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Dec 2026 00:16:23 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Wed, 2 Dec 2026 00:16:22 -0700 Received: from [127.0.0.1] (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Wed, 2 Dec 2026 00:16:20 -0700 From: Balakrishnan Sambath Date: Wed, 2 Dec 2026 12:46:12 +0530 Subject: [PATCH 06/15] media: microchip-isc: add gamma 1.8 and 2.4 curves for SAMA7G5 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20261202-isc-series-v1-v1-6-4e2f17c0271c@microchip.com> References: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> In-Reply-To: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> To: CC: , Balamanikandan Gunasundar , Balakrishnan Sambath X-Mailer: b4 0.14.3 Add 1/2.4 and 1/1.8 tables after the existing 1/2.2 one in isc_sama7g5_gamma_table and set gamma_max to 2, so V4L2_CID_GAMMA selects 0 (1/2.2), 1 (1/2.4) or 2 (1/1.8). 1/2.2 stays at index 0 because gamma_max was 0 before, so an explicit gamma of 0 keeps its curve. The control default was gamma_max, which would now pick 1/1.8 on SAMA7G5. Add gamma_def to struct isc_device and set it to 0 on SAMA7G5 and 2 on SAMA5D2, so the default stays 1/2.2 on both. Co-developed-by: Balamanikandan Gunasundar Signed-off-by: Balamanikandan Gunasundar Signed-off-by: Balakrishnan Sambath --- .../media/platform/microchip/microchip-isc-base.c | 2 +- drivers/media/platform/microchip/microchip-isc.h | 2 ++ .../platform/microchip/microchip-sama5d2-isc.c | 1 + .../platform/microchip/microchip-sama7g5-isc.c | 33 ++++++++++++++++++++-- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index 4cbdc43da715..86f0eb86b76d 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -1656,7 +1656,7 @@ static int isc_ctrl_init(struct isc_device *isc) v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BRIGHTNESS, -1024, 1023, 1, 0); v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAMMA, 0, isc->gamma_max, 1, - isc->gamma_max); + isc->gamma_def); isc->awb_ctrl = v4l2_ctrl_new_std(hdl, &isc_awb_ops, V4L2_CID_AUTO_WHITE_BALANCE, 0, 1, 1, 1); diff --git a/drivers/media/platform/microchip/microchip-isc.h b/drivers/media/platform/microchip/microchip-isc.h index d7bcd74efff9..31d9cf84b318 100644 --- a/drivers/media/platform/microchip/microchip-isc.h +++ b/drivers/media/platform/microchip/microchip-isc.h @@ -243,6 +243,7 @@ enum isc_scaler_pads { * @gamma_table: pointer to the table with gamma values, has * gamma_max sets of GAMMA_ENTRIES entries each * @gamma_max: maximum number of sets of inside the gamma_table + * @gamma_def: default set inside the gamma_table * * @max_width: maximum frame width, dependent on the internal RAM * @max_height: maximum frame height, dependent on the internal RAM @@ -345,6 +346,7 @@ struct isc_device { /* pointer to the defined gamma table */ const u32 (*gamma_table)[GAMMA_ENTRIES]; u32 gamma_max; + u32 gamma_def; u32 max_width; u32 max_height; diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c index 5e41eee45dbd..a93f95434270 100644 --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c @@ -460,6 +460,7 @@ static int microchip_isc_probe(struct platform_device *pdev) isc->gamma_table = isc_sama5d2_gamma_table; isc->gamma_max = 2; + isc->gamma_def = 2; isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH; isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT; diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c index 80bd0fd3716d..415c58c42614 100644 --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c @@ -350,9 +350,9 @@ static void isc_sama7g5_adapt_pipeline(struct isc_device *isc) isc->try_config.bits_pipeline &= ISC_SAMA7G5_PIPELINE; } -/* Gamma table with gamma 1/2.2 */ +/* Gamma tables with gamma values 0.45(Default), 0.42, 0.56 */ static const u32 isc_sama7g5_gamma_table[][GAMMA_ENTRIES] = { - /* index 0 --> gamma bipartite */ + /* index 0 --> gamma bipartite 1/2.2(=0.45) */ { 0x780, 0x3c02c0, 0x520200, 0x6201c0, 0x700180, 0x7c0160, 0x870140, 0x910120, 0x9a0100, 0xa20100, 0xaa0100, 0xb200e0, @@ -365,6 +365,32 @@ static const u32 isc_sama7g5_gamma_table[][GAMMA_ENTRIES] = { 0x3130028, 0x3270026, 0x33a0024, 0x34c0024, 0x35e0024, 0x3700022, 0x3810022, 0x3920020, 0x3a20022, 0x3b3001e, 0x3c20020, 0x3d2001e, 0x3e1001e, 0x3f0001e, 0x3ff001c, 0x40d001c }, + /* index 1 --> gamma bipartite 1/2.4(=0.42) */ + { + 0x960, 0x4b0300, 0x630260, 0x7601c0, 0x8401a0, 0x910180, + 0x9d0160, 0xa80120, 0xb10120, 0xba0120, 0xc30100, 0xcb0100, + 0xd300e0, 0xda00e0, 0xe100e0, 0xe800c0, 0xee00c0, 0xf400c0, + 0xfa00c0, 0x10000a0, 0x10500c0, 0x10b00a0, 0x11000a0, 0x11500a0, + 0x11a00a0, 0x11f00a0, 0x12400a0, 0x12900a0, 0x12e00a0, 0x13300a0, + 0x1380080, 0x13c00a0, 0x1410072, 0x17a0060, 0x1aa0054, 0x1d4004a, + 0x1f90044, 0x21b003e, 0x23a003a, 0x2570036, 0x2720032, 0x28b0030, + 0x2a3002e, 0x2ba002c, 0x2d0002c, 0x2e60028, 0x2fa0028, 0x30e0026, + 0x3210024, 0x3330024, 0x3450022, 0x3560022, 0x3670020, 0x3770020, + 0x387001e, 0x396001e, 0x3a5001c, 0x3b3001c, 0x3c1001c, 0x3cf001c, + 0x3dd001c, 0x3eb001c, 0x3f9001c, 0x407001c }, + /* index 2 --> gamma bipartite 1/1.8(=0.56) */ + { + 0x400, 0x2001e0, 0x2f0180, 0x3b0140, 0x450120, 0x4e0120, + 0x5700e0, 0x5e0100, 0x6600c0, 0x6c00e0, 0x7300c0, 0x7900c0, + 0x7f00c0, 0x8500c0, 0x8b00a0, 0x9000a0, 0x9500a0, 0x9a00a0, + 0x9f00a0, 0xa400a0, 0xa900a0, 0xae0080, 0xb200a0, 0xb70080, + 0xbb0080, 0xbf0080, 0xc300a0, 0xc80080, 0xcc0080, 0xd00080, + 0xd40060, 0xd70080, 0xdb0070, 0x113005e, 0x1420056, 0x16d004e, + 0x1940048, 0x1b80044, 0x1da0040, 0x1fa003c, 0x218003a, 0x2350038, + 0x2510036, 0x26c0034, 0x2860034, 0x2a00030, 0x2b80030, 0x2d0002e, + 0x2e7002e, 0x2fe002c, 0x314002c, 0x32a002a, 0x33f002a, 0x3540028, + 0x3680028, 0x37c0028, 0x3900026, 0x3a30026, 0x3b60026, 0x3c90024, + 0x3db0024, 0x3ed0024, 0x3ff0024, 0x4110024 }, }; static int xisc_parse_dt(struct device *dev, struct isc_device *isc) @@ -482,7 +508,8 @@ static int microchip_xisc_probe(struct platform_device *pdev) } isc->gamma_table = isc_sama7g5_gamma_table; - isc->gamma_max = 0; + isc->gamma_max = 2; + isc->gamma_def = 0; data = of_device_get_match_data(dev); if (!data) -- 2.34.1