From patchwork Fri Feb 11 22:40:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 541799 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp3463664imo; Fri, 11 Feb 2022 14:40:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz01WP27lT0njKYVkX4pUDMlx6pOEN5LHUDc/TzrzDPCQJw1y2vbiqJ0N/Vuf8Fm2XnN2Aq X-Received: by 2002:a63:4752:: with SMTP id w18mr3095355pgk.349.1644619244146; Fri, 11 Feb 2022 14:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644619244; cv=none; d=google.com; s=arc-20160816; b=08tXwJ1uJJCagDW7gcDwuVzOTz7EtU0zFLs5HwAhdn42fzxNWaqziUg0s3jNYAuGqP 4KsvwggeAQ0/2VapUET+hHeizIn8K27CBuoRlX513UGc3jM1NO/7qv9MbKOLrCKBL+7I Ay/Kzp3oqzTtnA8zLjZF7mG75+gBUVKcvwgH+/yqne6qH5W7GlBUR6a+ve28A9fO2w8+ xql7sF+MG3wXt71hm8ucc+hdYQnR+2kecixsEcPc2xwO9skDKP+fSQs2eYbqA4RoRqMj jDhetrdsAAvB6KTA9LRafcZpZ4uqEtvNWpKV0BzguLHt5969Bb+hr7qd94kenKmXqKrz 1MbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=wQf3XP4BZfuzc3ylEELAJ2OjaNg6jTxSBCBJwv6w5qM=; b=cv+ibhQLUJG/XcYdCKa+6kJTO7jTBTnn3vRQilX41lvGIFRRikyQWLRDL1YgrEFgGo LB9voQ+vSJ9Z1Oer+iG9guxTbTptlAJT+l+y6+qDG2rbpYhs6pK7amW9vor9C+ssQS+H hoGfuTKTUNyZMTpsgWg81adJrYOZ69ydsRDAsGNMDKyhDi9o6tFsZXCe9q3rjBFkTNQ4 ZKCzaeC1XQ2pYJ088TMwCMNHCSeU99BkjIsQ9uJKEadpwJ0L+XY1HGRW+LnwrU9VR2gb ECWaEbL56zgCVXW6SLnWAZwS+mgdg9qfwRs7bsDW25ybKYWukWOzqumn0dtk7YoIVC4S dP0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DHUDXkod; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id u6si2258625ple.14.2022.02.11.14.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 14:40:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DHUDXkod; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC8BC10EBB9; Fri, 11 Feb 2022 22:40:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id E94EA10EBA9 for ; Fri, 11 Feb 2022 22:40:09 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id c10so1695445ljr.9 for ; Fri, 11 Feb 2022 14:40:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wQf3XP4BZfuzc3ylEELAJ2OjaNg6jTxSBCBJwv6w5qM=; b=DHUDXkodYg67FoSIT/jyDwu8mai51ctlRRP+iWjmYaBMn7H74cJ0iXyxOMtA9CdYf2 Dvo+Ly8DjcW/FBEf1N9HChiPIEVIoKSslEznKV/Mk1Fg8PkonubmzrZzhCc9I79/bpgl Thahc/0zhXOY9qlHD1SSp9lQOtG5HjWGL/7dqnlFjqL1/YsiHUYByNo+6mgNLkxV3p6U RfL6A2HepzBInkrjkCUSYRUE1Jv0UM72YLFjGpaj3xDKQEhwOvHam0Au3aOZ3vc1bkOv XHog+VMigQ4eCHAfiGf5YGfgTGPQEquGI3Kk+8/TwT0RVr7WfiAoF9+B88gM5J3hcV4L estg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wQf3XP4BZfuzc3ylEELAJ2OjaNg6jTxSBCBJwv6w5qM=; b=CRc465NlGM7gHufFXrromHbTcLSBxlD5WLfh4AyhWAYsTFu647MXyaszFOcjn/lxAy IhLFZrXFsZqtlWFcNVJcyEoIIHt0KKT0Y1ZPrqU/ww5z0EoOz/g3T/tAi47NUGGfkjoz kb8JOnw5BTmCRlVH1NB6PNePAkZZcS4Eq+WRR40FC+67Ylc956b/htJnq4JrJMm29g93 njLsa9YukvtBcuQiyuYEN6O4BqLzPgSYMnP+GwQv6Y1pgFbc4RNmQFUiSKaoK9EWdKzI rrq78rS7OrvRp3rvItYRDUC3O7SdqL2hW51QBGIcndB98HSfxrRquaM6ZG38Wp+XIl7L r+KQ== X-Gm-Message-State: AOAM532hzGZtYKY5q/uSfNHI0MjfgIbj7e2WQwYXpEp4D6dbqeX9koNp fSLKv4PiSYcUg0ImFYRbEZpg2w== X-Received: by 2002:a2e:5810:: with SMTP id m16mr2204599ljb.261.1644619208126; Fri, 11 Feb 2022 14:40:08 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id a6sm3319983ljb.93.2022.02.11.14.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 14:40:07 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH v2 1/5] drm/msm/dp: fix panel bridge attachment Date: Sat, 12 Feb 2022 01:40:02 +0300 Message-Id: <20220211224006.1797846-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211224006.1797846-1-dmitry.baryshkov@linaro.org> References: <20220211224006.1797846-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In commit 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") the DP driver received a drm_bridge instance, which is always attached to the encoder as a root bridge. However it conflicts with the panel_bridge support for eDP panels. The panel bridge attaches to the encoder before the "dp" bridge has a chace to do so. Change panel_bridge attachment to come after dp_bridge attachment. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Cc: Kuogee Hsieh Signed-off-by: Dmitry Baryshkov Tested-by: Kuogee Hsieh Reviewed-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_drm.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index d4d360d19eba..26ef41a4c1b6 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -169,16 +169,6 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) drm_connector_attach_encoder(connector, dp_display->encoder); - if (dp_display->panel_bridge) { - ret = drm_bridge_attach(dp_display->encoder, - dp_display->panel_bridge, NULL, - DRM_BRIDGE_ATTACH_NO_CONNECTOR); - if (ret < 0) { - DRM_ERROR("failed to attach panel bridge: %d\n", ret); - return ERR_PTR(ret); - } - } - return connector; } @@ -246,5 +236,16 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi return ERR_PTR(rc); } + if (dp_display->panel_bridge) { + rc = drm_bridge_attach(dp_display->encoder, + dp_display->panel_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (rc < 0) { + DRM_ERROR("failed to attach panel bridge: %d\n", rc); + drm_bridge_remove(bridge); + return ERR_PTR(rc); + } + } + return bridge; }