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