Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4766981rdb; Fri, 15 Sep 2023 11:32:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJz3EkjVoOdTGom0/gIAunwKerMRbnLMCi37iQ4Yl99XrT1+z2a4fJBDPAwgZ/C26B+nv2 X-Received: by 2002:a05:6a20:5b13:b0:13f:67b6:b65f with SMTP id kl19-20020a056a205b1300b0013f67b6b65fmr2220583pzb.54.1694802761972; Fri, 15 Sep 2023 11:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694802761; cv=none; d=google.com; s=arc-20160816; b=IHUSVwWPG28s9Ew2ivSCLcXgacxvl0lWtZCnGY1x+yEE5YEeoFf0PaFZR9L5/jrk9I PCYuCe1vTFRUsebuSLNxYJOzqBaFOv45VeMi1+LK2VSWYe9PPk/6ZZTi2HDg9tin4/T2 +Ig9BRsZG5A1M2YGDrlv8UqztV7Au194eJY1rAaCrN0ut6MwY90qWn40jiy+SCBJFpdP 2XGmJg8j0ABGvmvu9fjkasJTsrqySXxYjz0OvE5QKpSNQxu47fjPoPfIcVsX1tTZxRR5 TZO/rUR5aQwI17hAxP3tLdGaO5IwqwwHddjty4rZ3GhOQnLtybweug2MaJgYdR0OW3Al ys0g== 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=dQLAlZZ9CV1yrWMWe6Df8ZYkJ+CsZ1dMYWrW+VcdQVs=; fh=ComlYb+yrr7pTh3oI7q7RcW5EOVriLArPZlioEeQVts=; b=cqxxWWr6DZZ97rIVh9n9lrPdbIjIyz/+A4sHbInZIL14v27iZA5t2Vl0pNi9iJh55y zb6Vg7JT3BjzG96DPOOa+P6JGPsv2N8AMZbwB+tXnjhH9GBaKCE03sOYWTyQ+3u981Aa eCmcY7en0TLQ8DPotqGnber0eoHbHA2jBKeslJj4p4VwM7NBnwow14uUKiONE8Knq4I5 LgESxK+HEihRr/b84zmqn43ttLlTEcHdJmCc5YxSe1DckkDLI/DOnQhgwVWDSh2pqD1N bHJWG0udszFsAhP9nYgLevMVCBVQxsCu49/PjodsHHU4Mzi4T0B0GXtmpSb1A/uoU5HB gPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=aV0w1Igq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id w14-20020a63b74e000000b005775a3ebf0asi3582442pgt.67.2023.09.15.11.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 11:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=aV0w1Igq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3B58A8021388; Fri, 15 Sep 2023 03:50:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233984AbjIOKuV (ORCPT + 99 others); Fri, 15 Sep 2023 06:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233694AbjIOKuO (ORCPT ); Fri, 15 Sep 2023 06:50:14 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CBC1AB for ; Fri, 15 Sep 2023 03:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1694774995; x=1726310995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gwNUZzskm8pJatJV2WBGsMRZj3Adom1Td2VOkZ75+AA=; b=aV0w1IgqPGnKEy7bwcZQQnNjEzyUocsCRdE53t+rCYrxXZxrgG8JHsWp ujhcQIaeem79JKFaYSx75iMNEemUktVXH8Mb+A+hfZHmYcAzAhSSKC7ay q0H8efNz53dMkwZB+9O8KY2ocDRgBv6Q3GKYh42Lh3OAVYze2Uo7Pud0G zTL7pBqOeQrbwWAQPuQmUkLTMo+Qk5KayZ+KIRrCNerePw5lCNmJ5h9E/ aw04eZSUiFOJdz2A53fi7rzFNGR5AZr6WbRQU4jUsL7UobmewSzQbYyAY M1gkjcO7YK6SIMTUpV3E3lIddrLH6N95OkUDMnv4bxPXbbaNtCKBaCAEU A==; X-CSE-ConnectionGUID: 73qnCoHmSNKYnTQ8TG6wWw== X-CSE-MsgGUID: /SjZ6rSRQ4263A7ckZH+NQ== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="235382778" 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/ECDHE-RSA-AES128-GCM-SHA256; 15 Sep 2023 03:49:54 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 15 Sep 2023 03:49:40 -0700 Received: from che-lt-i67131.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 15 Sep 2023 03:49:33 -0700 From: Manikandan Muralidharan To: , , , , , , , , , CC: , , , , , , , Manikandan Muralidharan Subject: [PATCH v5 7/8] drm: atmel-hlcdc: add vertical and horizontal scaling support for XLCDC Date: Fri, 15 Sep 2023 16:18:48 +0530 Message-ID: <20230915104849.187146-8-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230915104849.187146-1-manikandan.m@microchip.com> References: <20230915104849.187146-1-manikandan.m@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:50:27 -0700 (PDT) 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 7702c2f16178..2e1b79a38ac7 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -561,6 +561,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 9965c7cc5bf8..aad907ccb65a 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; }; struct atmel_hlcdc_plane_state; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index e2a5bed86fdb..070a377ad3b8 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -958,6 +958,26 @@ void xlcdc_csc_init(struct atmel_hlcdc_plane *plane, desc->layout.csc + i, xlcdc_csc_coeffs[i]); } + + 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