Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp84992lqg; Thu, 29 Feb 2024 21:27:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCULPEABXAgA9DWotb8IJlwf08REncLhbA2qlu0qQLohJiCZfFfe+grGBd/dlFxz6r/BLBcc3EgaZ3sqzODBkOfR7ImnyAkm5rVIZdsQ5Q== X-Google-Smtp-Source: AGHT+IE0S1v2ilmTskU2VVjRrPxuG9BYlJSC/nwFHpAqS1vlsRTvqGTK6OceuIEsWIAo/ZtGtbjS X-Received: by 2002:a17:906:f950:b0:a44:1cb4:2e85 with SMTP id ld16-20020a170906f95000b00a441cb42e85mr462850ejb.52.1709270838641; Thu, 29 Feb 2024 21:27:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709270838; cv=pass; d=google.com; s=arc-20160816; b=qH5Pr63nbSOHX7T4FXOwTjUQb/9V5/KXXhM40asHAl27WFBK/YHsEwdjw0BrCSWccG 8e1dRMABRsk6F/82w3grOdqiWDSWBeMCK/MAypJCDM/kzFnoTqZprIja/xufoIwmdjt9 avJ2Z+KUgXVxhsl4pgrmpNZfwIfwLYfJy2YaQWwQ6ts/jDzxZNI8VfTEkcjj/fQvjDYD 3VzMQ/VMM2PXXRRCe6M1q9wdDMpTDbomXcykBbvCMuHXRefrY1OQQP+6Ii/bwJSO4JVS JvJholhWD0y8xWQAm/sLLLAlykl4U69pf14pe9ZR2T/CQxbhZGMzIZfYPbEqaaBKoD2Q OqHg== 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=7LlwrKsimiND7hPCZs/yKkmKi2XUc8gnfHs3RVyzKvk=; b=Wm8izmjq+KWmD0/OlZnXkFq4qPJqwePZArTURYFUmpJEeVhZYpUqYXf8pGD3TSjvHX vYJAOrR3J2T8Og5zoqF5c4CNp7Le44qVp9tnXdvOENTCmOrjZmrTsa1Vl4tBpvT7RfE/ NWa4WshadA+3rGb/die186u+uk/RR3wFXJ1ylK+IMMlTmuptZ8mHLug32bjWBWZAcleU pMoQ5Upvrdmm4yEtAhTH1bGtaAdLdviURD+P3IvDwtBmdVreVD+FQabXeu1GIsY1eFj0 uAAwfZuxdQyVJ1IeUL/Bw/nTCYqaRaDIAq3vzCZsJuhRBLYBEo3O42twwEVm7qGAUrAo 1GDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Z76FPPSK; 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-87919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z27-20020a170906715b00b00a44790cfd57si435415ejj.314.2024.02.29.21.27.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 21:27:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Z76FPPSK; 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-87919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87919-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AF1551F25B6E for ; Fri, 1 Mar 2024 05:27:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3723C535AA; Fri, 1 Mar 2024 05:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Z76FPPSK" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 92EDE52F8A for ; Fri, 1 Mar 2024 05:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709270803; cv=none; b=L5T+tN9GSztiRRezLkiGp+ajJ3l2+sUtjk7DN50lc5y6kq/zHTLQKVTa92b35x63It+9EwmpUK1rNnI28hGtnM+2h24gy3Zia2XOQS1SvWEl7BuB3Yc18aQW5jM2OjKer/S8ktg/OOUIC8Pumu+DwSb9n5yGFu4PnDCFTTQzmAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709270803; c=relaxed/simple; bh=cf1ERUI8W0KgkYZjZBGlnJlrKnBS1Q66fpRRN2HpQMY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=emj8eZfZbMEt6/4/OSOpsmcfeK2H5K7sPvnyTboCmn2Zz1Edeaw83gI9XwksgNh+8X9SXVNnxOMpznZfBtfUJAjhWJpg7lp1p63s3YRzOOd+YwNS/IH70g2IVYCgMKDrw8dZ9ALKdRpcmOUAZtC1Jzkl4z0eUEHGsA0xp1aCyJE= 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=Z76FPPSK; arc=none smtp.client-ip=68.232.153.233 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=1709270801; x=1740806801; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cf1ERUI8W0KgkYZjZBGlnJlrKnBS1Q66fpRRN2HpQMY=; b=Z76FPPSK8OIEuFALIiY1yGogGy8We2Cn4fB3jV/AqqZsvINHTSreyynJ dYQABek295sv1rO9U/D8XBjKJ1ERn8jLMpprANCOqfDwYbadRP89bEktP 3Yv2KC6pn1CXKqJ9c+2sYmyjuswDMX/+hceVK6ii+syRAsGKGgon5R0bC +3vI0ZyP69G4l8hBcW3b0ymwY73z5IiNKloulLS4+nIazuVFm1c4ZIsuG B5NoUuU8FKyxKQOVb3J41lPiUsdSqIcgHbXfSySCemVbPE0hY/EtT3fSn QIR/B17RAhDYrFWg1+eUyUtCKB5A92wu1qaZ6BZ9uPHIFj1PiYj+bC0jA g==; X-CSE-ConnectionGUID: NiYMRsuYQMSobLMasNu+DA== X-CSE-MsgGUID: suMdi/RQTVKuzaHjFPpCjg== X-IronPort-AV: E=Sophos;i="6.06,195,1705388400"; d="scan'208";a="17055836" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Feb 2024 22:26:40 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 29 Feb 2024 22:26:37 -0700 Received: from che-lt-i67131.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 29 Feb 2024 22:26:29 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , CC: , , , , , , , , "Manikandan Muralidharan" , Durai Manickam KR Subject: [PATCH v9 5/8] drm: atmel-hlcdc: add DPI mode support for XLCDC Date: Fri, 1 Mar 2024 10:55:31 +0530 Message-ID: <20240301052534.38651-6-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240301052534.38651-1-manikandan.m@microchip.com> References: <20240301052534.38651-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