Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C51FDC433F5 for ; Thu, 25 Nov 2021 15:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345632AbhKYPcv (ORCPT ); Thu, 25 Nov 2021 10:32:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:56446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356055AbhKYPbL (ORCPT ); Thu, 25 Nov 2021 10:31:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8763F6112E for ; Thu, 25 Nov 2021 15:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637854079; bh=lkBTAYnePntmqvSbc15XoIItvFlZfl3Dj4ft7yKLNyA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=e1p6kf765Tz8giU6qai9lWHGYrFrJ760sQUTy5riIpvw5bVrNCEi6pd1/It4veRx6 MKtv3BKGgaqRkjmW0028TjkMvaBnyLaxedUZ33QXGVW04xpxvoyewh646UEU3I5Hnl pNpxlu7cTos1xeBYfArOEFhMcSm9RHvikZvqseTOF6BB8+/ajJpzlOOwvcaGS5R1im 1fR1mF0mNN9T9u1tnFPHKI4nYf/qcCNjLl9dTbtJB2Cc5tiISZlsg7vMJLdCdyFhnV XYGFl8EAG3DMAplhavI3Gt9fWbU2gO3CUUyqA8rKWdr4HkRHDnxGUgLvJ7akmVj9Fs iDt42L/wOejJA== Received: by mail-ed1-f43.google.com with SMTP id t5so27407060edd.0 for ; Thu, 25 Nov 2021 07:27:59 -0800 (PST) X-Gm-Message-State: AOAM533eDhOiYWe2qvA3xwUXwL8GKxDTZZ9Aeb/mleh+BCcwJhFwDCNG D7/ZmQfHm3PfhCRjGHMgBMIiPaHYN+qIU+w1eg== X-Google-Smtp-Source: ABdhPJxRnlTDMwjJTMbyVeiHvdVNzK7qHTegpzwQltBzxE62BB5fs9kpvgp3ICfrGp9FCSNqzG5hKMsbvXGW6tr1dZk= X-Received: by 2002:a17:907:9612:: with SMTP id gb18mr32236041ejc.205.1637854077691; Thu, 25 Nov 2021 07:27:57 -0800 (PST) MIME-Version: 1.0 References: <20211110130623.20553-1-granquet@baylibre.com> <20211110130623.20553-8-granquet@baylibre.com> In-Reply-To: <20211110130623.20553-8-granquet@baylibre.com> From: Chun-Kuang Hu Date: Thu, 25 Nov 2021 23:27:45 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 7/7] drm/mediatek: Add mt8195 DisplayPort driver To: Guillaume Ranquet Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , Markus Schneider-Pargmann , kernel test robot , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Guillaume: This is a big patch, so I give some comment first. Guillaume Ranquet =E6=96=BC 2021=E5=B9=B411=E6=9C= =8810=E6=97=A5 =E9=80=B1=E4=B8=89 =E4=B8=8B=E5=8D=889:06=E5=AF=AB=E9=81=93= =EF=BC=9A > > From: Markus Schneider-Pargmann > > This patch adds a DisplayPort driver for the Mediatek mt8195 SoC and a > according phy driver mediatek-dp-phy. > > It supports both functional units on the mt8195, the embedded > DisplayPort as well as the external DisplayPort units. It offers > hot-plug-detection, audio up to 8 channels, and DisplayPort 1.4 with up > to 4 lanes. > > The driver creates a child device for the phy. The child device will > never exist without the parent being active. As they are sharing a > register range, the parent passes a regmap pointer to the child so that > both can work with the same register range. The phy driver sets device > data that is read by the parent to get the phy device that can be used > to control the phy properties. > > 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 > --- > drivers/gpu/drm/drm_edid.c | 2 +- Separate this to another patch. > drivers/gpu/drm/mediatek/Kconfig | 7 + > drivers/gpu/drm/mediatek/Makefile | 2 + > drivers/gpu/drm/mediatek/mtk_dp.c | 3094 +++++++++++++++++++++++ > drivers/gpu/drm/mediatek/mtk_dp_reg.h | 568 +++++ > drivers/gpu/drm/mediatek/mtk_dpi.c | 111 +- Ditto. > drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 26 + Ditto. > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + Ditto > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + Ditto > 9 files changed, 3799 insertions(+), 13 deletions(-) > 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/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index 500279a82167a..bfd98b50ceb5b 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -5183,7 +5183,7 @@ static void drm_parse_hdmi_deep_color_info(struct d= rm_connector *connector, > * modes and forbids YCRCB422 support for all video modes per > * HDMI 1.3 spec. > */ > - info->color_formats =3D DRM_COLOR_FORMAT_RGB444; > + info->color_formats |=3D DRM_COLOR_FORMAT_RGB444; > > /* YCRCB444 is optional according to spec. */ > if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) { > diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/= Kconfig > index 2976d21e9a34a..029b94c716131 100644 > --- a/drivers/gpu/drm/mediatek/Kconfig > +++ b/drivers/gpu/drm/mediatek/Kconfig > @@ -28,3 +28,10 @@ config DRM_MEDIATEK_HDMI > select PHY_MTK_HDMI > help > DRM/KMS HDMI driver for Mediatek SoCs > + > +config MTK_DPTX_SUPPORT > + tristate "DRM DPTX Support for Mediatek SoCs" > + depends on DRM_MEDIATEK > + select PHY_MTK_DP > + help > + DRM/KMS Display Port driver for Mediatek SoCs. > diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek= /Makefile > index 29098d7c8307c..d86a6406055e6 100644 > --- a/drivers/gpu/drm/mediatek/Makefile > +++ b/drivers/gpu/drm/mediatek/Makefile > @@ -21,3 +21,5 @@ mediatek-drm-hdmi-objs :=3D mtk_cec.o \ > mtk_hdmi_ddc.o > > obj-$(CONFIG_DRM_MEDIATEK_HDMI) +=3D mediatek-drm-hdmi.o > + > +obj-$(CONFIG_MTK_DPTX_SUPPORT) +=3D 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 0000000000000..83087219d5a5e > --- /dev/null > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -0,0 +1,3094 @@ > +// 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