From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B77697C for ; Mon, 19 Sep 2022 15:19:06 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B8AD499; Mon, 19 Sep 2022 17:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1663600744; bh=a+tgm8YW9P+vfve/Nys1Rl5YgyMmUeApmVVsQf9hWvw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hq4+WkNfms6hxDm+VAKpQa/6MUUdEfwSualc3PsDbGGD2077EAChnASKu2TFyXk8B 9f2QxEXztH+1tR4C9jAiec28wzaa8DBa44NVEpKo1Q5Rp9ilVabTwTxetx9+NGwy8R +6t2o39CP3TN/CQC0zK0Ox0hva4yvJYhi2/fJGeI= Date: Mon, 19 Sep 2022 18:18:51 +0300 From: Laurent Pinchart To: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Arnd Bergmann , Benson Leung , Cai Huoqing , chrome-platform@lists.linux.dev, Chun-Kuang Hu , Dafna Hirschfeld , Daniel Vetter , David Airlie , Enric Balletbo i Serra , Guenter Roeck , Jitao Shi , Kieran Bingham , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Maarten Lankhorst , Matthias Brugger , Maxime Ripard , Philip Chen , Philipp Zabel , Thomas Zimmermann , Tomi Valkeinen Subject: Re: [PATCH v1 03/12] drm/mediatek: Drop chain_mode_fixup call in mode_valid() Message-ID: References: <20220717174454.46616-1-sam@ravnborg.org> <20220717174454.46616-4-sam@ravnborg.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220717174454.46616-4-sam@ravnborg.org> Hi Sam, Thank you for the patch. On Sun, Jul 17, 2022 at 07:44:45PM +0200, Sam Ravnborg wrote: > The mode_valid implementation had a call to > drm_bridge_chain_mode_fixup() which would be wrong as the mode_valid is > not allowed to change anything - only to validate the mode. > > As the next bridge is often/always a connector the call had no effect > anyway. So drop it. > > From the git history I could see this call was included in the original > version of the driver so there was no help there to find out why it was > added in the first place. But a lot has changed since the initial driver > were added and is seems safe to remove the call now. > > Signed-off-by: Sam Ravnborg > Reviewed-by: Maxime Ripard > Cc: Chun-Kuang Hu > Cc: Philipp Zabel > Cc: Matthias Brugger > Cc: Dafna Hirschfeld > Cc: linux-mediatek@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/mediatek/mtk_hdmi.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 3196189429bc..a63b76055f81 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -1208,22 +1208,11 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_mode *mode) > { > struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); > - struct drm_bridge *next_bridge; > > dev_dbg(hdmi->dev, "xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n", > mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), > !!(mode->flags & DRM_MODE_FLAG_INTERLACE), mode->clock * 1000); > > - next_bridge = drm_bridge_get_next_bridge(&hdmi->bridge); > - if (next_bridge) { > - struct drm_display_mode adjusted_mode; > - > - drm_mode_copy(&adjusted_mode, mode); > - if (!drm_bridge_chain_mode_fixup(next_bridge, mode, > - &adjusted_mode)) > - return MODE_BAD; > - } > - > if (hdmi->conf) { > if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) > return MODE_BAD; -- Regards, Laurent Pinchart 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 540BBC54EE9 for ; Mon, 19 Sep 2022 15:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T9W6/kAWWCoOe3EBKFee9ygVkSZYw2hxbnfoqHBrzoU=; b=gJyTsnqN6xIRaA qzpPGD3uDxe9lNgoYtFn6f6k6BQptU0w4qGNYi4qV/9Si64ZB98RpCjEmGahMQKFqi+0i0UKad9ZE vCc7a7ZhO7v4+RyQ7pmOpSo5T0UL5+IOs0FaFESfq+4gLLiGJNSOn2j4UYl65y0P2zJhyIiFkgJ+I 4VOVxrbJef0UjKTfl47OiPah4KWKDb4ri/JVVrhiOYj5gtqIOaIaUZghj2t5R98L2uQwdYWswrRQi Dkpt781HIQ6IeQaisI4+hgCI8qCZijV4PBVS6Un+ILnH9WWtW+kuODVjN+VkxrzgGMyadMd0TTIVg S8MOu8eoO8C1GEjV05xA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaIgg-00CSMY-PC; Mon, 19 Sep 2022 15:27:59 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaIY6-00CNYQ-7a; Mon, 19 Sep 2022 15:19:08 +0000 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B8AD499; Mon, 19 Sep 2022 17:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1663600744; bh=a+tgm8YW9P+vfve/Nys1Rl5YgyMmUeApmVVsQf9hWvw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hq4+WkNfms6hxDm+VAKpQa/6MUUdEfwSualc3PsDbGGD2077EAChnASKu2TFyXk8B 9f2QxEXztH+1tR4C9jAiec28wzaa8DBa44NVEpKo1Q5Rp9ilVabTwTxetx9+NGwy8R +6t2o39CP3TN/CQC0zK0Ox0hva4yvJYhi2/fJGeI= Date: Mon, 19 Sep 2022 18:18:51 +0300 From: Laurent Pinchart To: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Arnd Bergmann , Benson Leung , Cai Huoqing , chrome-platform@lists.linux.dev, Chun-Kuang Hu , Dafna Hirschfeld , Daniel Vetter , David Airlie , Enric Balletbo i Serra , Guenter Roeck , Jitao Shi , Kieran Bingham , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Maarten Lankhorst , Matthias Brugger , Maxime Ripard , Philip Chen , Philipp Zabel , Thomas Zimmermann , Tomi Valkeinen Subject: Re: [PATCH v1 03/12] drm/mediatek: Drop chain_mode_fixup call in mode_valid() Message-ID: References: <20220717174454.46616-1-sam@ravnborg.org> <20220717174454.46616-4-sam@ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220717174454.46616-4-sam@ravnborg.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_081906_541992_08BC7B98 X-CRM114-Status: GOOD ( 24.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Sam, Thank you for the patch. On Sun, Jul 17, 2022 at 07:44:45PM +0200, Sam Ravnborg wrote: > The mode_valid implementation had a call to > drm_bridge_chain_mode_fixup() which would be wrong as the mode_valid is > not allowed to change anything - only to validate the mode. > > As the next bridge is often/always a connector the call had no effect > anyway. So drop it. > > From the git history I could see this call was included in the original > version of the driver so there was no help there to find out why it was > added in the first place. But a lot has changed since the initial driver > were added and is seems safe to remove the call now. > > Signed-off-by: Sam Ravnborg > Reviewed-by: Maxime Ripard > Cc: Chun-Kuang Hu > Cc: Philipp Zabel > Cc: Matthias Brugger > Cc: Dafna Hirschfeld > Cc: linux-mediatek@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/mediatek/mtk_hdmi.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 3196189429bc..a63b76055f81 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -1208,22 +1208,11 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_mode *mode) > { > struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); > - struct drm_bridge *next_bridge; > > dev_dbg(hdmi->dev, "xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n", > mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), > !!(mode->flags & DRM_MODE_FLAG_INTERLACE), mode->clock * 1000); > > - next_bridge = drm_bridge_get_next_bridge(&hdmi->bridge); > - if (next_bridge) { > - struct drm_display_mode adjusted_mode; > - > - drm_mode_copy(&adjusted_mode, mode); > - if (!drm_bridge_chain_mode_fixup(next_bridge, mode, > - &adjusted_mode)) > - return MODE_BAD; > - } > - > if (hdmi->conf) { > if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) > return MODE_BAD; -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 4A112C54EE9 for ; Mon, 19 Sep 2022 15:19:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 066B010E669; Mon, 19 Sep 2022 15:19:09 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2822610E669 for ; Mon, 19 Sep 2022 15:19:06 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B8AD499; Mon, 19 Sep 2022 17:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1663600744; bh=a+tgm8YW9P+vfve/Nys1Rl5YgyMmUeApmVVsQf9hWvw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hq4+WkNfms6hxDm+VAKpQa/6MUUdEfwSualc3PsDbGGD2077EAChnASKu2TFyXk8B 9f2QxEXztH+1tR4C9jAiec28wzaa8DBa44NVEpKo1Q5Rp9ilVabTwTxetx9+NGwy8R +6t2o39CP3TN/CQC0zK0Ox0hva4yvJYhi2/fJGeI= Date: Mon, 19 Sep 2022 18:18:51 +0300 From: Laurent Pinchart To: Sam Ravnborg Subject: Re: [PATCH v1 03/12] drm/mediatek: Drop chain_mode_fixup call in mode_valid() Message-ID: References: <20220717174454.46616-1-sam@ravnborg.org> <20220717174454.46616-4-sam@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220717174454.46616-4-sam@ravnborg.org> 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: Dafna Hirschfeld , Neil Armstrong , David Airlie , Tomi Valkeinen , dri-devel@lists.freedesktop.org, Andrzej Hajda , Guenter Roeck , chrome-platform@lists.linux.dev, Jernej Skrabec , Chun-Kuang Hu , Jitao Shi , Arnd Bergmann , Jonas Karlman , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, Philip Chen , Thomas Zimmermann , Robert Foss , linux-renesas-soc@vger.kernel.org, Kieran Bingham , Enric Balletbo i Serra , Cai Huoqing Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Sam, Thank you for the patch. On Sun, Jul 17, 2022 at 07:44:45PM +0200, Sam Ravnborg wrote: > The mode_valid implementation had a call to > drm_bridge_chain_mode_fixup() which would be wrong as the mode_valid is > not allowed to change anything - only to validate the mode. > > As the next bridge is often/always a connector the call had no effect > anyway. So drop it. > > From the git history I could see this call was included in the original > version of the driver so there was no help there to find out why it was > added in the first place. But a lot has changed since the initial driver > were added and is seems safe to remove the call now. > > Signed-off-by: Sam Ravnborg > Reviewed-by: Maxime Ripard > Cc: Chun-Kuang Hu > Cc: Philipp Zabel > Cc: Matthias Brugger > Cc: Dafna Hirschfeld > Cc: linux-mediatek@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/mediatek/mtk_hdmi.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 3196189429bc..a63b76055f81 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -1208,22 +1208,11 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_mode *mode) > { > struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); > - struct drm_bridge *next_bridge; > > dev_dbg(hdmi->dev, "xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n", > mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), > !!(mode->flags & DRM_MODE_FLAG_INTERLACE), mode->clock * 1000); > > - next_bridge = drm_bridge_get_next_bridge(&hdmi->bridge); > - if (next_bridge) { > - struct drm_display_mode adjusted_mode; > - > - drm_mode_copy(&adjusted_mode, mode); > - if (!drm_bridge_chain_mode_fixup(next_bridge, mode, > - &adjusted_mode)) > - return MODE_BAD; > - } > - > if (hdmi->conf) { > if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) > return MODE_BAD; -- Regards, Laurent Pinchart