From patchwork Sun Jul 17 17:44:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 12920568 X-Patchwork-Delegate: kieran@bingham.xyz 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 D03EFC433EF for ; Sun, 17 Jul 2022 17:45:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiGQRpU (ORCPT ); Sun, 17 Jul 2022 13:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiGQRpT (ORCPT ); Sun, 17 Jul 2022 13:45:19 -0400 Received: from mailrelay4-1.pub.mailoutpod1-cph3.one.com (mailrelay4-1.pub.mailoutpod1-cph3.one.com [46.30.210.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 799A9DF89 for ; Sun, 17 Jul 2022 10:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=AfH9Qs5wD3KTt5THnRe+Ywjg0HUrKrXd9QuokU8dlm0=; b=Whtuk9yCXNltyVJGmT82ZE4RWmxFP7coq6NApU3N75TVhXACkuISqTzMPgwY3klO2WNeY+jCl3zVT cvHoial7JYydrOcg9fv+SqI0Sd+rk+osanLTDy7He13QxZuomFQuS4At/XvbMfYdloXKi3a6dWHtmh K9ebjOe3pMxB2vMUKtvscXqEx34W8uUULIqlxt8SWUhNWHHjCZo9tQMNSTkTvfhyWVrUk/VjFcYQET U7jPe2MjAjdMAP4WCXCbCltkT1fTYo0VEtBqG5iB6Mr+c91FFX4YsupMFADh1X9H58XNT9iuHp5bIN ghBXg1IPcvLuRMEY15JCJsCqziMtLFA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=AfH9Qs5wD3KTt5THnRe+Ywjg0HUrKrXd9QuokU8dlm0=; b=GmKuQ7a3DwmGvbT3CzG3kUtioZ1YWa2gzXDCeVLowhKKayjpOz3rDyS2iPsoetCSiHFRqO12MrH2e 5ipeInWBg== X-HalOne-Cookie: 281e936c87613b4ea5f8a9a665e5e773c0d67fb2 X-HalOne-ID: 3745decf-05f8-11ed-823f-d0431ea8bb10 Received: from mailproxy1.cst.dirpod4-cph3.one.com (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 3745decf-05f8-11ed-823f-d0431ea8bb10; Sun, 17 Jul 2022 17:45:16 +0000 (UTC) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: 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 , Sam Ravnborg , Thomas Zimmermann , Tomi Valkeinen , Laurent Pinchart Subject: [PATCH v1 07/12] drm/bridge: tc358767: Use drm_bridge_funcs.atomic_check Date: Sun, 17 Jul 2022 19:44:49 +0200 Message-Id: <20220717174454.46616-8-sam@ravnborg.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220717174454.46616-1-sam@ravnborg.org> References: <20220717174454.46616-1-sam@ravnborg.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org When atomic_check() is defined, then mode_fixup() is ignored, so it had no effect that drm_bridge_funcs.mode_fixup was assigned. Embed the original implementation in the caller and drop the function. Signed-off-by: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Reviewed-by: Dave Stevenson Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/tc358767.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 02bd757a8987..b2ab967504af 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1496,26 +1496,18 @@ tc_edp_bridge_atomic_disable(struct drm_bridge *bridge, dev_err(tc->dev, "main link disable error: %d\n", ret); } -static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, - const struct drm_display_mode *mode, - struct drm_display_mode *adj) -{ - /* Fixup sync polarities, both hsync and vsync are active low */ - adj->flags = mode->flags; - adj->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); - adj->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); - - return true; -} - static int tc_common_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state, const unsigned int max_khz) { - tc_bridge_mode_fixup(bridge, &crtc_state->mode, - &crtc_state->adjusted_mode); + struct drm_display_mode *adj = &crtc_state->adjusted_mode; + + /* Fixup sync polarities, both hsync and vsync are active low */ + adj->flags = crtc_state->mode.flags; + adj->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adj->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); if (crtc_state->adjusted_mode.clock > max_khz) return -EINVAL; @@ -1783,7 +1775,6 @@ static const struct drm_bridge_funcs tc_edp_bridge_funcs = { .atomic_check = tc_edp_atomic_check, .atomic_enable = tc_edp_bridge_atomic_enable, .atomic_disable = tc_edp_bridge_atomic_disable, - .mode_fixup = tc_bridge_mode_fixup, .detect = tc_bridge_detect, .get_edid = tc_get_edid, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,