Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4581739rdb; Fri, 15 Sep 2023 06:39:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgYQdz74D4YCY3KS28ph806t/KaDpRcKrHz8feb21xxPN3SLVITsgmnsXVQ0mH+jQBLu02 X-Received: by 2002:a05:6a00:1a56:b0:68b:bf33:2957 with SMTP id h22-20020a056a001a5600b0068bbf332957mr1753992pfv.22.1694785190825; Fri, 15 Sep 2023 06:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694785190; cv=none; d=google.com; s=arc-20160816; b=ZUyUP+3qnrpnaxL4bepe39fb7QWIuq66DLneTnMzBMI53lwKY0jmqCAaq+l+I0xe3a FJaDgILoGbCMTR9bfiNv/72oN1QWOl6IQDe24NIwirEYICR4JC/IcnloYG0w/OOW3E2q Sazuf6KLcuYd/KSLP/QgHsjBHdICxEvFFBh5OYbbXSc2+dIuGbf/Iyv80/d1CcUJqBuD hq+YKcygeEXm902uoSddchrBe9XUMRuLYo2zeJEd3lIXHzemG96vLWiPLoYi5pn5gcIG h3H09i1ZcAxK+OwUXV4kBqgCeLgmVgKvwv5emrXUzT9wwrDsKuGhpIHtkl6N1YX3Zy89 rkvg== 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=9KUc+6ymUSUjtZg+4AVIgLE8jizr/Lc15cnbFom0UzE=; fh=PkSfmz4EGMtZc1CR6Uqmenc/iph/THm1cYvoWvZp3B0=; b=R2Zs35mfX+hxM654LeR9oCeI3xYZdDXey9Tc9418fR8rH5uFeM3F2yh0ochBz/FyCM c8oAYFkxicHtGglJyd5GzbpqG8SGodzZU2qpgOx2Cj0FdCsr2lT1/i0S+KEgX8MHzWb3 5os2kQ27hgE0Gy/kYUzJFXP1xqIhWGEsKBABIjxKF8gYgXF6A2RNH/9t4a9A8ucAtNY1 qTFH6/a3+l5dn8wriEdsm0c3njIDV/2g5ZZmfhpeKMnpk/quqJP3ih5Sac2QwsxvlzHl trurxG4m34ig78/mK1KxOBpGe5jddtZ74SqafAIrIGOjOMB0M+sOJli0xUpVEcVzeg2U ipZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="d3lm/PF1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b9-20020a056a000cc900b0068e35d412c9si3471059pfv.323.2023.09.15.06.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 06:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="d3lm/PF1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id DAFE580C2541; Fri, 15 Sep 2023 03:50:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233823AbjIOKuR (ORCPT + 99 others); Fri, 15 Sep 2023 06:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233818AbjIOKuN (ORCPT ); Fri, 15 Sep 2023 06:50:13 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59167199 for ; Fri, 15 Sep 2023 03:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1694774993; x=1726310993; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0FUyVGKMoKgnt/NystUFULo3wj6NcAiGUpvXlXffuHE=; b=d3lm/PF1bFT/d7cBMSLab6nnNcXxMabea1JxzXYed4INGaF0Q39p/2k+ 5pD2J9Jb073Ly4fyO7scIVvSAK6yGOCFwqjcxNpmH07kj52YUJNgW0MAX zJLs0Kd9eZeD3C/eARcyjwwW7Coru8NH4poXDlgnPb8LbMrsjRDMncQFA XNAZAV6UkK/5/mj8DZnRTxSf4x2P8YnuH5/Jw9yLCMESCJWdCzbl/hFUG 6PN8VNFZJwJTKlr/4CR3VT2ExgZzeioRLr4gDrc3GCsYM2WICkDOnngGW Voh9oi40GDaXUqe7YF2uVGg65gToL8a94cqnEKm88ikA/5iOBJTwnPsFX A==; X-CSE-ConnectionGUID: 73qnCoHmSNKYnTQ8TG6wWw== X-CSE-MsgGUID: NpuFRHewR6OYFIb9rldSpA== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="235382764" 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:53 -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:33 -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:26 -0700 From: Manikandan Muralidharan To: , , , , , , , , , CC: , , , , , , , Manikandan Muralidharan , Durai Manickam KR Subject: [PATCH v5 6/8] drm: atmel-hlcdc: add DPI mode support for XLCDC Date: Fri, 15 Sep 2023 16:18:47 +0530 Message-ID: <20230915104849.187146-7-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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:50:42 -0700 (PDT) Add support for Display Pixel Interface (DPI) Compatible Mode support in atmel-hlcdc driver for XLCDC IP along with legacy pixel mapping.DPI mode BIT is configured in LCDC_CFG5 register. Signed-off-by: Manikandan Muralidharan [durai.manickamkr@microchip.com: update DPI mode bit using is_xlcdc flag] Signed-off-by: Durai Manickam KR --- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 1ac31c0c474a..b0051ec02f7f 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -30,10 +30,12 @@ * * @base: base CRTC state * @output_mode: RGBXXX output mode + * @dpi: output DPI mode */ struct atmel_hlcdc_crtc_state { struct drm_crtc_state base; unsigned int output_mode; + u8 dpi; }; static inline struct atmel_hlcdc_crtc_state * @@ -164,6 +166,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c) state = drm_crtc_state_to_atmel_hlcdc_crtc_state(c->state); cfg = state->output_mode << 8; + if (is_xlcdc) + cfg |= state->dpi << 11; if (!is_xlcdc && (adj->flags & DRM_MODE_FLAG_NVSYNC)) cfg |= ATMEL_HLCDC_VSPOL; @@ -176,7 +180,9 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c) ATMEL_HLCDC_VSPDLYS | ATMEL_HLCDC_VSPDLYE | ATMEL_HLCDC_DISPPOL | ATMEL_HLCDC_DISPDLY | ATMEL_HLCDC_VSPSU | ATMEL_HLCDC_VSPHO | - ATMEL_HLCDC_GUARDTIME_MASK | ATMEL_HLCDC_MODE_MASK, + ATMEL_HLCDC_GUARDTIME_MASK | + (is_xlcdc ? ATMEL_XLCDC_MODE_MASK | + ATMEL_XLCDC_DPI : ATMEL_HLCDC_MODE_MASK), cfg); clk_disable_unprepare(crtc->dc->hlcdc->sys_clk); @@ -374,7 +380,15 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state) hstate = drm_crtc_state_to_atmel_hlcdc_crtc_state(state); hstate->output_mode = fls(output_fmts) - 1; - + if (crtc->dc->desc->is_xlcdc) { + /* check if MIPI DPI bit needs to be set */ + if (fls(output_fmts) > 3) { + hstate->output_mode -= 4; + hstate->dpi = 1; + } else { + hstate->dpi = 0; + } + } return 0; } @@ -478,7 +492,7 @@ static struct drm_crtc_state * atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) { struct atmel_hlcdc_crtc_state *state, *cur; - + struct atmel_hlcdc_crtc *c = drm_crtc_to_atmel_hlcdc_crtc(crtc); if (WARN_ON(!crtc->state)) return NULL; @@ -489,6 +503,8 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); state->output_mode = cur->output_mode; + if (c->dc->desc->is_xlcdc) + state->dpi = cur->dpi; return &state->base; } -- 2.25.1