Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37743452rwd; Tue, 11 Jul 2023 19:55:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGs38ZXckitUtOPytjiCYmv56MYt3EvcGP7CYptXfgNIjQJ6GFQbr4c9y3c6ypqt+tcXx5 X-Received: by 2002:a05:6358:7e96:b0:135:4003:784c with SMTP id o22-20020a0563587e9600b001354003784cmr13889125rwn.17.1689130509290; Tue, 11 Jul 2023 19:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689130509; cv=none; d=google.com; s=arc-20160816; b=qRP3s0ZwTIzGUIZO2RoVzTVo2kxhl15egnJ/rXPhrp3SSy4XhcDv/6Q8DbK+XNGDHC PKKRV8UcLMgzf3CVwsRIN2EXWW72W64omtLSXjNmmihrwTP1oIWBeMqvSOA7+3S9iHP0 c2VqWWYQtesGNa+OhVoQB8DNJPUNF/hxvQ2+LSKn6Tes9V/Otg8loHQzwTTG6O1qapdY 0Na1SPkJVO3jyTwu44YB6cKuGaIL6TH8JdbK2t1H2q+5sbTBmFJJexH53OlDOTog+ecZ ueY+fH1s5U7/1ImsfAg+iXQGIt4qtumWl4ZxUwNG9LX2dGYUSKifj4Lydv+TtvOeORPu 0uLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ltQpeBKVoxdrPHTVBvZ6nvHCvSgDIcGORHB/IRzLmWI=; fh=hqXxddZ8DLUwbnM3H43PrOHn+E+g1mOk3ANyl5S2DLo=; b=gkERvnskzMZFlJ5kawuphGKIVbwMPD8VdjLxLtibTIe9+6fYWwN7SeSP57WLE0CXQA vrtlNVEp7kkMrULxGhSWWFRFxWlovA7TLm+U1nqDk7LaRq3Y1gdB04x9vxcpCltnxOGy uFpNvTqcy/pM4RpM7kTsaXhBfqelthga+5LCLryX4d3EUixmsoQYZR34/bwSveq/HTkb FpRo7793DVIJycEGpd7M38JdAfOVtr+x+qp2fZoIYKZy+0TTtZONOKoeycwbbQXKIk05 CVtT89vnjecveZ9eHMJg54jg/L/WQf1PyNPxuRfcNr27kqaZlL6lVZHzp4DoZE95hnrK zfCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ecUYlMH4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l187-20020a6391c4000000b00544c0bf5ffesi2390992pge.606.2023.07.11.19.54.57; Tue, 11 Jul 2023 19:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ecUYlMH4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjGLCmm (ORCPT + 99 others); Tue, 11 Jul 2023 22:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbjGLCml (ORCPT ); Tue, 11 Jul 2023 22:42:41 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BE31BF1; Tue, 11 Jul 2023 19:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1689129732; x=1720665732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y8YGmAB0FJO0Fr02vL7F8m2+XfFscr3FdF3PNYJmVZ4=; b=ecUYlMH4Xbse7PPPSNI730dp4kcZDW5NHwH+In7utWdwIUZQ54dxW+Zj aePmxECJg1bJpNs/Tv5pyH5hsszk3Tq5YfG3iEsmtMFlAKxKmq89MsJIP iiIHyLTrTRHtWJafDDpbNPGexieeopz8lNZfaJ382uc/iJLNpHX75o4kW r52pRMlA+KVk2p6//fV7/srqmoTo0jqONhRgtYrFEmXcMAeaH0MTcBPYg kB/QNtVWebTHwz4c8Siz7FAGb8N8GhTkdGC8Emf9p70d55cZHTzriHNvP 31TUXiM6foUf1B/DJDkPy0fdSfQqc34BY491w+hfm/C/mvENKLKsvduKN A==; X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="223259467" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Jul 2023 19:42:03 -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.21; Tue, 11 Jul 2023 19:41:53 -0700 Received: from che-lt-i67131.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Tue, 11 Jul 2023 19:41:45 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , , CC: , , , , , , , Manikandan Muralidharan Subject: [PATCH v2 8/9] drm: atmel-hlcdc: add vertical and horizontal scaling support for XLCDC Date: Wed, 12 Jul 2023 08:10:16 +0530 Message-ID: <20230712024017.218921-9-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230712024017.218921-1-manikandan.m@microchip.com> References: <20230712024017.218921-1-manikandan.m@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update the LCDC_HEOCFG30 and LCDC_HEOCFG31 registers of XLCDC IP which supports vertical and horizontal scaling with Bilinear and Bicubic co-efficients taps for Chroma and Luma componenets of the Pixel. Signed-off-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 ++ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 4 ++++ .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 20 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index d30aec174aa2..ae3e1a813482 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -536,6 +536,8 @@ static const struct atmel_hlcdc_layer_desc atmel_xlcdc_sam9x75_layers[] = { .general_config = 12, .csc = 16, .scaler_config = 23, + .vxs_config = 30, + .hxs_config = 31, }, .clut_offset = 0x1300, }, diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index 8b05a54b5fd0..27074a4c5aec 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -198,6 +198,8 @@ * @disc_pos: discard area position register * @disc_size: discard area size register * @csc: color space conversion register + * @vxs_config: vertical scalar filter taps control register + * @hxs_config: horizontal scalar filter taps control register */ struct atmel_hlcdc_layer_cfg_layout { int xstride[ATMEL_HLCDC_LAYER_MAX_PLANES]; @@ -217,6 +219,8 @@ struct atmel_hlcdc_layer_cfg_layout { int disc_pos; int disc_size; int csc; + int vxs_config; + int hxs_config; }; /** diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 81f103b1a51f..b68075259053 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -978,6 +978,26 @@ static void xlcdc_csc_init(struct atmel_hlcdc_plane *plane, atmel_hlcdc_layer_write_cfg(&plane->layer, desc->layout.csc + 6, 0x00000007); + + if (desc->layout.vxs_config && desc->layout.hxs_config) { + /* + * Updating vxs.config and hxs.config fixes the + * Green Color Issue in SAM9X7 EGT Video Player App + */ + atmel_hlcdc_layer_write_cfg(&plane->layer, + desc->layout.vxs_config, + ATMEL_XLCDC_LAYER_VXSYCFG_ONE | + ATMEL_XLCDC_LAYER_VXSYTAP2_ENABLE | + ATMEL_XLCDC_LAYER_VXSCCFG_ONE | + ATMEL_XLCDC_LAYER_VXSCTAP2_ENABLE); + + atmel_hlcdc_layer_write_cfg(&plane->layer, + desc->layout.hxs_config, + ATMEL_XLCDC_LAYER_HXSYCFG_ONE | + ATMEL_XLCDC_LAYER_HXSYTAP2_ENABLE | + ATMEL_XLCDC_LAYER_HXSCCFG_ONE | + ATMEL_XLCDC_LAYER_HXSCTAP2_ENABLE); + } } static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane) -- 2.25.1