From patchwork Fri Apr 16 22:39:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 422722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25473C43462 for ; Fri, 16 Apr 2021 22:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 027EC613C0 for ; Fri, 16 Apr 2021 22:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234681AbhDPWlU (ORCPT ); Fri, 16 Apr 2021 18:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234183AbhDPWlU (ORCPT ); Fri, 16 Apr 2021 18:41:20 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C20D4C061574 for ; Fri, 16 Apr 2021 15:40:54 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id j7so10720473pgi.3 for ; Fri, 16 Apr 2021 15:40:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=2BW/qtgH/fZIuXm5QChY3DNkhDAV6mG9NJXYRN92ILo=; b=V0JV3IjRkQVXMvTWXV4VArXyWvOl+obbCAEE7BmclLNkDv0zvTDjItsA6IA0YfTG4I LLIg8IAHBH5MoyqmQn8thSizlH+vwE8lWbrrd2HOU2ahbh8gQmi4fWqqUbdiYJLhFYux 9Iq8rJltRcsRINa8YP4cMs/eCvtMm4iJUCpy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2BW/qtgH/fZIuXm5QChY3DNkhDAV6mG9NJXYRN92ILo=; b=PPpWWmMZoF1gdkznJcf7+2N/iMgWyKTJVhESpFuU1Ch0WWLoNTxkpSZGg6zhAKYbFi CqzAE3eyhZcXDZ+Y4EbNY+HFXP6r03NP049OPp7ktTV3D41uECq104xDj6c9IZMB1Fix gEKUs7fvX53D9auGsN2e6AjFWfNUXuAhhhIvP/2/kDbQ2UwDW5SnaVlvPO7M31bqD7aa AABzKC+Vwk96C/u4lDM8pzvUMQe/5alTLB7exAkAzABUChZqMY622+yinp9GE9SA+y97 uiEB3VaPZZgv67bLsBD0aspQscF84s2X9XRXMOcghReei6R0SYqJwU9VOc/xUMQ2hTZz tWPQ== X-Gm-Message-State: AOAM532TOUoxk2nJJWF00FswdNnndQ04yVsqtW3KqA8VBiUUkGR3fEWh UNu+e0S/ySmWLF5z9x4864V+gA== X-Google-Smtp-Source: ABdhPJyztcURn7SwAVEgemU7oiPsbeXh6lFsu6yV4/BPLlPn7nE9AQel/f11hn+AxBmk4as90oAAmA== X-Received: by 2002:a62:8784:0:b029:259:1d11:f145 with SMTP id i126-20020a6287840000b02902591d11f145mr6979594pfe.79.1618612854386; Fri, 16 Apr 2021 15:40:54 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:54 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Boris Brezillon , Daniel Vetter , David Airlie , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 01/27] drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable() Date: Fri, 16 Apr 2021 15:39:24 -0700 Message-Id: <20210416153909.v4.1.If62a003f76a2bc4ccc6c53565becc05d2aad4430@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The drm_bridge_chain_pre_enable() is not the proper opposite of drm_bridge_chain_post_disable(). It continues along the chain to _before_ the starting bridge. Let's fix that. Fixes: 05193dc38197 ("drm/bridge: Make the bridge chain a double-linked list") Signed-off-by: Douglas Anderson Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- (no changes since v1) drivers/gpu/drm/drm_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 64f0effb52ac..044acd07c153 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -522,6 +522,9 @@ void drm_bridge_chain_pre_enable(struct drm_bridge *bridge) list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { if (iter->funcs->pre_enable) iter->funcs->pre_enable(iter); + + if (iter == bridge) + break; } } EXPORT_SYMBOL(drm_bridge_chain_pre_enable); From patchwork Fri Apr 16 22:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 422721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1067CC43460 for ; Fri, 16 Apr 2021 22:41:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4735613C7 for ; Fri, 16 Apr 2021 22:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234992AbhDPWlZ (ORCPT ); Fri, 16 Apr 2021 18:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234856AbhDPWlW (ORCPT ); Fri, 16 Apr 2021 18:41:22 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E62C06175F for ; Fri, 16 Apr 2021 15:40:55 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id h11so1621493pfn.0 for ; Fri, 16 Apr 2021 15:40:55 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=V2616N/QYdtGiJ2WPqXN32z+9F37dE5BQ+AbPSzAlWM=; b=Kvygd9Jv3cSdtacrk08etIwGlvbXGIrpJZ3Kbi2fof0pagVnuMUHM5nHqm4TWmIu0l NbsEdW2P2kh3xjBHWDqpfg/e1gPhpozUNag0jYXbTdhTM22I3Dcjy9L9b7GQIOjRcYgp J65JqAvMF89YzAQdk9fBdrswX5VeBIl87nLqM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V2616N/QYdtGiJ2WPqXN32z+9F37dE5BQ+AbPSzAlWM=; b=DH+scdHCp3dkStvhwD6gtfFFpRv0DfI3at56iZralN7EQ2EJqnK2I+ZgpT8R4GimDs qtx1jZJhrKNmRrs5cDIx8jbRB29cBt0G0GZT2ohlZAW+IsssV1PhAmLbA1F3Y+nKw3Nr QUeu3KKHGghSFL//B9zaWALNZEo5eExc2g1tvk5ky1IysYgSNBef+HVRJs3qJ0jQw3ml xe5QVbUkxhU8IRfsDxmujXreQ84PG5FBJT5JwVISOcVTM/jTs7/K1i0cTqoWVTmKzcBX zuivLf3LMgtckrMqQ9DI89wWA/Ik2Amc6vm/g6WrvbEMQF0zyVxJ3BhYevpelBTSVyxJ AK7Q== X-Gm-Message-State: AOAM533Ui/tEqJDYa15NnCe/11k5NltRkb/nGvZQ8DF+W3DfPLijeaix UEDxAm6UtxKvSKjQ+tX9tsN2sA== X-Google-Smtp-Source: ABdhPJx+++sgm6QScJKVRhLGDYDXTsoYpzMGpZIuovPKocdK2x9/8MdnhVgChFQiH8GmypmxYux8VA== X-Received: by 2002:a63:514d:: with SMTP id r13mr1079777pgl.322.1618612855514; Fri, 16 Apr 2021 15:40:55 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:55 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Robert Foss , Laurent Pinchart , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 02/27] drm/bridge: ti-sn65dsi86: Simplify refclk handling Date: Fri, 16 Apr 2021 15:39:25 -0700 Message-Id: <20210416153909.v4.2.Ic9c04f960190faad5290738b2a35d73661862735@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The clock framework makes it simple to deal with an optional clock. You can call clk_get_optional() and if the clock isn't specified it'll just return NULL without complaint. It's valid to pass NULL to enable/disable/prepare/unprepare. Let's make use of this to simplify things a tiny bit. Signed-off-by: Douglas Anderson Reviewed-by: Robert Foss Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda --- (no changes since v2) Changes in v2: - Removed 2nd paragraph in commit message. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 88df4dd0f39d..96fe8f2c0ea9 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1275,14 +1275,9 @@ static int ti_sn_bridge_probe(struct i2c_client *client, return ret; } - pdata->refclk = devm_clk_get(pdata->dev, "refclk"); - if (IS_ERR(pdata->refclk)) { - ret = PTR_ERR(pdata->refclk); - if (ret == -EPROBE_DEFER) - return ret; - DRM_DEBUG_KMS("refclk not found\n"); - pdata->refclk = NULL; - } + pdata->refclk = devm_clk_get_optional(pdata->dev, "refclk"); + if (IS_ERR(pdata->refclk)) + return PTR_ERR(pdata->refclk); ret = ti_sn_bridge_parse_dsi_host(pdata); if (ret) From patchwork Fri Apr 16 22:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 423453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88D60C433ED for ; Fri, 16 Apr 2021 22:41:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66C77613C7 for ; Fri, 16 Apr 2021 22:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234981AbhDPWlY (ORCPT ); Fri, 16 Apr 2021 18:41:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234749AbhDPWlX (ORCPT ); Fri, 16 Apr 2021 18:41:23 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2BABC061756 for ; Fri, 16 Apr 2021 15:40:56 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id c3so462828pfo.3 for ; Fri, 16 Apr 2021 15:40:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=XvcTL0RsbG+N8ibrkzli2K1A+rE+ZrcYjKP9wz2z40I=; b=AufOpWxiDS8cPPrP7xzjOHsIoN36eKpOCxEXl12PAo2J/qdSsF4bqxhnWAoHrmPdgi jdSwBdRJc9Q5vDcJV0vvreL74oFh6+Anm/o8pvPb8DW+i5Aelp9ZDP1HNTZ0Rp2OrdyZ XPBg766uOfY2dHhRsLvb38FAjAcOn8oh7WNLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XvcTL0RsbG+N8ibrkzli2K1A+rE+ZrcYjKP9wz2z40I=; b=LZ/6kPdVQPkMst297EDQuDQOteBB0tMgB8IVc0vHTjdweNYURXhDFghQOWNa+0tBJu roDHBumk8PHkTZu2CK9f3d2rFJi41L2jNd1UChIbRJmR/O7IGs7SM5pvYOyYMjCuLBQc BXc4DqMRNzY5IhYdD7H++87Ky0oYZ6Fo1pPXbJaM3qaokniTQFP0Rh4HY6bh+d+/INsZ 3eIH0sgMqfZfWnaVNskca07frw5ogdUwSkMmOPNv7APK+wwWMg4yR8VLN55e+a/XTosB UfRoL6+d0mhWbIDmDnJ6GT9tlT9RLN1XkoVgoR6AlE+CiwMROG3TU7ofo7ATjIqHAaf0 prUA== X-Gm-Message-State: AOAM5317R/TbMBCJdGQsltRPsqx2zmfiBmM+hJJ6+775filNvFxh/5rt XqiBDchXh0oGbOfmNi259X2urA== X-Google-Smtp-Source: ABdhPJzNUiYzRYYbvZn//8wjS/CeqlBImBF5oNQlkkD5V/lJHOiw3ppDJgVHdWGhvCqC6g4Hpy9jag== X-Received: by 2002:aa7:9791:0:b029:25c:38de:aa6b with SMTP id o17-20020aa797910000b029025c38deaa6bmr522788pfp.19.1618612856582; Fri, 16 Apr 2021 15:40:56 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:56 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 03/27] drm/bridge: ti-sn65dsi86: Remove incorrectly tagged kerneldoc comment Date: Fri, 16 Apr 2021 15:39:26 -0700 Message-Id: <20210416153909.v4.3.I167766eeaf4c4646a3934c4dd5332decbab6bd68@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A random comment inside a function had "/**" in front of it. That doesn't make sense. Remove. Signed-off-by: Douglas Anderson Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 96fe8f2c0ea9..76f43af6735d 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -788,7 +788,7 @@ static void ti_sn_bridge_enable(struct drm_bridge *bridge) /* set dsi clk frequency value */ ti_sn_bridge_set_dsi_rate(pdata); - /** + /* * The SN65DSI86 only supports ASSR Display Authentication method and * this method is enabled by default. An eDP panel must support this * authentication method. We need to enable this method in the eDP panel From patchwork Fri Apr 16 22:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 423452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05174C43462 for ; Fri, 16 Apr 2021 22:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC186613B0 for ; Fri, 16 Apr 2021 22:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235010AbhDPWlZ (ORCPT ); Fri, 16 Apr 2021 18:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234928AbhDPWlX (ORCPT ); Fri, 16 Apr 2021 18:41:23 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C599C061763 for ; Fri, 16 Apr 2021 15:40:58 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id m11so19272216pfc.11 for ; Fri, 16 Apr 2021 15:40:58 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Lu8AkZNDWlNH1fxgO+EV43zlL49xIkQqM7cXQa1E70s=; b=boe3GraedXsJgeS77vtR2rV2V7UGXCxUaQcxH1b5+AOfv4z1Z27hGPMn2tDe6fhRsn hvDtUo57zkdiGiJELJycymBwSweYrtJbTs6zoLwzgHftJlJQKjMQ99dXQxfQhkhTjAAh u9n+/dhH6qEfJPbCP0XrOfmurcTC84gRst7uk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lu8AkZNDWlNH1fxgO+EV43zlL49xIkQqM7cXQa1E70s=; b=aUPu0P1KKybXtaZDg6Oola4jZqw1sahMgmXXb3m4v6t70ObMTO2dXAWF7Lv6z4fpf6 byqZeJp2bycgaEBxLjN+8tkjePDIr7itG6jHlmUGEt4RGBCnz9QlOlqmb1y1e3xfeSLz 71ap3f1P9r4AZCXakjGDRSDg21D85SKdODhmS9RyvXTCuMJJFQneY2eLseuHSCH9vUN7 oigMP7J0y/WncikPs7LFgpyH7drfKWnKiUv5dOkPJyZ6WhYash4MzgF5r9r763vNir/M k8U67BrtA1w/nV8MQ/SpuVrTvVERWbRduKenofXtCS0vYmwTRgmQ74qpqeQcRAf5YVXl v+SQ== X-Gm-Message-State: AOAM5333xLGZU5HfpsMEa9Y9oeKtqt3PQITMTt9s8+pCOkKY35GItXn6 3AyNExTVav5aZArsmy1CJBFxFg== X-Google-Smtp-Source: ABdhPJyTDqtz7UW4GkJ3AlSBpIPnxOnqUox/SqIrqnGsonE9KjngvVcmJxuRuSYBWLmdJQvyT8RIIg== X-Received: by 2002:aa7:904b:0:b029:250:991e:315 with SMTP id n11-20020aa7904b0000b0290250991e0315mr9708738pfo.70.1618612857697; Fri, 16 Apr 2021 15:40:57 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:57 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 04/27] drm/bridge: ti-sn65dsi86: Reorder remove() Date: Fri, 16 Apr 2021 15:39:27 -0700 Message-Id: <20210416153909.v4.4.Ifcf1deaa372eba7eeb4f8eb516c5d15b77a657a9@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Let's make the remove() function strictly the reverse of the probe() function so it's easier to reason about. This patch was created by code inspection and should move us closer to a proper remove. Signed-off-by: Douglas Anderson Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- (no changes since v3) Changes in v3: - Removed "NOTES" from commit message. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 76f43af6735d..c006678c9921 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1315,20 +1315,21 @@ static int ti_sn_bridge_remove(struct i2c_client *client) if (!pdata) return -EINVAL; - kfree(pdata->edid); - ti_sn_debugfs_remove(pdata); - - of_node_put(pdata->host_node); - - pm_runtime_disable(pdata->dev); - if (pdata->dsi) { mipi_dsi_detach(pdata->dsi); mipi_dsi_device_unregister(pdata->dsi); } + kfree(pdata->edid); + + ti_sn_debugfs_remove(pdata); + drm_bridge_remove(&pdata->bridge); + pm_runtime_disable(pdata->dev); + + of_node_put(pdata->host_node); + return 0; } From patchwork Fri Apr 16 22:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 422720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27CC5C43461 for ; Fri, 16 Apr 2021 22:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06B39613D3 for ; Fri, 16 Apr 2021 22:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbhDPWl0 (ORCPT ); Fri, 16 Apr 2021 18:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234999AbhDPWlZ (ORCPT ); Fri, 16 Apr 2021 18:41:25 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20973C06138A for ; Fri, 16 Apr 2021 15:40:59 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id h11so1621557pfn.0 for ; Fri, 16 Apr 2021 15:40:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=pcJHDcYMV/GNRvkYvCP6Y5GlcN4y2gUoiu2dtS69kIs=; b=ZsInv2JReTrfjCgB8cC2jbctayfltBqBr0jOg/kNzrP6rbjJRuDO2ZT50ZjSe7P511 6Eiktjk1IJ+Z76JPjdunMQ7+1SGN9m+uWcMd0FXecfowEx7VHM5M9vo76px1rEqZTcAA UF90B3xobn+6xQeKqzuNgiZBP9MVJxrOytsJ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pcJHDcYMV/GNRvkYvCP6Y5GlcN4y2gUoiu2dtS69kIs=; b=eeknhKUsGi5i31AYwoC0YZQSTAf6ObPfO8dwGpBdBJsKwJCUXjYGEbLvbsGj54Ksz9 6JVqUGNg5n9kKvT/Izemsi3dTbxLZ0j9neGUQbnZX+GhaWftAueLqLbKcl7Tcz1sh9AB G9pmaTkSAnZIIHSkcj5x1kl5mKvqh2nDfO02+O8M4tRpJEs+zBfH5bIo+/x3QYbivGJL UIgpUOJcSR4zIas6ehiWBOHZ7KgNZfA8la6hJKPeu3t6GRFjO64QvNZF1aEPCp7/q3WP JHZIiQoOKSGh2bH8UcRiYS/prw9i6f3KENNqiZ0yB2lr9z9M1nLRhhx4/6Jas6/OMP7v YD1Q== X-Gm-Message-State: AOAM532X4rRygGSC4M7dwPdGetQX30efoloDcQpPRFmuX/XokyNJqCEb 7Wu16N0qP2M29GSzaRJJMITWiQ== X-Google-Smtp-Source: ABdhPJxsoX7eKSMm+cKUoiLIrtgFQTzsLXBKF76NDygdyZY1gzqdrBnHowzCGvB55KXccagYFL6tdQ== X-Received: by 2002:aa7:8608:0:b029:258:838a:23bb with SMTP id p8-20020aa786080000b0290258838a23bbmr7797618pfn.37.1618612858730; Fri, 16 Apr 2021 15:40:58 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:58 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 05/27] drm/bridge: ti-sn65dsi86: Move drm_panel_unprepare() to post_disable() Date: Fri, 16 Apr 2021 15:39:28 -0700 Message-Id: <20210416153909.v4.5.Ia75c9ffe2a2582393a8532d244da86f18b4c9b21@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We prepared the panel in pre_enable() so we should unprepare it in post_disable() to match. Signed-off-by: Douglas Anderson Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- Changes in v4: - Reword commit mesage slightly. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index c006678c9921..e30460002c48 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -452,8 +452,6 @@ static void ti_sn_bridge_disable(struct drm_bridge *bridge) regmap_write(pdata->regmap, SN_ML_TX_MODE_REG, 0); /* disable DP PLL */ regmap_write(pdata->regmap, SN_PLL_ENABLE_REG, 0); - - drm_panel_unprepare(pdata->panel); } static u32 ti_sn_bridge_get_dsi_freq(struct ti_sn_bridge *pdata) @@ -869,6 +867,8 @@ static void ti_sn_bridge_post_disable(struct drm_bridge *bridge) { struct ti_sn_bridge *pdata = bridge_to_ti_sn_bridge(bridge); + drm_panel_unprepare(pdata->panel); + clk_disable_unprepare(pdata->refclk); pm_runtime_put_sync(pdata->dev); From patchwork Fri Apr 16 22:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 423451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CE17C43603 for ; Fri, 16 Apr 2021 22:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 711BF613D0 for ; Fri, 16 Apr 2021 22:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234999AbhDPWl0 (ORCPT ); Fri, 16 Apr 2021 18:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbhDPWlZ (ORCPT ); Fri, 16 Apr 2021 18:41:25 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 338E2C061574 for ; Fri, 16 Apr 2021 15:41:00 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 10so10387702pfl.1 for ; Fri, 16 Apr 2021 15:41:00 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=J5nOteFgoZnowwkTipxkWtE08iX9sY3pl7ULi9yEyaI=; b=W8hyzMu/n2h6P+btoPgO6hDZzVjhqexQbyYVYNXmEhPGuPi5s0RUkdrBz6VIbEPPV7 zG1o4lr9afuQGk8W+WKyYmlPegOotR2ux4/bMDggeTsMoSjsK8W8H6GyH9bnVFCVdo16 FXQUn08UWJTOaR8fX8Q5JzKcqPflvpRF2Y5+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J5nOteFgoZnowwkTipxkWtE08iX9sY3pl7ULi9yEyaI=; b=OigMvS8/qwHAjSs7/8v/+vVdWKQu2SXifTmflFjPmbIxYdfbUZbtnHkpUp9oFar1Z9 ubBA+oJoRJC81dsqOO5FVQ8FEApNb9Zn/Z3EfEH8uNK0oyLME6ZzxXkH26QA76MWWFUP 2Xz26vmdmkl9PmE5c9YNjAwg5XNqXiB3vHl0VmmZ7KjgTg9eSHG8pfP/LDSBO/D3n4xY Z+bNE/45HpDMoORAMj4HDwNhLMphL0TFNNQSCYncEP6uk4Ml4Kjm6t1RMi4qUUXmBC5o jnLO/WZ1COpu3pq6RqjSKv38qyTblyEjBgQvF4YNHbExfNyKxJ+oBBKnMIQf5P3ni1Es G1Sg== X-Gm-Message-State: AOAM531tR/eVDg6RSvP7mn5SlflMCWg7GSBt1IoaDN3sxdqsrw+moYN7 5V2/PiwE0xdtojJbGN69wGsTrw== X-Google-Smtp-Source: ABdhPJyj5GBW4RdGlaUXoToWPg882VwpJn8Yf5HvBP+mLu4qvhhDBwIkpFlvogSUcDSesiRyd++BrA== X-Received: by 2002:a63:c847:: with SMTP id l7mr1102468pgi.445.1618612859778; Fri, 16 Apr 2021 15:40:59 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:40:59 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 06/27] drm/bridge: ti-sn65dsi86: Get rid of the useless detect() function Date: Fri, 16 Apr 2021 15:39:29 -0700 Message-Id: <20210416153909.v4.6.I826adf4faeb7f39f560b387f6b380e639c6986c8@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If we just leave the detect() function as NULL then the upper layers assume we're always connected. There's no reason for a stub. Signed-off-by: Douglas Anderson Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index e30460002c48..51db30d573c1 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -306,20 +306,8 @@ static struct drm_connector_helper_funcs ti_sn_bridge_connector_helper_funcs = { .mode_valid = ti_sn_bridge_connector_mode_valid, }; -static enum drm_connector_status -ti_sn_bridge_connector_detect(struct drm_connector *connector, bool force) -{ - /** - * TODO: Currently if drm_panel is present, then always - * return the status as connected. Need to add support to detect - * device state for hot pluggable scenarios. - */ - return connector_status_connected; -} - static const struct drm_connector_funcs ti_sn_bridge_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, - .detect = ti_sn_bridge_connector_detect, .destroy = drm_connector_cleanup, .reset = drm_atomic_helper_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, From patchwork Fri Apr 16 22:39:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 423447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D43FC43600 for ; Fri, 16 Apr 2021 22:41:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B326613C3 for ; Fri, 16 Apr 2021 22:41:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235058AbhDPWlg (ORCPT ); Fri, 16 Apr 2021 18:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235073AbhDPWlb (ORCPT ); Fri, 16 Apr 2021 18:41:31 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C1D1C06175F for ; Fri, 16 Apr 2021 15:41:01 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id w8so15798269pfn.9 for ; Fri, 16 Apr 2021 15:41:01 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=4INPsktRh63MYznTPEEwmqN4qH+4+y6bOootcCGCpqs=; b=kgDbFvpoaiTtEYJP/SI4i/wU3eREZ10ugre9Kjus0KuOlxxFF0adtLiKAcm1gyzJ+c naAccRw1h9kCrgHQJeNZw/jlAkUmX2FqzN4eR1zv/AqYXgRpFpNDhd9szX6PzibqbUq6 syf8bF1GO3vgBLnpBUqPPL0vI72391UvUDl5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4INPsktRh63MYznTPEEwmqN4qH+4+y6bOootcCGCpqs=; b=mVXoyi16Rbp9E8FAq5TlugFedE0+lKcURq3iCkHcsAlWD2qgvv3fbJt8X9r3SfBNyp UufrI0wAfbfzMq8kknpBo6pjZ6XHvfKbAuUhkBN3yAeqCMsYMS5V4R8hwcuxEoD8VMMw LLqnyBJoFfg+gw1Jy+3e4F/9Pd5lwaQWNBy3jnugaziuJgq8riFRfjtKiXa3WisjfVOV Lh4vKqilTGi2GafeaxSuY4BAfI4YwRq+v4KDq8QgPwBvvBJb3bMetOND5y2cA9GALFlX mUIaKbbOUjjcTr3Y2YPWtXz6IfTY/lFjiVEk4MUUa4NaJuRgoQOgrqj+WqvOOCS41qnq 7aPA== X-Gm-Message-State: AOAM531k1vnf95zRqxzCsCVVaUexfk3yuOc28de22E5W4FxbgkLL7hLu tSzdswSWTT4u1csUo2889fAUiA== X-Google-Smtp-Source: ABdhPJxdxpzcVYaUk0y3l3qc/9b9JdCgkaUw8QkdRQqUWBnzRKxRKV4SFk9rcOynna/BuiRHtzXx8Q== X-Received: by 2002:aa7:8d5a:0:b029:227:7b07:7d8b with SMTP id s26-20020aa78d5a0000b02902277b077d8bmr9605907pfe.26.1618612860869; Fri, 16 Apr 2021 15:41:00 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:dc8a:c9d0:aa5b:5386]) by smtp.gmail.com with ESMTPSA id r6sm5633659pgp.64.2021.04.16.15.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 15:41:00 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg , Wolfram Sang Cc: Stephen Boyd , robdclark@chromium.org, Maarten Lankhorst , Stanislav Lisovskiy , Steev Klimaszewski , Bjorn Andersson , linux-arm-msm@vger.kernel.org, Linus W , Douglas Anderson , Laurent Pinchart , Daniel Vetter , David Airlie , Thierry Reding , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 07/27] drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare Date: Fri, 16 Apr 2021 15:39:30 -0700 Message-Id: <20210416153909.v4.7.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210416223950.3586967-1-dianders@chromium.org> References: <20210416223950.3586967-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Unpreparing and re-preparing a panel can be a really heavy operation. Panels datasheets often specify something on the order of 500ms as the delay you should insert after turning off the panel before turning it on again. In addition, turning on a panel can have delays on the order of 100ms - 200ms before the panel will assert HPD (AKA "panel ready"). The above means that we should avoid turning a panel off if we're going to turn it on again shortly. The above becomes a problem when we want to read the EDID of a panel. The way that ordering works is that userspace wants to read the EDID of the panel _before_ fully enabling it so that it can set the initial mode correctly. However, we can't read the EDID until we power it up. This leads to code that does this dance (like ps8640_bridge_get_edid()): 1. When userspace requests EDID / the panel modes (through an ioctl), we power on the panel just enough to read the EDID and then power it off. 2. Userspace then turns the panel on. There's likely not much time between step #1 and #2 and so we want to avoid powering the panel off and on again between those two steps. Let's use Runtime PM to help us. We'll move the existing prepare() and unprepare() to be runtime resume() and runtime suspend(). Now when we want to prepare() or unprepare() we just increment or decrement the refcount. We'll default to a 1 second autosuspend delay which seems sane given the typical delays we see for panels. A few notes: - It seems the existing unprepare() and prepare() are defined to be no-ops if called extra times. We'll preserve that behavior but may try to remove it in a future patch. - This is a slight change in the ABI of simple panel. If something was absolutely relying on the unprepare() to happen instantly that simply won't be the case anymore. I'm not aware of anyone relying on that behavior, but if there is someone then we'll need to figure out how to enable (or disable) this new delayed behavior selectively. - In order for this to work we now have a hard dependency on "PM". From memory this is a legit thing to assume these days and we don't have to find some fallback to keep working if someone wants to build their system without "PM". Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20210402152701.v3.12.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid Reviewed-by: Laurent Pinchart --- Laurent pointed out that perhaps we don't need to make unprepare() and prepare() no-ops if called extra times [1]. Since I worry that will break someone out there, I have left it as a separate change at the end of this series. See ("drm/panel: panel-simple: Prepare/unprepare are refcounted, not forced") [1] https://lore.kernel.org/r/YHePsQgqOau1V5lD@pendragon.ideasonboard.com/ (no changes since v1) drivers/gpu/drm/panel/Kconfig | 1 + drivers/gpu/drm/panel/panel-simple.c | 93 +++++++++++++++++++++------- 2 files changed, 73 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 4894913936e9..ef87d92cdf49 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -80,6 +80,7 @@ config DRM_PANEL_SIMPLE tristate "support for simple panels" depends on OF depends on BACKLIGHT_CLASS_DEVICE + depends on PM select VIDEOMODE_HELPERS help DRM panel driver for dumb panels that need at most a regulator and diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index be312b5c04dd..6b22872b3281 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include