Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1144414lqp; Fri, 22 Mar 2024 06:57:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUnaGnXuKn6QJOX74TDzSxD5x4ccW6ygHp4D0S8m8n6tPGOs7LRi37xDld+Vo3FWOMqiOiYp1Ha5yw7hMBvPV89yi+0d5ixdiUSRPiZuw== X-Google-Smtp-Source: AGHT+IG/5dOn9CydJ6Gc2toR0DUJvN6zdXc0e8dMx1Nd4Lprd2BRwqmdEypXT22yKztc1uiKdgaN X-Received: by 2002:a05:6a20:9145:b0:1a3:ae12:e610 with SMTP id x5-20020a056a20914500b001a3ae12e610mr522617pzc.35.1711115879276; Fri, 22 Mar 2024 06:57:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711115879; cv=pass; d=google.com; s=arc-20160816; b=T2d7NOhUTb4w7fv+Xcfug0zsmlrSwVhf6NacLavQyJpkS32X9Ri4Fl1tUijqJ+oAZh xZDFTboWZf7jLyS4OiaJGg3Hcn/ly6Pkz23M7OMtGpqA94CxuhpYJlwXrKWNvLLonCWV mHEPDDPbNqD4SdfiUlPK9D/nlaOthc6t4bzq5NuHkgmLLQHQcrXTFossshvuMDyGgvlT nKDaHYe7MU3D8keVxSyzpdIFzxxCD9F73PH61eGmJVByebhLgJbQnefZcp3lFIaLlq0t Wj1WR4dzsGxZugljRFCZQlJDNq14x7IZ/uqETkZ7igt3YFe8LMyKga9w35ni+v8063TN l+9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=rm06Pm0qxCAJG4WaEyynyhO+EGvdCO+QoEXFmaLzGV8=; fh=iELN7ZAsfcJvZgKAzXqnnVWPX536bCUtLM4wS9/pbnQ=; b=xkVudUZv08EbqPAqk4wHnITi7SypbPQd6Ht4Qta9ZEpIUoIVqxv8mXOe1DMxD+haM0 WYLI4vGc0Hl1iSkzfpVcMKrJwQuHNH5pAXwyERT6fRvVlS98IcwzMJF/5mBkxuE6WWJG vn4TdnE3+toU/u0anhynu0vHqF7piZBfm6+Nc0dz4JO4i5z69dHP0mestSOiU9tyyvR3 0D5W5xvG3dhE3lUTnPs/WEjF4WcxRIRu7I1q/7SmNmO0JjMNVv62nz7dhLHv4kIPISx+ k4S75jE3/EmmWjgX7AOX78GFGqSJ2WLKX/M0wcujgHBkznXnTpKmk5zZ2eU4WsAuJ7hW z44g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVbYWOiQ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-111556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jw7-20020a056a00928700b006e6fc52ecd9si2106012pfb.109.2024.03.22.06.57.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 06:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVbYWOiQ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-111556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 63970B27619 for ; Fri, 22 Mar 2024 13:44:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B064A482CF; Fri, 22 Mar 2024 13:38:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hVbYWOiQ" Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D85B2482D1 for ; Fri, 22 Mar 2024 13:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711114698; cv=none; b=ZMjdRxwbxe659L3p+1tRQCJ/fxQbz/ssLSJiu+eqT9xKM/CsjIO/mlscOuZM/Jq5LHj++eIqUVONz8rWYG9i/Vp8sIJrJ60Ae7DAi6G86TUkSpup6vHospn6w0AGf5kvprYpZylGFqdraLapTPY6XjtM/k7dj9xiEqqBT/uSCOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711114698; c=relaxed/simple; bh=KowDJLlEkfi/aydE2rcjItRSORmHokir7LGxDFTw0+s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BG1bWhJHQiWbNmnzJRZfyQSJ70nvPj8nDgy4wUqfycr2TTSCqxO0LiwaRdb3gP6guSIIHh7z3ztd0galB2t4/tGgUtjtY8xZQ3QFLZU1x5IHg4inEuXSjnXiTqfRniifKtNYdUJgnEW7o4pGLIgrKoozCoo3Z2hjvB8wPYX+55U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hVbYWOiQ; arc=none smtp.client-ip=209.85.219.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-dcd7c526cc0so2232691276.1 for ; Fri, 22 Mar 2024 06:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711114695; x=1711719495; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rm06Pm0qxCAJG4WaEyynyhO+EGvdCO+QoEXFmaLzGV8=; b=hVbYWOiQPeQqePavX4DO/9xF+6KwCYjAGJ0jyIw9D68o4ZfDI9im/igWzt+RHkIP6C U4ZyUCBD1irVW7+MOtkehG620qnTEBHMjZD5jCZcf6nrhBcMk50YwVMZelh89MTTyemG vMrEhTwKj1I+LpCiEv9/rLqnjWpPzQ0iRxBIXps2cTwrzjZBY/nbR4ON5Fn4m+T4Mafz bPQs/5fWCcIOtDupyuNzCVPxAMdWT7hURgH31ZrBGMU6tUJoqXPVLeACttFaWj8iLgUT FketKyNd7b3avsJPk0l2TJPmsOpegVFHhMDit2ocmclSchM0Hm9ZyVXAUiyqW9r/HMnz 2Akg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711114695; x=1711719495; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rm06Pm0qxCAJG4WaEyynyhO+EGvdCO+QoEXFmaLzGV8=; b=ZIE7kDb18JLmCumpa9LtHA4Rz5bwDaDcDbR0/2QJFCA9yZznc71A2XKXjAvjBrReKK sqnYcPsDr8Ooln1CyDfGR7GHc4FP+5Qocw6CJQ0c9t/XH3x0yYzyZ+zcYWF1X+nfQ1Lp pi8+PQB9rs/r/vRKB2KzYslbmX6AdFubsMDBzSTZ1pL2AN72KgApX5qCLciNODi8uHLt YmuO4+nCPITaJhmYgZWPacVWu3+0lSqnOGX2GjSns0QtgEH7/djs3YAdeGHP6y4CpJh3 hj9217IBjMlv0JXxbpeih0wdWU6BjKO9GWDl8mzhiF0kgHnOsWk01v6bGEVUS2dkeTGh kVNA== X-Forwarded-Encrypted: i=1; AJvYcCUunW8tX7KCBhqT7urkvYH0FCC+SxiuEnS5oU01WTSagiwK6AUjlYAZyq4l4y0i5I44ovzCRh4gqbovaSLbo++W7s7Z7XJBMZPcwFNv X-Gm-Message-State: AOJu0Ywx9dtxi339VxWI30PohsmsjJ4puqi+haPIeEU+h4/c+P+JOpYz 5DtFBb8BsEdg2oDdSfI8mFZ3TNwyMLo97DBoZsDYdsNsc4po1sh8WkqFJDSAi16CCWw6ARlrR2s 4Jp5pNtgY2EnBCSVt+Htjn/O/GCik668XC3t3sw== X-Received: by 2002:a5b:911:0:b0:dcf:3ef2:6182 with SMTP id a17-20020a5b0911000000b00dcf3ef26182mr2103274ybq.0.1711114694919; Fri, 22 Mar 2024 06:38:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240322-x1e80100-display-refactor-connector-v3-0-af14c29af665@linaro.org> <20240322-x1e80100-display-refactor-connector-v3-1-af14c29af665@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Fri, 22 Mar 2024 15:38:03 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] drm/msm/dp: Add support for determining the eDP/DP mode from DT To: Abel Vesa Cc: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kuogee Hsieh , Bjorn Andersson , Konrad Dybcio , Johan Hovold , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Fri, 22 Mar 2024 at 15:36, Abel Vesa wrote: > > On 24-03-22 15:30:54, Dmitry Baryshkov wrote: > > On Fri, 22 Mar 2024 at 15:22, Abel Vesa wrote: > > > > > > Instead of relying on different compatibles for eDP and DP, lookup > > > the panel node in devicetree to figure out the connector type and > > > then pass on that information to the PHY. External DP is not described > > > > Nit: External DP doesn't have a panel described in DT... > > > > Will fix. > > > > in DT, therefore, assume it's eDP if panel node is present. > > > > > > Signed-off-by: Abel Vesa > > > --- > > > drivers/gpu/drm/msm/dp/dp_display.c | 43 +++++++++++++++++++++++++++++++++---- > > > 1 file changed, 39 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c > > > index c4cb82af5c2f..c9763f77c832 100644 > > > --- a/drivers/gpu/drm/msm/dp/dp_display.c > > > +++ b/drivers/gpu/drm/msm/dp/dp_display.c > > > @@ -726,6 +726,14 @@ static int dp_init_sub_modules(struct dp_display_private *dp) > > > if (IS_ERR(phy)) > > > return PTR_ERR(phy); > > > > > > + rc = phy_set_mode_ext(phy, PHY_MODE_DP, > > > + dp->dp_display.is_edp ? PHY_SUBMODE_EDP : PHY_SUBMODE_DP); > > > + if (rc) { > > > + DRM_ERROR("failed to set phy submode, rc = %d\n", rc); > > > + dp->catalog = NULL; > > > + goto error; > > > + } > > > + > > > dp->catalog = dp_catalog_get(dev); > > > if (IS_ERR(dp->catalog)) { > > > rc = PTR_ERR(dp->catalog); > > > @@ -734,9 +742,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp) > > > goto error; > > > } > > > > > > - dp->aux = dp_aux_get(dev, dp->catalog, > > > - phy, > > > - dp->dp_display.is_edp); > > > + dp->aux = dp_aux_get(dev, dp->catalog, phy, dp->dp_display.is_edp); > > > > Unrelated > > > > Yep, will drop the change. > > > > if (IS_ERR(dp->aux)) { > > > rc = PTR_ERR(dp->aux); > > > DRM_ERROR("failed to initialize aux, rc = %d\n", rc); > > > @@ -1241,6 +1247,35 @@ static int dp_auxbus_done_probe(struct drm_dp_aux *aux) > > > return dp_display_probe_tail(aux->dev); > > > } > > > > > > +static int dp_display_get_connector_type(struct platform_device *pdev, > > > + const struct msm_dp_desc *desc) > > > +{ > > > + struct device *dev = &pdev->dev; > > > + struct device_node *aux_bus; > > > + struct device_node *panel; > > > + int ret = DRM_MODE_CONNECTOR_DisplayPort; > > > + > > > + /* legacy platforms specify connector type in match data */ > > > + if (desc->connector_type == DRM_MODE_CONNECTOR_eDP || > > > + desc->connector_type == DRM_MODE_CONNECTOR_DisplayPort) > > > > misaligned > > > > Sure, will fix. > > > > + return desc->connector_type; > > > > Can we drop this part completely? > > > > You mean the whole if clause? How should we handle the legacy approach > then? Legacy platforms still have the aux-bus/panel. so they should be handled by the check below. > > > > + > > > + aux_bus = of_get_child_by_name(dev->of_node, "aux-bus"); > > > + if (!aux_bus) > > > + goto out; > > > + > > > + panel = of_get_child_by_name(aux_bus, "panel"); > > > + if (!panel) > > > + goto out; > > > + > > > + ret = DRM_MODE_CONNECTOR_eDP; > > > + > > > +out: > > > + of_node_put(panel); > > > + of_node_put(aux_bus); > > > + return ret; > > > +} > > > + > > > static int dp_display_probe(struct platform_device *pdev) > > > { > > > int rc = 0; > > > @@ -1263,7 +1298,7 @@ static int dp_display_probe(struct platform_device *pdev) > > > dp->dp_display.pdev = pdev; > > > dp->name = "drm_dp"; > > > dp->id = desc->id; > > > - dp->dp_display.connector_type = desc->connector_type; > > > + dp->dp_display.connector_type = dp_display_get_connector_type(pdev, desc); > > > dp->wide_bus_supported = desc->wide_bus_supported; > > > dp->dp_display.is_edp = > > > (dp->dp_display.connector_type == DRM_MODE_CONNECTOR_eDP); > > > > > > -- > > > 2.34.1 > > > > > > > > > -- > > With best wishes > > Dmitry -- With best wishes Dmitry