Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5429468ybp; Mon, 14 Oct 2019 22:35:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwYSFzf99Esb/4OE6+C8/ov8hHXD3jixzLvjV+6l0kO9n28tqNoqdfIjDKgC1KTQm4Xf/5 X-Received: by 2002:a05:6402:32a:: with SMTP id q10mr32618593edw.149.1571117718505; Mon, 14 Oct 2019 22:35:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571117718; cv=pass; d=google.com; s=arc-20160816; b=CBapHqneFuZpS//5rW4a0GwghP63gT3bQxtFbgdlOsdaMucz4u2+6dHuLsUXNKv6Gj +j6r3OnzGkLTQXeAe+FEUqSiVNiASyBMUNMHNhqxrGGb+TzEllmgSyCVJ48qaE4g7cQi 1DywZtEeku2d8jkNhpi1ZQS9IG8ubGfjbvQZeQpouTtOtL6wFo+S6/DFrWigjMUBGrmG Qa+Prqz5yw4YR8LcQAuWu5IlaFU15DMkWiMalxv6lHmzpVbDaa1+Ga4HR/NBLDoPfFAK 7eOmy+1hBCBulLvSgyY2rDxT39TTYMOGQ982WvnMk6xzY4VzvRU2xDr6q1uDeiamWWEH MrnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:nodisclaimer :original-authentication-results:mime-version :content-transfer-encoding:authentication-results-original :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature; bh=fIUGSIoTFS+rG3rkaZCUgjh5FrULV5M3gll9vYVFpDA=; b=GGPYi2sfNd5qvKz6BFACxLUpSyO94QDOF3JeuCqdU2pvLF9I4KoViULUg6f9rNXJ0A AerL4MGipCtHVhnTIy6GW++MUfEOrgGehwLX2+Iz56dabuGlZXgPZdvc3b0aU0fYO+bU JJ//tEPJ+SJTSWCDILGUDKJlgObLo0dgOwnavvyyjvJnZR0XP8tWSDC9CkziJ470T4ic nWWiqgId1Kot7EVK2HZsc8f5kE37zRzi9H5Lt+M6wFy93cmjvDeXMRHwRepZV/aBslA/ nGGvKzv3hIkmGz3Ff2YL1ODUeeMa8tCdLlW2UU1mkP0MTzKnEfYG6/1LUoM/AiqAmLPh onnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=WnLgaVsa; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=WnLgaVsa; arc=pass (i=1 spf=pass spfdomain=arm.com dkim=pass dkdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si12248336ejw.144.2019.10.14.22.34.54; Mon, 14 Oct 2019 22:35:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=WnLgaVsa; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=WnLgaVsa; arc=pass (i=1 spf=pass spfdomain=arm.com dkim=pass dkdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727039AbfJOCL3 (ORCPT + 99 others); Mon, 14 Oct 2019 22:11:29 -0400 Received: from mail-eopbgr50071.outbound.protection.outlook.com ([40.107.5.71]:22099 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726430AbfJOCL2 (ORCPT ); Mon, 14 Oct 2019 22:11:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIUGSIoTFS+rG3rkaZCUgjh5FrULV5M3gll9vYVFpDA=; b=WnLgaVsaIfA3o7Iyjfl7HOYrLzw01XOgkMge8v/GSZ/wwMSHLv1q2yax4SN9kP+qgZiazdcx2tHzt4d/r3nkbd9fUipWhU7akTucJXePk2F8I7rR8JIpsQXeIi5tt5Z0p9M5TjXcxmZMf+5H/Z4veVa72Zl/CuXEUbCtd/eqthg= Received: from DB6PR0801CA0063.eurprd08.prod.outlook.com (2603:10a6:4:2b::31) by AM0PR08MB3012.eurprd08.prod.outlook.com (2603:10a6:208:5b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Tue, 15 Oct 2019 02:11:21 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by DB6PR0801CA0063.outlook.office365.com (2603:10a6:4:2b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2347.16 via Frontend Transport; Tue, 15 Oct 2019 02:11:21 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; vger.kernel.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;vger.kernel.org; dmarc=none action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Tue, 15 Oct 2019 02:11:20 +0000 Received: ("Tessian outbound 0cf06bf5c60e:v33"); Tue, 15 Oct 2019 02:11:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5207e13f6e540a4c X-CR-MTA-TID: 64aa7808 Received: from 95c9ceaedac9.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.9.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 58242113-226D-4520-99A7-6E8607A998AF.1; Tue, 15 Oct 2019 02:11:10 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2050.outbound.protection.outlook.com [104.47.9.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 95c9ceaedac9.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Tue, 15 Oct 2019 02:11:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CmNDq2ljwI5XYS/ljhzybAhAzXek7cIjeDnWIVo8Zxr92w5d7r4h+IKwSOb+/NMFvNqPDov5R9ty5BHpGC3r7oaAEagkVryc9n7X4G89hvYF5psh5mnuKqNL3qaRgk+LJPP1Wic0E9uy51c6KjexaDQ4T5mavGU1szjK2DyrFL930a7gZFnxj51CpzJeYBpR3oBBniLaIGTF6rDKbjOeZra5xl+HqvZ/2jwm3Ga9XHSRr31rtb2CM1ywxboGMJPL4vBYy8S16hCelkynXTNiplOeF9JSGLxmWeAH6JIY0jzAQEA7T5NlmbHTd/9gj4gIbqiNDTUy9s2SlCFJktBzOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIUGSIoTFS+rG3rkaZCUgjh5FrULV5M3gll9vYVFpDA=; b=BeOgIcjRlQG9FUqo7+ad6TchX/EV09Wt17KPBWo5ww085/dvB5kNECFI9W1II8UIeqaRw+Y4PzH08AHeH4YEk2CwIpePlvInrLHCdPVURBfIycDkLTFHluyjyK4yEGukFa3QlvbGxx3LlIsK3afkaAeL6cFoOIzZ4xBGhSMA2RYBqOIMOcnWyXXvwtEx3IC/u3Dox6qprzzuqCRW8FWj5gnJ/ro3zLJ85PWIKXELKxKNfhqfbdPJ8XGXCnaF0gp7Pq9xv2TVqAMhxR/9oU6HyPF6BfoD64U/ExAEV409sSwinx7dbNSgnTYsTh69+X2NavmXqs8NUhQUIwRMSH75eA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIUGSIoTFS+rG3rkaZCUgjh5FrULV5M3gll9vYVFpDA=; b=WnLgaVsaIfA3o7Iyjfl7HOYrLzw01XOgkMge8v/GSZ/wwMSHLv1q2yax4SN9kP+qgZiazdcx2tHzt4d/r3nkbd9fUipWhU7akTucJXePk2F8I7rR8JIpsQXeIi5tt5Z0p9M5TjXcxmZMf+5H/Z4veVa72Zl/CuXEUbCtd/eqthg= Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4799.eurprd08.prod.outlook.com (10.255.115.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Tue, 15 Oct 2019 02:11:08 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::40ed:7ed3:90cf:ece5]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::40ed:7ed3:90cf:ece5%3]) with mapi id 15.20.2347.023; Tue, 15 Oct 2019 02:11:08 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , "imirkin@alum.mit.edu" CC: "Jonathan Chai (Arm Technology China)" , "Julien Yin (Arm Technology China)" , "Thomas Sun (Arm Technology China)" , "Lowry Li (Arm Technology China)" , Ayan Halder , "Tiannan Zhu (Arm Technology China)" , "Yiqi Kang (Arm Technology China)" , nd , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Ben Davis , "Oscar Zhang (Arm Technology China)" , "Channing Chen (Arm Technology China)" , Mihail Atanassov , "Lowry Li (Arm Technology China)" Subject: [PATCH v4 4/4] drm/komeda: Adds gamma and color-transform support for DOU-IPS Thread-Topic: [PATCH v4 4/4] drm/komeda: Adds gamma and color-transform support for DOU-IPS Thread-Index: AQHVgv3OQ34D7f1MHkmhb7Kvw8BM2g== Date: Tue, 15 Oct 2019 02:11:08 +0000 Message-ID: <20191015021016.327-5-james.qian.wang@arm.com> References: <20191015021016.327-1-james.qian.wang@arm.com> In-Reply-To: <20191015021016.327-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: HK0PR01CA0030.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::18) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 8a4a53ea-5834-421f-ebec-08d75114f849 X-MS-Office365-Filtering-HT: Tenant X-MS-TrafficTypeDiagnostic: VE1PR08MB4799:|VE1PR08MB4799:|AM0PR08MB3012: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:2958;OLM:2958; x-forefront-prvs: 01917B1794 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(366004)(346002)(376002)(396003)(189003)(199004)(66066001)(476003)(76176011)(110136005)(54906003)(66946007)(64756008)(66476007)(66446008)(71200400001)(66556008)(26005)(103116003)(2201001)(86362001)(6512007)(186003)(71190400001)(316002)(36756003)(6506007)(446003)(11346002)(386003)(2616005)(486006)(2906002)(256004)(52116002)(14444005)(55236004)(102836004)(2171002)(8936002)(14454004)(478600001)(6486002)(81156014)(81166006)(305945005)(50226002)(2501003)(4326008)(8676002)(7736002)(5660300002)(1076003)(6116002)(3846002)(25786009)(99286004)(6436002);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR08MB4799;H:VE1PR08MB5006.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: keCgo9PdbWh8XH5/sjRCzsoLoqmmIpEBKyZfqKwzO52d98qzxPfGIX3LTEi/nlWAMfPq5x9dd4Pw+rC00Delayp6RzPPe7ky9iXeP561OLMwsrY5Tv88BY2SUcYT9dDeAyxnic+lmlv1vAEm9dTWXJHfd1ex7C4J8+YxQ9fSTH5Gbx3V8iS+lFXN0ZlqlyWWIEHPcPL2JJndgPy0eJ3iEV6NgcUlsyqthoPhWN/Ndttinl2tMY3JgtLmSOOBt08AwbwGmDP3ye7Q7uwe4z11xDUk1kA+WKIHv/hWq+wRJXCuzoHTUPbK+nMa2KbU95lmSXRe/CwVODc2SfAXT2jSyQ9+3WB7gf1oNlPc4X8khKygszJcZ483EOgtLs1aUX5VcEds/HVZtWsBA/ZV7OO2uJ3gaApsHB+SHUgfQpjJocw= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4799 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(136003)(346002)(396003)(376002)(189003)(199004)(2501003)(76176011)(8936002)(4326008)(8746002)(6116002)(3846002)(22756006)(14444005)(99286004)(50226002)(26005)(386003)(6506007)(76130400001)(316002)(81166006)(81156014)(186003)(336012)(25786009)(2171002)(2906002)(70586007)(86362001)(14454004)(8676002)(2201001)(70206006)(54906003)(50466002)(5660300002)(110136005)(63350400001)(305945005)(476003)(26826003)(2616005)(446003)(486006)(126002)(11346002)(36756003)(7736002)(356004)(6512007)(102836004)(478600001)(66066001)(23756003)(1076003)(6486002)(103116003)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB3012;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: ad8006b6-c105-4f81-275b-08d75114f10f NoDisclaimer: True X-Forefront-PRVS: 01917B1794 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rMCNz7rp40vgMAGeDJXdEVTJn1QzY/VCJsiIHOIbZqGiEorf4fEvMFRS4P9Bv3+Qq/DdG4DAmx1kxjsnNzJpCrWPO+40NcsjFni6XK06tEDChavTJWdOfqsZmutFvT9T+GixxpO1t1v9Darf+Ehq7ycU9piXx/WiGXtZptYL9A3dAl22zz/tRu8ZQ8aO5WbeDCxhM2N/mr63kqWf4C6lUUYNoKBx9r37iUk+l7MZPthruZBzJ9xmknjT2JhVe4YrlJwQESon0siFEiy6NMUjwHE1tcLj2pbNFIzW6UkWK9JjcjD4SxUtdM8I6UyzMP3+nMWwErcSSrIn8VwSNmFc87ag5PPyJvHd9iIZWSvP/uV0Ebqv+10b9ArnAikbggT8gRYD/z27Vm5NapDhR4SVUlCLsAg9BDku+6BujKXEH3w= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2019 02:11:20.2483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a4a53ea-5834-421f-ebec-08d75114f849 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3012 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Lowry Li (Arm Technology China)" Adds gamma and color-transform support for DOU-IPS. Adds two caps members fgamma_coeffs and ctm_coeffs to komeda_improc_state. If color management changed, set gamma and color-transform accordingly. Signed-off-by: Lowry Li (Arm Technology China) --- .../arm/display/komeda/d71/d71_component.c | 24 +++++++++++++++++++ .../gpu/drm/arm/display/komeda/komeda_crtc.c | 2 ++ .../drm/arm/display/komeda/komeda_pipeline.h | 3 +++ .../display/komeda/komeda_pipeline_state.c | 6 +++++ 4 files changed, 35 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drive= rs/gpu/drm/arm/display/komeda/d71/d71_component.c index c3d29c0b051b..e7e5a8e4430e 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c @@ -942,15 +942,39 @@ static int d71_merger_init(struct d71_dev *d71, static void d71_improc_update(struct komeda_component *c, struct komeda_component_state *state) { + struct drm_crtc_state *crtc_st =3D state->crtc->state; struct komeda_improc_state *st =3D to_improc_st(state); + struct d71_pipeline *pipe =3D to_d71_pipeline(c->pipeline); u32 __iomem *reg =3D c->reg; u32 index; + u32 mask =3D 0, ctrl =3D 0; =20 for_each_changed_input(state, index) malidp_write32(reg, BLK_INPUT_ID0 + index * 4, to_d71_input_id(state, index)); =20 malidp_write32(reg, BLK_SIZE, HV_SIZE(st->hsize, st->vsize)); + + if (crtc_st->color_mgmt_changed) { + mask |=3D IPS_CTRL_FT | IPS_CTRL_RGB; + + if (crtc_st->gamma_lut) { + malidp_write_group(pipe->dou_ft_coeff_addr, FT_COEFF0, + KOMEDA_N_GAMMA_COEFFS, + st->fgamma_coeffs); + ctrl |=3D IPS_CTRL_FT; /* enable gamma */ + } + + if (crtc_st->ctm) { + malidp_write_group(reg, IPS_RGB_RGB_COEFF0, + KOMEDA_N_CTM_COEFFS, + st->ctm_coeffs); + ctrl |=3D IPS_CTRL_RGB; /* enable gamut */ + } + } + + if (mask) + malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl); } =20 static void d71_improc_dump(struct komeda_component *c, struct seq_file *s= f) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu= /drm/arm/display/komeda/komeda_crtc.c index 9beeda04818b..406b9d0ca058 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -590,6 +590,8 @@ static int komeda_crtc_add(struct komeda_kms_dev *kms, =20 crtc->port =3D kcrtc->master->of_output_port; =20 + drm_crtc_enable_color_mgmt(crtc, 0, true, KOMEDA_COLOR_LUT_SIZE); + return err; } =20 diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers= /gpu/drm/arm/display/komeda/komeda_pipeline.h index b322f52ba8f2..c5ab8096c85d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -11,6 +11,7 @@ #include #include #include "malidp_utils.h" +#include "komeda_color_mgmt.h" =20 #define KOMEDA_MAX_PIPELINES 2 #define KOMEDA_PIPELINE_MAX_LAYERS 4 @@ -324,6 +325,8 @@ struct komeda_improc { struct komeda_improc_state { struct komeda_component_state base; u16 hsize, vsize; + u32 fgamma_coeffs[KOMEDA_N_GAMMA_COEFFS]; + u32 ctm_coeffs[KOMEDA_N_CTM_COEFFS]; }; =20 /* display timing controller */ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/d= rivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index 0ba9c6aa3708..4a40b37eb1a6 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -756,6 +756,12 @@ komeda_improc_validate(struct komeda_improc *improc, st->hsize =3D dflow->in_w; st->vsize =3D dflow->in_h; =20 + if (kcrtc_st->base.color_mgmt_changed) { + drm_lut_to_fgamma_coeffs(kcrtc_st->base.gamma_lut, + st->fgamma_coeffs); + drm_ctm_to_coeffs(kcrtc_st->base.ctm, st->ctm_coeffs); + } + komeda_component_add_input(&st->base, &dflow->input, 0); komeda_component_set_output(&dflow->input, &improc->base, 0); =20 --=20 2.20.1