Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1362749imm; Tue, 2 Oct 2018 07:07:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV605mMxQK3QCwg8Paf582ZeQc4raoXVRuSNHK8oZmh8PE4Qi2+MDVpVCcmShvbq9nRrApOF3 X-Received: by 2002:a63:f553:: with SMTP id e19-v6mr14699387pgk.417.1538489223856; Tue, 02 Oct 2018 07:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538489223; cv=none; d=google.com; s=arc-20160816; b=sTaH2+rhx4bKV1s08s0qRPmKiWEMCENyE0UlxR1EDHObkdnbw68oaSV7GwnIubkW06 HuoOeXYjuLfwNGQD4S2GUpY82aj2AKibmMI4pO6B5lvAVDi4gLkzxfRsAaEjIfmYHRY/ CtF3pfXqQTu0vbdRdpmC6cWtC/SmHZ/upW8pq3XkCgid8BDlNFeuvA4HImQFkSF4qI6h svFt8JC91Aq+ZCG2YwtsBm3B9rRygBObycWYYhkwvSdMxnuCUoqjoNg8yV3o3yTo+x8P 1h2vMpm04Bzzc3VVvTuGNbD5J1PVZXvik3sNxr3Yod1aWEksjqEQgQ3hOOMbysJ9627H 0xaw== 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; bh=4W/Sa1LcANKc8bM886/Z7Q3Kmo1o8vYE7jtiHbIbwkk=; b=0p4h4t+79/EAgjEfEXuN9hJY8A9E1m5JfIVhPuzDZy4sNJ/VfRs/m+8jp6ejsK/jSq dHGx0alvM5eqvWCcBvUrRJZRXU69oUB9elXCubCsEIqOTYCqMGck+DzmhEuyOKXL58dR Ua7W8qZ2nowJoiTWjd2J89u6ULaamKDP8A3BW+EKLPDHGutWHBrwAmVkuHFuK2ZpV+Kw pk2K/Is7GMIMrDFJn9EP1BIeMbBHeuJERT2GpDoiAg1DcHgp3gFWbiHEtFNUccmdULYv yu7QuYT5zkAHBtuDU935owsfaMMnHNSh8/8cjqLHDMhmz5Ar/DBIoHhs3cwBA+vtcEyo 1qHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a8-v6si15113472pgm.331.2018.10.02.07.06.48; Tue, 02 Oct 2018 07:07:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729694AbeJBUMU (ORCPT + 99 others); Tue, 2 Oct 2018 16:12:20 -0400 Received: from mga02.intel.com ([134.134.136.20]:51267 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729670AbeJBUMT (ORCPT ); Tue, 2 Oct 2018 16:12:19 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2018 06:28:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,332,1534834800"; d="scan'208";a="95771210" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 02 Oct 2018 06:28:50 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 02 Oct 2018 16:28:49 +0300 Date: Tue, 2 Oct 2018 16:28:49 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Quentin Schulz Cc: Manasi Navare , Mark Rutland , David Airlie , stelford@cadence.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, pgaj@cadence.com, Laurent Pinchart , jartur@cadence.com, ltyrala@cadence.com, linux-rockchip@lists.infradead.org, piotrs@cadence.com, devicetree@vger.kernel.org, jbergsagel@ti.com, Rob Herring , Sean Paul , Damian Kos , linux-arm-kernel@lists.infradead.org, Quentin Schulz Subject: Re: [PATCH v4 2/5] drm/dp: fix link probing for devices supporting DP 1.4+ Message-ID: <20181002132849.GR9144@intel.com> References: <1537455288-20223-1-git-send-email-dkos@cadence.com> <1537455288-20223-3-git-send-email-dkos@cadence.com> <20180921075929.GA28323@intel.com> <20181001092708.ow4rxgzp4haax76k@qschulz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181001092708.ow4rxgzp4haax76k@qschulz> 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 Mon, Oct 01, 2018 at 11:27:08AM +0200, Quentin Schulz wrote: > Hi Manasi, > > On Fri, Sep 21, 2018 at 12:59:30AM -0700, Manasi Navare wrote: > > Thanks for the patch. Verified with the DP 1.4 spec and looks good to me. > > Also look at the related patch that makes use of the correct extended capabilities: > > > > https://patchwork.freedesktop.org/patch/249400/ > > > > If I'm not mistaken, you could get rid of the patch in the Intel driver > when we have this one merged. Is there any reason not to, have I missed > something? i915 (and most other drivers) don't use this code. Also as mentioned in that thread you should probably validate that the data in the extended caps looks sane, otherwise the entire point of having it for compatibility with older source devices is lost. > > Thanks, > Quentin > > > Reviewed-by: Manasi Navare > > > > Manasi > > > > > > On Thu, Sep 20, 2018 at 03:54:37PM +0100, Damian Kos wrote: > > > From: Quentin Schulz > > > > > > DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in > > > DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from > > > DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from > > > DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV, > > > DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the > > > "true capabilities" of DPRX device. > > > > > > Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT > > > might falsely return lower capabilities to "avoid interoperability > > > issues with some of the existing DP Source devices that malfunction > > > when they discover the higher capabilities within those three > > > registers.". > > > > > > Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved > > > and read 0 so it's safe to check against it even if DP revision is > > > <1.4 > > > > > > Signed-off-by: Quentin Schulz > > > Signed-off-by: Damian Kos > > > --- > > > drivers/gpu/drm/drm_dp_helper.c | 30 +++++++++++++++++++++++++++++- > > > 1 file changed, 29 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > > > index 8c6b9fd89f8a..735ebde5c2f0 100644 > > > --- a/drivers/gpu/drm/drm_dp_helper.c > > > +++ b/drivers/gpu/drm/drm_dp_helper.c > > > @@ -370,10 +370,38 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link) > > > { > > > u8 values[3]; > > > int err; > > > + unsigned int addr; > > > > > > memset(link, 0, sizeof(*link)); > > > > > > - err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values)); > > > + /* > > > + * DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in > > > + * DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from > > > + * DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from > > > + * DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV, > > > + * DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the > > > + * "true capabilities" of DPRX device. > > > + * > > > + * Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT > > > + * might falsely return lower capabilities to "avoid interoperability > > > + * issues with some of the existing DP Source devices that malfunction > > > + * when they discover the higher capabilities within those three > > > + * registers.". > > > + * > > > + * Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved > > > + * and read 0 so it's safe to check against it even if DP revision is > > > + * <1.4 > > > + */ > > > + err = drm_dp_dpcd_readb(aux, DP_TRAINING_AUX_RD_INTERVAL, values); > > > + if (err < 0) > > > + return err; > > > + > > > + if (values[0] & DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT) > > > + addr = DP_DP13_DPCD_REV; > > > + else > > > + addr = DP_DPCD_REV; > > > + > > > + err = drm_dp_dpcd_read(aux, addr, values, sizeof(values)); > > > if (err < 0) > > > return err; > > > > > > -- > > > 2.17.1 > > > > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel