From patchwork Thu May 12 20:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12848105 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 BDB1EC433F5 for ; Thu, 12 May 2022 20:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358475AbiELUw3 (ORCPT ); Thu, 12 May 2022 16:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358290AbiELUw2 (ORCPT ); Thu, 12 May 2022 16:52:28 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE82065433 for ; Thu, 12 May 2022 13:52:26 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id x8so2215635pgr.4 for ; Thu, 12 May 2022 13:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Ies45XQh7ymdD5acJILStC2yG/IlgiJIKbLY52H88Q=; b=Zc+8sBWS1pojS7k/yPaJKk9BjzB/ATYdrEE1H/xsCuyenIYW19LxvPheqCeXWPmZrD OOdoPh+6HS1wB5oA53VwSqlqDOQqR1G1jmoJCMF8PDHBQPQX4IM6t2ImiFcbjqaLE5Nt EERMlp16x35JlLgCeCl/sSNUXfn8TWUZfRE+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Ies45XQh7ymdD5acJILStC2yG/IlgiJIKbLY52H88Q=; b=5g9VMCzMGMIXV4YkDuj4wxhucvddlHHlC5vN0SMfi8Hu5sVatKod128FWgb3pRbCeY yvkaZ2hUQgjEJvDaupteKUDfD3Fdd4d1HsGBrPOdHmAU7wcWuJSzs9/RrJKZmBNoC4XP 4+FyO/Ghp+Xn/XwEnWjPEg+dn5zrRCLkHwbNGBex2BeB+ygP15EjeNa3BhcqX2EtIH5L bAySYs7ydPSGdxZtUtgM3WzEF+Oou6zP32soIt6rat1+LLpmuqiYJbxkQ5rAT7NEL5BK tIw6tlLs0OYwTkAVSjLCaKi5lxx3c5U0nakQjDUSiWCYEVUeul0GNDAhrwF6aWSSBE6a iKIA== X-Gm-Message-State: AOAM532WDKsBI5FVXfwnVlc9skQxxZ8EioYSR1LD7BGWmGpY4vJwkoIE JA8xkF63rO++QqvHppRyc7cSUJP7bgMx9QcsWq0= X-Google-Smtp-Source: ABdhPJxegJvQdMeDYnLXr1pjy2t9mHEjDACmKnVCoEdKhoZ9MnnfrVqDUATBEGvOT8sgCIE9Jo6b7Q== X-Received: by 2002:a63:1d5f:0:b0:3c6:e822:2eb1 with SMTP id d31-20020a631d5f000000b003c6e8222eb1mr1122541pgm.99.1652388746275; Thu, 12 May 2022 13:52:26 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:1ee3:ea22:908:c2b5]) by smtp.gmail.com with ESMTPSA id q15-20020a170902a3cf00b0015eddb8e450sm370681plb.25.2022.05.12.13.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 13:52:25 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Dave Stevenson , Douglas Anderson , Bjorn Andersson , Daniel Vetter , David Airlie , Sean Paul , Stephen Boyd , Vinod Koul , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] drm/msm/dsi: only powerup at modeset time if "early_poweron" modparam Date: Thu, 12 May 2022 13:52:18 -0700 Message-Id: <20220512135134.v3.1.Ia196e35ad985059e77b038a41662faae9e26f411@changeid> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time") caused sc7180 Chromebooks that use the parade-ps8640 bridge chip to fail to turn the display back on after it turns off. Unfortunately, it doesn't look easy to fix the parade-ps8640 driver to handle the new power sequence. The Linux driver has almost nothing in it and most of the logic for this bridge chip is in black-box firmware that the bridge chip uses. Also unfortunately, reverting the patch will break "tc358762". The long term solution here is probably Dave Stevenson's series [1] that would give more flexibility. However, that is likely not a quick fix. For the short term, let's introduce a module parameter that selects between the two behaviors. This is a short term hack but at least can keep both users working. We'll default the value of the module parameter to the old behavior. Given that the old behavior has existed for longer it's probably a safer default. [1] https://lore.kernel.org/r/cover.1646406653.git.dave.stevenson@raspberrypi.com Fixes: 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time") Suggested-by: Dmitry Baryshkov Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov --- Changes in v3: - No longer a revert; now a module parameter. Changes in v2: - Remove the mud from my face. drivers/gpu/drm/msm/dsi/dsi_manager.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 50b987658b1f..2bf4123ef5df 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -34,6 +34,10 @@ static struct msm_dsi_manager msm_dsim_glb; #define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed) #define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id == id) +bool early_poweron; +MODULE_PARM_DESC(early_poweron, "Power DSI controller early"); +module_param(early_poweron, bool, 0600); + static inline struct msm_dsi *dsi_mgr_get_dsi(int id) { return msm_dsim_glb.dsi[id]; @@ -389,6 +393,9 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) return; + if (!early_poweron) + dsi_mgr_bridge_power_on(bridge); + /* Always call panel functions once, because even for dual panels, * there is only one drm_panel instance. */ @@ -570,7 +577,8 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge, if (is_bonded_dsi && other_dsi) msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode); - dsi_mgr_bridge_power_on(bridge); + if (early_poweron) + dsi_mgr_bridge_power_on(bridge); } static enum drm_mode_status dsi_mgr_bridge_mode_valid(struct drm_bridge *bridge,