From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A56E2C433FE for ; Wed, 9 Feb 2022 12:01:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9406910E1C4; Wed, 9 Feb 2022 12:01:31 +0000 (UTC) Received: from aposti.net (aposti.net [89.234.176.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id C201810E1C4 for ; Wed, 9 Feb 2022 12:01:29 +0000 (UTC) Date: Wed, 09 Feb 2022 12:01:16 +0000 From: Paul Cercueil Subject: Re: [PATCH v13 5/9] drm/synopsys+ingenic: repair hot plug detection To: "H. Nikolaus Schaller" Message-Id: <4ED17R.TVHQS4U654LE@crapouillou.net> In-Reply-To: <08fb9549042d35c1904fd977e68aa52f74f755b0.1643819482.git.hns@goldelico.com> References: <08fb9549042d35c1904fd977e68aa52f74f755b0.1643819482.git.hns@goldelico.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Paul Boddie , Geert Uytterhoeven , Neil Armstrong , David Airlie , Rob Herring , linux-mips@vger.kernel.org, Laurent Pinchart , Andrzej Hajda , Miquel Raynal , Sam Ravnborg , Jernej Skrabec , devicetree@vger.kernel.org, Kees Cook , Jonas Karlman , Mark Brown , Maxime Ripard , letux-kernel@openphoenux.org, Thomas Bogendoerfer , dri-devel@lists.freedesktop.org, Liam Girdwood , Robert Foss , linux-kernel@vger.kernel.org, Kieran Bingham , "Eric W. Biederman" , Hans Verkuil Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Nikolaus, Le mer., f=E9vr. 2 2022 at 17:31:19 +0100, H. Nikolaus Schaller=20 a =E9crit : > so that it calls drm_kms_helper_hotplug_event(). >=20 > We need to set .poll_enabled but that struct component > can only be accessed in the core code. Hence we add a public > setter function. >=20 > Signed-off-by: H. Nikolaus Schaller > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 9 +++++++++ > drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c | 2 ++ > include/drm/bridge/dw_hdmi.h | 1 + > 3 files changed, 12 insertions(+) >=20 > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c=20 > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 54d8fdad395f5..52e7cd2e020d3 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -3216,6 +3216,15 @@ static int dw_hdmi_parse_dt(struct dw_hdmi=20 > *hdmi) > return 0; > } >=20 > +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable) > +{ > + if (hdmi->bridge.dev) > + hdmi->bridge.dev->mode_config.poll_enabled =3D enable; > + else > + dev_warn(hdmi->dev, "no hdmi->bridge.dev"); > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_enable_poll); > + > struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, > const struct dw_hdmi_plat_data *plat_data) > { > diff --git a/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c=20 > b/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > index 34e986dd606cf..90547a28dc5c7 100644 > --- a/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > +++ b/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > @@ -55,6 +55,8 @@ ingenic_dw_hdmi_mode_valid(struct dw_hdmi *hdmi,=20 > void *data, > if (mode->clock > 216000) > return MODE_CLOCK_HIGH; >=20 > + dw_hdmi_enable_poll(hdmi, true); > + It would be a better idea to move this patch before the patch that=20 creates ingenic-dw-hdmi.c. Then you wouldn't have to patch a file that=20 was just introduced. As for the patch itself, I guess it's fine, but is that really needed?=20 My understanding is that it's the hdmi-connector's job to poll. Cheers, -Paul > return MODE_OK; > } >=20 > diff --git a/include/drm/bridge/dw_hdmi.h=20 > b/include/drm/bridge/dw_hdmi.h > index 2a1f85f9a8a3f..963960794b40e 100644 > --- a/include/drm/bridge/dw_hdmi.h > +++ b/include/drm/bridge/dw_hdmi.h > @@ -196,5 +196,6 @@ enum drm_connector_status=20 > dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi, > void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data, > bool force, bool disabled, bool rxsense); > void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable); >=20 > #endif /* __IMX_HDMI_H__ */ > -- > 2.33.0 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 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 25277C433EF for ; Wed, 9 Feb 2022 12:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbiBIMRQ convert rfc822-to-8bit (ORCPT ); Wed, 9 Feb 2022 07:17:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbiBIMPl (ORCPT ); Wed, 9 Feb 2022 07:15:41 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC8DC05CB9D; Wed, 9 Feb 2022 04:01:29 -0800 (PST) Date: Wed, 09 Feb 2022 12:01:16 +0000 From: Paul Cercueil Subject: Re: [PATCH v13 5/9] drm/synopsys+ingenic: repair hot plug detection To: "H. Nikolaus Schaller" Cc: Rob Herring , Mark Rutland , Thomas Bogendoerfer , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil , Liam Girdwood , Mark Brown , Paul Boddie , Andrzej Hajda , Kieran Bingham , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Jonas Karlman , dri-devel@lists.freedesktop.org Message-Id: <4ED17R.TVHQS4U654LE@crapouillou.net> In-Reply-To: <08fb9549042d35c1904fd977e68aa52f74f755b0.1643819482.git.hns@goldelico.com> References: <08fb9549042d35c1904fd977e68aa52f74f755b0.1643819482.git.hns@goldelico.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Hi Nikolaus, Le mer., févr. 2 2022 at 17:31:19 +0100, H. Nikolaus Schaller a écrit : > so that it calls drm_kms_helper_hotplug_event(). > > We need to set .poll_enabled but that struct component > can only be accessed in the core code. Hence we add a public > setter function. > > Signed-off-by: H. Nikolaus Schaller > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 9 +++++++++ > drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c | 2 ++ > include/drm/bridge/dw_hdmi.h | 1 + > 3 files changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 54d8fdad395f5..52e7cd2e020d3 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -3216,6 +3216,15 @@ static int dw_hdmi_parse_dt(struct dw_hdmi > *hdmi) > return 0; > } > > +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable) > +{ > + if (hdmi->bridge.dev) > + hdmi->bridge.dev->mode_config.poll_enabled = enable; > + else > + dev_warn(hdmi->dev, "no hdmi->bridge.dev"); > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_enable_poll); > + > struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, > const struct dw_hdmi_plat_data *plat_data) > { > diff --git a/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > b/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > index 34e986dd606cf..90547a28dc5c7 100644 > --- a/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > +++ b/drivers/gpu/drm/ingenic/ingenic-dw-hdmi.c > @@ -55,6 +55,8 @@ ingenic_dw_hdmi_mode_valid(struct dw_hdmi *hdmi, > void *data, > if (mode->clock > 216000) > return MODE_CLOCK_HIGH; > > + dw_hdmi_enable_poll(hdmi, true); > + It would be a better idea to move this patch before the patch that creates ingenic-dw-hdmi.c. Then you wouldn't have to patch a file that was just introduced. As for the patch itself, I guess it's fine, but is that really needed? My understanding is that it's the hdmi-connector's job to poll. Cheers, -Paul > return MODE_OK; > } > > diff --git a/include/drm/bridge/dw_hdmi.h > b/include/drm/bridge/dw_hdmi.h > index 2a1f85f9a8a3f..963960794b40e 100644 > --- a/include/drm/bridge/dw_hdmi.h > +++ b/include/drm/bridge/dw_hdmi.h > @@ -196,5 +196,6 @@ enum drm_connector_status > dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi, > void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data, > bool force, bool disabled, bool rxsense); > void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable); > > #endif /* __IMX_HDMI_H__ */ > -- > 2.33.0 >