From nobody Fri Dec 19 11:29:20 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE2AAC7EE2C for ; Fri, 25 Aug 2023 12:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244973AbjHYM4O (ORCPT ); Fri, 25 Aug 2023 08:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245003AbjHYM4F (ORCPT ); Fri, 25 Aug 2023 08:56:05 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9344D3 for ; Fri, 25 Aug 2023 05:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1692968163; x=1724504163; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pfOwtJlDNm4JVHICwmkCdNIGUTaP42Bpvz3u5/oiEVU=; b=UJjJAq1YF3LBYzzqRKBO5msw5A0pBW7PXm1rfH0FMMoYGQdNOgCexW5s buHps6RR8IGnlCTN2rZx/m/aBD3QHgljYQWBitfmnwtYACtFDgQdPw/ra 8uWJrCBB4JnHTe1Un9+1re0I8K5TrEaZx2Tyl96SMWOU3/p4OS3vZknPx yKw+jtoGyjLWHEE3RptK5kUk003NjI4cVVNfD1LElOZU8e3EFCirFmXaR N5mclxBCPzK6I8Rowi+qXZqEdyaiCpMUsJXZKqf6BGzLrZ4o2y9E9mabo dehEDIB5i+/Syw0LxUePuYQQCSRMY9zAqzdz0kPINOy31oTxrB1iWAW8s A==; X-IronPort-AV: E=Sophos;i="6.02,195,1688454000"; d="scan'208";a="1319381" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Aug 2023 05:56:03 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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; Fri, 25 Aug 2023 05:55:36 -0700 Received: from che-lt-i67131.amer.actel.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 25 Aug 2023 05:55:30 -0700 From: Manikandan Muralidharan To: , , , , , , , , , CC: , , , , , , , Manikandan Muralidharan , Durai Manickam KR Subject: [PATCH v4 6/8] drm: atmel-hlcdc: add DPI mode support for XLCDC Date: Fri, 25 Aug 2023 18:24:42 +0530 Message-ID: <20230825125444.93222-7-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230825125444.93222-1-manikandan.m@microchip.com> References: <20230825125444.93222-1-manikandan.m@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/d= rm/atmel-hlcdc/atmel_hlcdc_crtc.c index 4b11a1de8af4..c3d0c60ba419 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; + bool dpi; }; =20 static inline struct atmel_hlcdc_crtc_state * @@ -164,6 +166,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_c= rtc *c) =20 state =3D drm_crtc_state_to_atmel_hlcdc_crtc_state(c->state); cfg =3D state->output_mode << 8; + if (is_xlcdc) + cfg |=3D state->dpi << 11; =20 if (!is_xlcdc && (adj->flags & DRM_MODE_FLAG_NVSYNC)) cfg |=3D ATMEL_HLCDC_VSPOL; @@ -176,7 +180,9 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_c= rtc *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); =20 clk_disable_unprepare(crtc->dc->hlcdc->sys_clk); @@ -366,7 +372,15 @@ static int atmel_hlcdc_crtc_select_output_mode(struct = drm_crtc_state *state) =20 hstate =3D drm_crtc_state_to_atmel_hlcdc_crtc_state(state); hstate->output_mode =3D 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 -=3D 4; + hstate->dpi =3D true; + } else { + hstate->dpi =3D false; + } + } return 0; } =20 @@ -470,7 +484,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 =3D drm_crtc_to_atmel_hlcdc_crtc(crtc); if (WARN_ON(!crtc->state)) return NULL; =20 @@ -481,6 +495,8 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc) =20 cur =3D drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state); state->output_mode =3D cur->output_mode; + if (c->dc->desc->is_xlcdc) + state->dpi =3D cur->dpi; =20 return &state->base; } --=20 2.25.1