Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2166318rdb; Tue, 20 Feb 2024 21:36:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUymQHY6lABiJJSX2dJpuLk3eVsKejrZ03pEFyb5CFSsVxL/bKeCwIkXQSPlK/5rbjivYGEIeTgIeu/nKRPmLIuJAB6zQfEOIdOtwl53A== X-Google-Smtp-Source: AGHT+IEa8tKbk7cYTlOWOJGfUjkZW/S0YsTnmAxiA1jSImdUbjaQGvOKDE+Z2K017e/+AM5V1vB7 X-Received: by 2002:a05:622a:1653:b0:42d:a920:e046 with SMTP id y19-20020a05622a165300b0042da920e046mr21659887qtj.52.1708493806776; Tue, 20 Feb 2024 21:36:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708493806; cv=pass; d=google.com; s=arc-20160816; b=bAyYusV8ZFpUKEwwMnLhbq3OfB9vTXYbYFU3L7JzyViuJpFgWJST1y3SfrQDnRiFzB nZ2wbAcz8GMlEltGPm315kbiA5aOcbmDhnd+kWt0qwjC7yUw2NqfnDqZNOrkDD9kvIKw UaXzrF4KpLk7szxxkmt9nHZABOV9KaZE6KIMfKjTulMZ5DTiS3pdTtepVaGrr4usMy6X a0aBEci+EmUzAezU6yTQ/fmTJlxg1S66sdFIEAn/vSQzDM7LvV5dwozoJSYbE4Vv2tix ZomaDDEnb02zs2x8YazlNe32H8ECgteXU/BWu94P66Mi1oBTcy7GwD74iV9w+H+BWZZ+ OU7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7xDrTPtxQps5HuSmCDVQr7PQdVAlZ4Y45ujnCRsPeMM=; fh=UhijDlGz4WYNx2y13BRHEKP9mVAyr2sRDgQuYnzbmVc=; b=oyjkNEEJ1xd1kPSdwj5/Y05X3PNIztWhSz899y5OGeo50rnDHfpn6ouGiT3cLSBkOP P3kjuR4rAX1juYW0Lfhl609eyc4BiWxL+ZF/EMk/5JkC1GqOQFb1UQObOcTG2rianX8c PqaY32KXXh+OWqpejFvngWu7kgIkLKXb6Pi7Jcv6LJWJinHomkgqAccxicaSYhux6rZw Zecmqe9ZzMxwgxcH/68nC4ctd+xZkYGW8c9RgC5h/aw9Umejg1WpEehnPl/eDSMbBFAw iPPT9cW1ZvYBouoQK1GhZ04rJDAuJxBMIMkvV9YVwkHTyem2rU0fX4tECLJIidPesIyV +wlw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="wRjOH/ie"; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-74084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d26-20020ac851da000000b0042c644c36a9si10091231qtn.52.2024.02.20.21.36.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="wRjOH/ie"; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-74084-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 811981C20A5A for ; Wed, 21 Feb 2024 05:36:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0801739FF2; Wed, 21 Feb 2024 05:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="wRjOH/ie" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D14839AF1 for ; Wed, 21 Feb 2024 05:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708493790; cv=none; b=NI6ix2upPps9M4mOHlVSQwockWad0Vu3lWxVVV2hLakdGPeLKdgIgCRS1+h7dcgcq7CAAxWGdwYy2M+IbjzxslG/THCZCOpqZmWOl382Q4DAO/iklFZ+XbcXGoS+6CO3jqftOv9xm+Sbm6tgD/c/fOi8/jHd96HRLUUMWuGdw3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708493790; c=relaxed/simple; bh=cf1ERUI8W0KgkYZjZBGlnJlrKnBS1Q66fpRRN2HpQMY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=owGQO+LxYItlDgFobXb2kshb2FB6qHKw6NSaVyE58s3vPtiy0J4E8+m3nFdOUTnN1O2sY9kV+TQxsQZHNnDhf0drm4WeMU5K4LMUGjK+e42NGrq9CXEgrWCD2HhkkIwW7AT3D1vcsGkoA2sEbtsXnIaH/vEC8CQhVyK9YglPVeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=wRjOH/ie; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1708493788; x=1740029788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cf1ERUI8W0KgkYZjZBGlnJlrKnBS1Q66fpRRN2HpQMY=; b=wRjOH/ieqHFO+in/Si+gx/5rbDgRWidbTFuys19R6slXIovlVZJl1O5O 6SbBSGMaXU+nadlhL0MUN27EQi7B+f0rzz01POQYrxnH1Qjh2xKju9FM0 iaOsuIuAx0OvAOm3JwourGrxqP1T2iRbN/+nF8Hf7envZYxMfY5qbT61T +/HWIMK5oxyl67VjZXWXlkrISs7ysUQ6/DiOejFQKKYGOXAi9t8oquFgL /ibh4e3KI2CN/yrnHGclKcdU8FivCazwaUgVb64rURCmuuWHXH6ac8A+S KAtNlkW6pT7mufbZD+H5chDy8zLvDDgaJAJLSSEJKrkMh4mrHM80rjQZr Q==; X-CSE-ConnectionGUID: hHmStJYWTlGjipB6P76eDg== X-CSE-MsgGUID: MU072H37SamG08299npIXg== X-IronPort-AV: E=Sophos;i="6.06,174,1705388400"; d="scan'208";a="183844452" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 20 Feb 2024 22:36:25 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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.35; Tue, 20 Feb 2024 22:36:18 -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.35 via Frontend Transport; Tue, 20 Feb 2024 22:36:09 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , CC: , , , , , , , , , Durai Manickam KR Subject: [PATCH v8 4/7] drm: atmel-hlcdc: add DPI mode support for XLCDC Date: Wed, 21 Feb 2024 11:05:28 +0530 Message-ID: <20240221053531.12701-5-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221053531.12701-1-manikandan.m@microchip.com> References: <20240221053531.12701-1-manikandan.m@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 98a98b5fca85..fdd3a6bc0f79 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 * @@ -170,6 +172,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c) if (adj->flags & DRM_MODE_FLAG_NHSYNC) cfg |= ATMEL_HLCDC_HSPOL; + } else { + cfg |= state->dpi << 11; } regmap_update_bits(regmap, ATMEL_HLCDC_CFG(5), @@ -177,7 +181,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 | + (crtc->dc->desc->is_xlcdc ? ATMEL_XLCDC_MODE_MASK | + ATMEL_XLCDC_DPI : ATMEL_HLCDC_MODE_MASK), cfg); clk_disable_unprepare(crtc->dc->hlcdc->sys_clk); @@ -380,7 +386,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; } @@ -484,6 +498,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; @@ -495,6 +510,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