Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp22722pxb; Tue, 12 Apr 2022 15:41:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwOxlfCMpUM5KcLOfa8an3aHa9RRFA/sMEzHRRiee4/lhQnxoLKf7sixi2r0DKTgYFj6gw X-Received: by 2002:a17:90b:1d86:b0:1cb:9dee:a5a with SMTP id pf6-20020a17090b1d8600b001cb9dee0a5amr7468251pjb.195.1649803312913; Tue, 12 Apr 2022 15:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803312; cv=none; d=google.com; s=arc-20160816; b=FM6aLrLrJfoXTcpx6yah/Qa4Zh8RrrE6ZfgWmlWyZRnu4DfdgmRTnbZ8s8Fk7F2FAY x54r2g4ygD0CuOihI+hQxS+XS/PN5H2D8rRVETtg6xswoCyHTJm1q3tHQm153d/VyAZp TUccGyg9/LDnBcli9d685oOiEwGUwbv9iLwmajJPdwOwRg0LTCA5Iru3b5rjEoeZrj0+ q8mS3U96447lA4csaHcllnMMcAVSubevi2GiYuumFqCOfUMn4W+WR5GmQKqd5Bl2AOEG o51FA56PmBP37VyuQ/DQi4toALQA8mSeWYIWm6gP7n/X1sRsqP1fE3GutaxroJ4nAMqb emAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:mime-version :in-reply-to:references:user-agent:from:dkim-signature; bh=/jXr7871p381hezvOM6vz2wGQV6Q8hqnBtj8tP6/2+4=; b=rWQ0/YLiojBn1/hOJhvnGR0JSx0urnY2WYh8oZdKhJxI2w0KRu0kJpoxCp4lPj+DBg ZC2PAHyorN7nMQNwTHrErvHfC/KRBD9v+unYq1hjFzbOmX3Hi4cQFPWyu4ONVUDceD2a e9Mj/cG4LD73YX3HAyHE7U4/nSoZ9OJa4DMARFrghR7qyG7DiZhvAvFB2Es1lNWn8GUW 9+fTK9eSPQEFfCf8qnbl41voWURLJtbltzGxxu+apdfYSnfr7Y/N2N3XJZcvkufu2AHs kW5zAvuEzmS9stS10snxqlac6tkjZjhj2CL5zuN+4k3nnLpsPVPaf95RN+V54CrdciZt vn7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=VHPkrbWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d6-20020a170902cec600b00153b2d164ebsi12849549plg.243.2022.04.12.15.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:41:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=VHPkrbWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5C850183822; Tue, 12 Apr 2022 14:21:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344821AbiDLKuh (ORCPT + 99 others); Tue, 12 Apr 2022 06:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357519AbiDLKqF (ORCPT ); Tue, 12 Apr 2022 06:46:05 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845DDE0D1 for ; Tue, 12 Apr 2022 02:46:48 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-deb9295679so20213480fac.6 for ; Tue, 12 Apr 2022 02:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=/jXr7871p381hezvOM6vz2wGQV6Q8hqnBtj8tP6/2+4=; b=VHPkrbWcWhDRP0Ms+E2ACz/1QyUjPo0clFwBk6WOFH6mtQhSc+3trkDfS8BktiQTgk jDvBk2DZx4OiU1b/J6vb/oI4wOcMcwlUy65k6UEgzkDpk3oiVv3mJjLy6Dmka/y+y0+2 4+BMwv80HCcgjsoMfkcw6p40XjJOdZKMZRiLIR8jwRlH2b87swkcRxg3yfdEOmlwRFW+ r4D3j++ZdzxzoDaeuKzvKM1Y3mmKShpdDFb45gc7mJ6Lmh6yvJ3385iXuLs3ZIDz0LOV RY/TmrM9YPtNOp0O5QVsedwn2E9tCmYw+iJ+yXRS6CVLyDLFDUoTGtq7lkiNbATkNr5a E67Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=/jXr7871p381hezvOM6vz2wGQV6Q8hqnBtj8tP6/2+4=; b=3Q6GAPJ+HcbFl/ogAwqCamnT/Dj5J85A4ZlX/05kbJote7C3WW/vrkpI1yf3ND7ddx QWyXFUUtDohDHoR0ZqbZh1+thVXKrarndNdM2LX90XE0LZTPjaO8N3+i0QAIq2eNOYtN aVGm6OFgOkeV2Psw3onMfTthuxSFGHn7RTC/edoS1g41v0nHEQwdLwkGo14gE0ZSnkdo hd3Oqm7IejjlZZSI163AB1q2zCu3Ru5w/sqVcrW/p5KQ8ohUP9a/7+e1xmOJla6xvzET Hdr6GG/CPuPHLdTCPFb3WjomkN7EVos6RdCWku9n6/4zs+Wfg4yTxD8uKDQbSKSWPPXN OpqQ== X-Gm-Message-State: AOAM530/PVKyoKTgc6n3y178GYYfpAlFgCoR3XKPmTrxOL662oAih/xm RZyeEds3urIsw+FScty5afBnTg3t4Ex9+MLvHSsTBQ== X-Received: by 2002:a05:6870:d191:b0:dd:a91e:82dc with SMTP id a17-20020a056870d19100b000dda91e82dcmr1599775oac.248.1649756807795; Tue, 12 Apr 2022 02:46:47 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:46:47 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-19-granquet@baylibre.com> <9a31c1ce-829b-acc7-6fc1-2a9df45e5c38@collabora.com> In-Reply-To: <9a31c1ce-829b-acc7-6fc1-2a9df45e5c38@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:46:47 -0700 Message-ID: Subject: Re: [PATCH v9 18/22] drm/mediatek: Add mt8195 Embedded DisplayPort driver To: AngeloGioacchino Del Regno , vkoul@kernel.org, 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 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, 28 Mar 2022 11:14, AngeloGioacchino Del Regno wrote: >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. > This is already in my TODO list as this has been suggested by Rex earlier. >> --- >> 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! > I will update the name. What do you mean by ordering? do you expect the configs to be ordered alphabetically? >> + 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