Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5173410pxb; Mon, 28 Mar 2022 08:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzVZnaS33qnZebjuTGLfKERMBQ1xYw6Sl4W2T5eTtwKuQPMz13bNy9NZZzQ60KaQ+jHUtd X-Received: by 2002:a17:90a:8a05:b0:1c6:e527:c613 with SMTP id w5-20020a17090a8a0500b001c6e527c613mr29717547pjn.143.1648483095243; Mon, 28 Mar 2022 08:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648483095; cv=none; d=google.com; s=arc-20160816; b=yN30hv1l+NBOF1A/h63XQRHbB5tliSO0676BLTp2+9EX6OLurg0wavLRPyF1GK7YGN uG3b8X30P2AVd8VRNFNvG3q77+mjDLw0e/ppjciksy05IeDcN51SYlcvE+v7yV3HyXGA 9o54bjVetNxDE/AKlv+xtGs1/jmJ4B6ARo1Ov2pO7bpVvkb+Zs53RGchYV53d9elkQqS i3OXH06F6jydAgAzfM1Xsuvpfn2ybq1XnJjmAVIc94WU766G+undGio/hIxC4Q9MpvWA RJV1mBpCLbEjMXzK/wiEcoIWEKma30ptYgfYvKGPU6/52w8N/W02qqq9YJTa60A16t9W 62rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z+/BPrRDVW5L20Aev1DQqgMWfXrRAnl7v0tDc3XeVvY=; b=gmQ+ZFc/CM5strkGtgUFO8TQDY5DU00bfzfuscxROHzraJJcHVIMU/fJZsMDt65OY+ dB4+6vA0i5Bf1qpUhFOtpXJuIuYzWsIc59t5xTqPipCP/ti5ACRSBucDuLI3Gkv7H3+o y8Ve1mFOC/VGwYi2ZzQkWC2St+kjjlTTYl6KuqI3tle59+UAfWbJNDI8IbZf//Etoh+C mGzt4de2WhDCeMiGFucmrKkSJ3JhG7i1JYt3SAEsQF+vb8XLPRyf1alyOeczfVXYAtI7 /KnTri53hh11zmunmXGzwT5XIE03o36lotBwEvVLHgvWfFOYwcEtadP1xy9TOyXWS+di pG5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TJds3WmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a63f64f000000b0038201b8ba7esi13447711pgj.35.2022.03.28.08.58.01; Mon, 28 Mar 2022 08:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TJds3WmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239716AbiC1JQO (ORCPT + 99 others); Mon, 28 Mar 2022 05:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbiC1JQM (ORCPT ); Mon, 28 Mar 2022 05:16:12 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 218E340917; Mon, 28 Mar 2022 02:14:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id DBFB11F4328A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648458869; bh=ahA27kmJ3/0WZXPVbldbye3TiUylyzwKPGXwMcmHFAs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TJds3WmRY9+pdPdsC0AVCpwkff0g0H79YNhu0JFtNAT7Hm9UF3J9ggsRPAJkhKNv5 wwfa8cHgZr0NJzPxa8xGL88LU/QcH6NmXRnVME5f3kpZpyNnWt2PsZyf/5Iu0KOAbg DrvCuQ0lrmc0/2lrTE19P+fj2+0drCTKZGPtoPSzclHSxQmN0ydMPMTmaQVzF9cAKo q+TVIXm3OS9MflF2v9RPBl3WoXrCra2epc3cq8CclJl1l6mPfj0rMEYEMzULnD2EjU b6/nYsWO/hr5zb1hGBwUCbxPW7mM3NzrdgkN/bXoebbNw2xdNgdiJNQ+70wc0pBSNj 4LgxFsNzrAcdA== Message-ID: <9a31c1ce-829b-acc7-6fc1-2a9df45e5c38@collabora.com> Date: Mon, 28 Mar 2022 11:14:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v9 18/22] drm/mediatek: Add mt8195 Embedded DisplayPort driver Content-Language: en-US To: Guillaume Ranquet , airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de, vkoul@kernel.org Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann , kernel test robot References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-19-granquet@baylibre.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220327223927.20848-19-granquet@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 28/03/22 00:39, Guillaume Ranquet ha scritto: > From: Markus Schneider-Pargmann > > This patch adds a DisplayPort driver for the Mediatek mt8195 SoC. > > It supports the mt8195, the embedded DisplayPort units. It offers > DisplayPort 1.4 with up to 4 lanes. > > The driver shares its iomap range with the mtk-dp-phy driver using > the regmap/syscon facility. > > This driver is based on an initial version by > Jason-JH.Lin . > > Signed-off-by: Markus Schneider-Pargmann > Signed-off-by: Guillaume Ranquet > Reported-by: kernel test robot Hello Guillaume, as you know, there's some more work to do on this driver. I will also mention here, not on the code, that at this point, your mtk_dp_aux_transfer() function has something VERY similar to function drm_dp_dpcd_access(), so I really believe that you can instead use functions drm_dp_dpcd_read() and drm_dp_dpcd_write(), avoiding code duplication around. Please check drivers/gpu/drm/dp/drm_dp.c. > --- > drivers/gpu/drm/mediatek/Kconfig | 8 + > drivers/gpu/drm/mediatek/Makefile | 2 + > drivers/gpu/drm/mediatek/mtk_dp.c | 2221 ++++++++++++++++++++++++ > drivers/gpu/drm/mediatek/mtk_dp_reg.h | 568 ++++++ > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + > 6 files changed, 2801 insertions(+) > create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c > create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h > > diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig > index 2976d21e9a34..03ffa9b896c3 100644 > --- a/drivers/gpu/drm/mediatek/Kconfig > +++ b/drivers/gpu/drm/mediatek/Kconfig > @@ -28,3 +28,11 @@ config DRM_MEDIATEK_HDMI > select PHY_MTK_HDMI > help > DRM/KMS HDMI driver for Mediatek SoCs > + > +config MTK_DPTX_SUPPORT Actually, I think that the best would be DRM_MEDIATEK_DP_TX or DRM_MEDIATEK_DP... ...also, ordering is important, please! > + tristate "DRM DPTX Support for Mediatek SoCs" > + depends on DRM_MEDIATEK > + select PHY_MTK_DP > + select DRM_DP_HELPER > + help > + DRM/KMS Display Port driver for Mediatek SoCs. > diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile > index 29098d7c8307..d86a6406055e 100644 > --- a/drivers/gpu/drm/mediatek/Makefile > +++ b/drivers/gpu/drm/mediatek/Makefile > @@ -21,3 +21,5 @@ mediatek-drm-hdmi-objs := mtk_cec.o \ > mtk_hdmi_ddc.o > > obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o > + > +obj-$(CONFIG_MTK_DPTX_SUPPORT) += mtk_dp.o > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c > new file mode 100644 > index 000000000000..7cd8459cf719 > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -0,0 +1,2221 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019 MediaTek Inc. > + * Copyright (c) 2021 BayLibre > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include