Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp274749rdb; Mon, 29 Jan 2024 01:37:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkLhRbWiGf7IBxmvl18Ww5+hmi3s3piw3Qo3Cjdf2ZtGLGc00yJEsVnW5ZBL35I7ro+Efm X-Received: by 2002:a17:906:af91:b0:a30:e372:2c21 with SMTP id mj17-20020a170906af9100b00a30e3722c21mr3782715ejb.13.1706521077951; Mon, 29 Jan 2024 01:37:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706521077; cv=pass; d=google.com; s=arc-20160816; b=L/xd3cwzkTmnXrS1fzKTX/V/AoBuJJpuEtJdWqv8R2DxmrNxvpDjAi+embSvtQX3ea pi9bJGLShyBY1qbVL27q9nPINyMJ5EqdDrZWKmacX5Zoj9XVkdJhaAmxgl1srHmzaM7k wenramq4TFGkbTdTKWMACg5L7F3CMvo7nMj5qf14L4LjiJUbCwaCWRVyI3ZCxhN8Qgh1 +X9FDO4+g4+HtY0kklh1hex6Nu7lQnP1aal4obNse1Lqj3hlkh+hoUp7OSoY8xXHvk3v XP8qaSJLlakud+7CSSCi9ymMwcEJgzMMbbGy6tnIDcqo4Fry7WMjktojzftIBtmMm2Te +YjA== 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=uo4d5i5kS7ZEHc6bAGKAXLdv4FSdDmtoGo4tILWbXBs=; fh=xVSKzZWS4HjrbZdIm3yuuYHpCpOEqYvj45G+DN8KBj4=; b=lPWZqRgHWCrML21lhB2WGe0+Y7Fi01Y6dLe65aKDgRrb/6VYlZCAoJ7MBCvOBGnriU yOxkSdI9Tq+ILqGPGNY7mccrcAsXjLGOUk/8+GZitDY6Bwa7y1AUbyHnaf12ZPhTs0ag zEaXzf4B+0nP/+Af5z5ayvER+32AIzlBIdYF8tuB+QiZx/917sD3Ruh7T5UtVI4i8u65 oqKVmQvGOop4dq1oTjiKJE/Qm0ft6PTzSzPZyczx8VDOjkkbHaWFWMbLVCilfBaHRW0u 5CVdusQr97b5/i/fIsVhDRG5rtyN/ZaFwZkLT1qwL3uxoDp6W37WuM8GOyabhW1ZwE11 bruw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="FMsCCf/Q"; 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-42443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42443-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 s24-20020a1709060c1800b00a34e02932d6si3036126ejf.261.2024.01.29.01.37.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 01:37:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42443-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="FMsCCf/Q"; 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-42443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42443-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 3852A1F254DC for ; Mon, 29 Jan 2024 09:26:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31AFF5576D; Mon, 29 Jan 2024 09:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="FMsCCf/Q" 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 2423A55787 for ; Mon, 29 Jan 2024 09:25:21 +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=1706520325; cv=none; b=fPzt6jvVQ7BW1j+Lecl4p1mVtf3gU3F59Nd24AsWh+eFZ8J27e3m04jgndgj+vfEeYEpA0d3n1ft5BUbMP3sIANA+nMVOGRrj8tiVW9WbgTjLZUX70DaW/kM3To+0Uqrz+3TFpPDEApG2OwKB0Uqzu2sGoHgf55eF1YooE2YSl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706520325; c=relaxed/simple; bh=LW3pFUStHKEnZSyxevXGQeuoxSERTH8HcpzSlQGWuPU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=giSiG7+e3cmbF8zgLYq4b6whIHx1cxZJ1ID4QUqLyKRvNFLigqAGkGyLkbPkKNrIytza1G1ER29+T2FRHSxVCbrOjS8G2ypoqk59uAUJTDvuk0w+u9LEKPnaSNJyuesk1yLNuTETF+grec9yZdvYPlliaIAfFjRfamkT9YC6b3Y= 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=FMsCCf/Q; 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=1706520322; x=1738056322; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LW3pFUStHKEnZSyxevXGQeuoxSERTH8HcpzSlQGWuPU=; b=FMsCCf/QQAn6Oxf5rmr43LZ0QPo+NrFQhNDL5JsYIXuDIfkAQsf6Ra+u 1wTzNOAALpuvcgRarPcG1+WexF/G0EeVq4cbnkThm4w1i2gLPNXR0Wfag kzRNay9OYeA8IJwBRrM4lZDy+6IuYu9/MwVaXivbp9JGQYZnwJm7SLz4X loNrY2wV7Wlklr1yLDUDPUCi+mfalH0y8hheruPjoi+24JEFPNBNOoEQH lG6oTOzrrkqZckfUsAWlPz6SaBsvnAODpRVVoQRmdk332hFH60YseOzTu 0VUGYpS3imV1/i6kLOqtYehIXNfpDX7hzcr0K1SP7xjY6putGE5X3RJX8 A==; X-CSE-ConnectionGUID: 7jdGMqSJS4uTHBHVby00iw== X-CSE-MsgGUID: bOAtg531QyK1m/Kbf6Hzzw== X-IronPort-AV: E=Sophos;i="6.05,226,1701154800"; d="scan'208";a="15433404" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Jan 2024 02:25:19 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 29 Jan 2024 02:25:03 -0700 Received: from che-lt-i67131.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 29 Jan 2024 02:24:56 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , CC: , , , , , , , Manikandan Muralidharan , Durai Manickam KR Subject: [PATCH RESEND v7 5/7] drm: atmel-hlcdc: add DPI mode support for XLCDC Date: Mon, 29 Jan 2024 14:53:17 +0530 Message-ID: <20240129092319.199365-6-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240129092319.199365-1-manikandan.m@microchip.com> References: <20240129092319.199365-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 1ac31c0c474a..1899be2eb6a3 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,6 +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 +504,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