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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34943C433F5 for ; Mon, 15 Nov 2021 14:37:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0918060F51 for ; Mon, 15 Nov 2021 14:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236562AbhKOOkK (ORCPT ); Mon, 15 Nov 2021 09:40:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236882AbhKOOhL (ORCPT ); Mon, 15 Nov 2021 09:37:11 -0500 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 988C6C061225 for ; Mon, 15 Nov 2021 06:33:54 -0800 (PST) Received: by mail-oi1-x22f.google.com with SMTP id bk14so35194497oib.7 for ; Mon, 15 Nov 2021 06:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=aEBOwuxUA2V1ZGAJh2mOnLf//Ja1gm673Jt7jSd+fvY=; b=fLYqYS7j94l3z+0/8J7ChS5MGV59i71eJL6zm+GUQtDy81wSZDrjbUeKvykRvvPv8K 7ZF6YM/aFvE6tkt3oA9aHacyWAe1teHZT/DHLiOpTpYDrz9Elj9vukFwTn3h/d8c6+Wd hNtRS5Cqga3cgI3kqoJ3sjnfjClqjPfjVic2qde+Af+rDjYsBgcDl+SsvnoA8jyI0N7l C8lplyTJgfHFjxxbEmkhZ8inNqmNGRy2+DDOcWjMX4eDZo+T7tfRBh79mtLukGMFHsFQ zumIfVlqqhNQ9E5YYDUkFAo2MNQSf/w4LcLYOlUE2QHleWE14HT4j+mFLv/qwqh5Relf Lvzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=aEBOwuxUA2V1ZGAJh2mOnLf//Ja1gm673Jt7jSd+fvY=; b=OkctC/9wDgG4xK3tzkfw+tJtUS9GJ2oWaZpLO+MTGXiUbRI0ZG+j3zs2XhC6hT5AII o6fZQEzTNnyO1+7FlNqEXLbk/QnbKO3GO23uwGPZEfw4o6Xr2JVlymqu7RUu33fMtBa0 oV+Hrac/sBAzfQqGKF8lWugYEJ3POo4QaEcM15s8rh/tFv/7IGCC76vZU4JeOj8G8Awt U7dZkCK1gyL1ByaXQrl/2pt4t+oTEnXCQsu8uhLDtoVofmuoyqj7U9q8Z+HiPs39pmvV bvPE9stu5soYgGkCAxGBOGD1Kj6SK0QrAWRn++Oat15G7sJG5cDFUJTDBRoV+/qoMj15 JFhw== X-Gm-Message-State: AOAM532MRDyhU8N2a09KsBrBXUfrd6d91ERK9pVT2Njxo8yHKCZF+K8C Zg3CxFqkBEdux8QC3pYDG2D8RNPuSLm+PB1+6kleAw== X-Google-Smtp-Source: ABdhPJwrbF8OtmUhoBbaI7yHzcEpgtrUWFNLbaqNWdYvs3foX39Pwrw/3KO1P0M3XqXSQKFN109hHJ84KvGTEf8BjaU= X-Received: by 2002:aca:2b02:: with SMTP id i2mr31489899oik.140.1636986833283; Mon, 15 Nov 2021 06:33:53 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 15 Nov 2021 09:33:52 -0500 MIME-Version: 1.0 In-Reply-To: <20211115101129.lyxxmb6i7paaonwi@gilmour> References: <20211110130623.20553-1-granquet@baylibre.com> <20211110130623.20553-8-granquet@baylibre.com> <20211115101129.lyxxmb6i7paaonwi@gilmour> From: Guillaume Ranquet User-Agent: alot/0.10 Date: Mon, 15 Nov 2021 09:33:52 -0500 Message-ID: Subject: Re: [PATCH v6 7/7] drm/mediatek: Add mt8195 DisplayPort driver To: Maxime Ripard , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger Cc: Markus Schneider-Pargmann , kernel test robot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, Thanks for your review. Quoting Maxime Ripard (2021-11-15 11:11:29) > Hi, > > On Wed, Nov 10, 2021 at 02:06:23PM +0100, Guillaume Ranquet wrote: > > 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. > > There's a number of checkpatch --strict errors in there, make sure to fix them. This is a regression I've introduced, I think, when running clang-format... I'll fix them. > > > 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. > > If the PHY is in the same register space than the DP controller, why do > you need a separate PHY driver in the first place? > This has been asked by Chun-Kuang Hu in a previous revision of the series: https://lore.kernel.org/linux-mediatek/CAAOTY_-+T-wRCH2yw2XSm=ZbaBbqBQ4EqpU2P0TF90gAWQeRsg@mail.gmail.com/ > > 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 +- > > 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 +- > > drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 26 + > > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + > > drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + > > 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 drm_connector *connector, > > * modes and forbids YCRCB422 support for all video modes per > > * HDMI 1.3 spec. > > */ > > - info->color_formats = DRM_COLOR_FORMAT_RGB444; > > + info->color_formats |= DRM_COLOR_FORMAT_RGB444; > > > > /* YCRCB444 is optional according to spec. */ > > if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) { > > This looks unrelated? > Right, I should have kept it in a separate patch. > > 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 := 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 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