From mboxrd@z Thu Jan 1 00:00:00 1970 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 7AE8DC433EF for ; Fri, 18 Feb 2022 23:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239837AbiBRX5O (ORCPT ); Fri, 18 Feb 2022 18:57:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235407AbiBRX5O (ORCPT ); Fri, 18 Feb 2022 18:57:14 -0500 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 198E25B3E2 for ; Fri, 18 Feb 2022 15:56:55 -0800 (PST) Received: by mail-oi1-x232.google.com with SMTP id y7so4812229oih.5 for ; Fri, 18 Feb 2022 15:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=haJuFFTFpK8hEVGyrQHNZT48/0gIUU8knpfQcqZph0U=; b=doa6V5p8QeWkqR4Q5ZT2DQZYInLatLb4EV+ktRjUzUFW/Niipkg0hJz3nSMMhAEvwd feyZ4nSc/Z91e6nxX6Hk+V+Zn5qvO6h05AKrOeD3FD8d+2ce4yJ4tojYpOxYwa+Yg9Pl 3tEUFCcZtYSB2hl1ciNo+OLvSasKPesX+0NlE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=haJuFFTFpK8hEVGyrQHNZT48/0gIUU8knpfQcqZph0U=; b=eQn/glIQVR77+KmKeq4i2IJpGf0oHJ3Z5RpHd1fTVFU0f9y/TaCiNLQ9BpYkuTJmrL awgUUHr5VZBZmFOzwPSuvWOJSvAkhW5QsqYGKWCzJcVyZ5u61GN9wJbZee8D7GrA6lKj G9YxK+MFXkd/Ik07/EGMqgxHudsBPgUk85Lxfum4UgXPwb6oujAYCM1P92OtAYwKrllz itEXvxNxTVyBUN1JAtRsVNuyQoT+QQWliqziIQoFBUWdit3rYPULV4AhdCwztnp8CBna lYFlXz8MMJYTOknTxDkSJgfYt+OdW2YVrbnErGlxoSqPKbodQ3s+iNG9OkNgcolP6572 +ApQ== X-Gm-Message-State: AOAM530hga5E+NtnpRfXj8m2c6OPUD4gTAr9Vb2k26qT2MoyAZH3dX5i CW8y4bmfBNSv/BhdpO/H83pYRKMSusfbDIX6IHaIbg== X-Google-Smtp-Source: ABdhPJycjVhIt7LaJC6nw+2gP/RssZ5zR7b6sFNM/Q/O18LuQGxLRPdyc01dAmOYShVxdMIldPKkbH4O0zTKx4U/UuA= X-Received: by 2002:aca:df44:0:b0:2ce:285f:cb99 with SMTP id w65-20020acadf44000000b002ce285fcb99mr6100266oig.40.1645228614405; Fri, 18 Feb 2022 15:56:54 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 18 Feb 2022 15:56:53 -0800 MIME-Version: 1.0 In-Reply-To: <20220211224006.1797846-2-dmitry.baryshkov@linaro.org> References: <20220211224006.1797846-1-dmitry.baryshkov@linaro.org> <20220211224006.1797846-2-dmitry.baryshkov@linaro.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 18 Feb 2022 15:56:53 -0800 Message-ID: Subject: Re: [RFC PATCH v2 1/5] drm/msm/dp: fix panel bridge attachment To: Abhinav Kumar , Bjorn Andersson , Dmitry Baryshkov , Kuogee Hsieh , Rob Clark , Sean Paul Cc: David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Quoting Dmitry Baryshkov (2022-02-11 14:40:02) > 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 s/chace/chance/ > panel_bridge attachment to come after dp_bridge attachment. s/panel_bridge/panel bridge/ possibly? And maybe clarify that dp_bridge is the "DP driver's drm_bridge instance created in msm_dp_bridge_init()"? My understanding is that we want to pass the bridge created in msm_dp_bridge_init() as the 'previous' bridge so that it attaches the panel bridge to the output of the DP bridge that's attached to the encoder. > > Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") > Cc: Kuogee Hsieh > Signed-off-by: Dmitry Baryshkov > --- 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; Not a problem with this patch, but what is this pointer used for? I see it's assigned to priv->bridges and num_bridges is incremented but nobody seems to look at that. From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D5F7C433F5 for ; Fri, 18 Feb 2022 23:56:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2351B10E18E; Fri, 18 Feb 2022 23:56:56 +0000 (UTC) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C47710E18E for ; Fri, 18 Feb 2022 23:56:55 +0000 (UTC) Received: by mail-oi1-x235.google.com with SMTP id ay7so4783883oib.8 for ; Fri, 18 Feb 2022 15:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=haJuFFTFpK8hEVGyrQHNZT48/0gIUU8knpfQcqZph0U=; b=doa6V5p8QeWkqR4Q5ZT2DQZYInLatLb4EV+ktRjUzUFW/Niipkg0hJz3nSMMhAEvwd feyZ4nSc/Z91e6nxX6Hk+V+Zn5qvO6h05AKrOeD3FD8d+2ce4yJ4tojYpOxYwa+Yg9Pl 3tEUFCcZtYSB2hl1ciNo+OLvSasKPesX+0NlE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=haJuFFTFpK8hEVGyrQHNZT48/0gIUU8knpfQcqZph0U=; b=YRTXoWc7TYM0H//8Slhi1d/SjyTIrruZTpFsJ3K9wciNGnjTNxHk1UdYBHRnqscATh jd3wg6QB+qCKA3epWSykfBonpOefXgD0jpuiHXt6FrnCYsoKyzAruOrpOUSAVu54W6BU yfDjDazoN5CCJo9jyFjBSVOa4Jj3jUxBOsYBk9nhKqNLFLX71icv3VtSE5Q00UiMrr2R C16vSDMN/vN5uK5NPxs14IRZI1Hav6Hnr2J1uf1I5uOj39PAY5YUYsINiqD95pSUZOB2 nx75c6B3VsVGWGYQzyFN16lMVQdH8PPSzMSGOVZs3HSJGYA4O9OntjONoZhQDWMTKZRR lSOQ== X-Gm-Message-State: AOAM5322G+MJF5k20tPoPJ4N9gneC+A81eGrGq6sUamKSCDr5x4NDryd mOQcvu9uM4x8WDGqv2+FQP0dmqxME0KFQORM2VcZHw== X-Google-Smtp-Source: ABdhPJycjVhIt7LaJC6nw+2gP/RssZ5zR7b6sFNM/Q/O18LuQGxLRPdyc01dAmOYShVxdMIldPKkbH4O0zTKx4U/UuA= X-Received: by 2002:aca:df44:0:b0:2ce:285f:cb99 with SMTP id w65-20020acadf44000000b002ce285fcb99mr6100266oig.40.1645228614405; Fri, 18 Feb 2022 15:56:54 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 18 Feb 2022 15:56:53 -0800 MIME-Version: 1.0 In-Reply-To: <20220211224006.1797846-2-dmitry.baryshkov@linaro.org> References: <20220211224006.1797846-1-dmitry.baryshkov@linaro.org> <20220211224006.1797846-2-dmitry.baryshkov@linaro.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 18 Feb 2022 15:56:53 -0800 Message-ID: Subject: Re: [RFC PATCH v2 1/5] drm/msm/dp: fix panel bridge attachment To: Abhinav Kumar , Bjorn Andersson , Dmitry Baryshkov , Kuogee Hsieh , Rob Clark , Sean Paul Content-Type: text/plain; charset="UTF-8" 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, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Quoting Dmitry Baryshkov (2022-02-11 14:40:02) > 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 s/chace/chance/ > panel_bridge attachment to come after dp_bridge attachment. s/panel_bridge/panel bridge/ possibly? And maybe clarify that dp_bridge is the "DP driver's drm_bridge instance created in msm_dp_bridge_init()"? My understanding is that we want to pass the bridge created in msm_dp_bridge_init() as the 'previous' bridge so that it attaches the panel bridge to the output of the DP bridge that's attached to the encoder. > > Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") > Cc: Kuogee Hsieh > Signed-off-by: Dmitry Baryshkov > --- 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; Not a problem with this patch, but what is this pointer used for? I see it's assigned to priv->bridges and num_bridges is incremented but nobody seems to look at that.