Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp522387pxk; Wed, 9 Sep 2020 11:21:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP7vPJZ/mBU/xcvYVN+da+ga8uXK8i1B6CQXwy9t/MCCwKiep/OdgduqfCrMegOATXzcAr X-Received: by 2002:a17:906:3495:: with SMTP id g21mr4749812ejb.121.1599675692573; Wed, 09 Sep 2020 11:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599675692; cv=none; d=google.com; s=arc-20160816; b=dMKmxu+VonL6GPDuRkA+5RzWIXXupEXzsM2fG2vilHcbwTtyGdXgDieKuQc76y1yvl WL4GtZsYADLLPFJoX8zZzyGi98BRmPemk7MGwI/TtFIXroTQ/igPaWBOrT53HHHrthea buv94qpOAgN2sKtbYbx4NEqAv2rf9ixVwv4BNjS1x4I9b9w/N710zSdvyR7Q62jxjhdA avlF/if98zlr39HNXHBjNjWwR8kcQ4g/hlj0whK9k+wYjcnDp3ZltxlLpC0AZZPDCBtG WKpgvNNGbpsJUfOTWM2igk5q+Qvi8wzH8CsUKpYNzku1COhNZlFf5Gfj9nzsiv+zX1zi 7/KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=u0jPBQxXfswHu9hpkpa4sMcHZl+QB7R2gswCf9ua2yc=; b=hzm72qJWfP7d3r2AekMDNGFgAo75L4X/N5/PydyjYQ7ko8NUHaV4VUgFq2PA0bGhmF QFpJ0CuLCZPFvRaRQlFoimHeY+YfXfO8ajlatjxE3HNt0TPE4Ej2vQ9ilraR/xn7DVhY GOj8khJzgFenD5m8fOdB9Hdl/oPj6jH/oPjKTxqxzuuVyZiLdUQGPmfpU435PMpIWqMV G0NLID94HUfskpJZjbk7tDQ/AICGl/1dndaZKGi3V69k7GtclLg+iirmxoO9kb5DA4Yp 1o7KxFAIyXti10K+iMGaTpP0KFvedp2hWEhmiHh2bHp3sCqB914ASe6pX6n4QyqmYxg8 0qAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si2045755eji.99.2020.09.09.11.21.10; Wed, 09 Sep 2020 11:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728405AbgIISUQ (ORCPT + 99 others); Wed, 9 Sep 2020 14:20:16 -0400 Received: from mga05.intel.com ([192.55.52.43]:15400 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbgIISUQ (ORCPT ); Wed, 9 Sep 2020 14:20:16 -0400 IronPort-SDR: XdmjDk4Of8qkiVFpoRvI7z8V6sr6lu5b3DTfpc4XvtSXnPumbqP6OJ8nLzCKBI6QAljnK2tHYL MTqrEKoWYUiQ== X-IronPort-AV: E=McAfee;i="6000,8403,9739"; a="243208633" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="243208633" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 11:20:15 -0700 IronPort-SDR: cSPFvWkeYJDKN+Z0GgBxBfjV5HB1QVMzc0QvYXiLFB/PK957/GoRXZ75RkdqM9wRMgBPzP2eWt Vhus2SZT4sfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341655830" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 09 Sep 2020 11:20:11 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 09 Sep 2020 21:20:10 +0300 Date: Wed, 9 Sep 2020 21:20:10 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lyude Paul Cc: Koba Ko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List , Anthony Wong Subject: Re: [PATCH] drm/dp: For MST hub, Get max_link_rate&max_lane from extended rx capability field if EXTENDED_RECEIVER_CAPABILITY_FILED_PRESENT is set. Message-ID: <20200909182010.GO6112@intel.com> References: <20200827053053.11271-1-koba.ko@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 12:33:09PM -0400, Lyude Paul wrote: > We just added a new helper for DPCD retrieval to drm_dp_helper.c (which also > handles grabbing the extended receiver caps), we should probably make use of > it here Someone should really rework this whole thing so that the driver can pass in the link rate+lane count when setting up the link. There's no reason to assume that the source device capabilities match or exceed the MST device caps. It would also allow the driver the dynamically adjust these in response to link failures. > On Wed, 2020-09-09 at 14:31 +0800, Koba Ko wrote: > > On Thu, Aug 27, 2020 at 1:30 PM Koba Ko wrote: > > > Currently, DRM get the capability of the mst hub only from DP_DPCD_REV and > > > get the slower speed even the mst hub can run in the faster speed. > > > > > > As per DP-1.3, First check DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT. > > > If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 1, read the DP_DP13_DPCD_REV > > > to > > > get the faster capability. > > > If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 0, read DP_DPCD_REV. > > > > > > Signed-off-by: Koba Ko > > > --- > > > drivers/gpu/drm/drm_dp_mst_topology.c | 10 +++++++++- > > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > > > b/drivers/gpu/drm/drm_dp_mst_topology.c > > > index 67dd72ea200e..3b84c6801281 100644 > > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > > @@ -3497,6 +3497,8 @@ static int drm_dp_get_vc_payload_bw(u8 dp_link_bw, > > > u8 dp_link_count) > > > int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, > > > bool mst_state) > > > { > > > int ret = 0; > > > + u8 dpcd_ext = 0; > > > + unsigned int dpcd_offset = 0; > > > struct drm_dp_mst_branch *mstb = NULL; > > > > > > mutex_lock(&mgr->payload_lock); > > > @@ -3510,9 +3512,15 @@ int drm_dp_mst_topology_mgr_set_mst(struct > > > drm_dp_mst_topology_mgr *mgr, bool ms > > > struct drm_dp_payload reset_pay; > > > > > > WARN_ON(mgr->mst_primary); > > > + drm_dp_dpcd_read(mgr->aux, > > > + DP_TRAINING_AUX_RD_INTERVAL, > > > + &dpcd_ext, sizeof(dpcd_ext)); > > > + > > > + dpcd_offset = > > > + ((dpcd_ext & > > > DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT) ? DP_DP13_DPCD_REV : > > > DP_DPCD_REV); > > > > > > /* get dpcd info */ > > > - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, > > > DP_RECEIVER_CAP_SIZE); > > > + ret = drm_dp_dpcd_read(mgr->aux, dpcd_offset, mgr->dpcd, > > > DP_RECEIVER_CAP_SIZE); > > > if (ret != DP_RECEIVER_CAP_SIZE) { > > > DRM_DEBUG_KMS("failed to read DPCD\n"); > > > goto out_unlock; > > > -- > > > 2.25.1 > > > > > Add Lyude Paul > > > -- > Cheers, > Lyude Paul (she/her) > Software Engineer at Red Hat > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel