Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3759402pxk; Tue, 22 Sep 2020 01:34:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjlfhgEsDQIxwaGm9DtIbq2jKHp5YYHr9FqxiwU2TqziddZxwZaRcVHPog+HFZ4MQkUKWy X-Received: by 2002:a17:906:3552:: with SMTP id s18mr3669260eja.23.1600763683467; Tue, 22 Sep 2020 01:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600763683; cv=none; d=google.com; s=arc-20160816; b=c+r8dEdp+/zDA6HUlzgGdruG/jZy2tBvrkJsOcMYs9cpNYTR92yFPpk/vr2DQuiJZH QWTTsEp2wqjm4FQVgIb8qavqDXjPn9SmQZrG0sJxzidUzwC46gSCWbb2c+szwLSZ8WSK MSTxZW3r6GmxZ7s2FzY5OC7eGsczAKNWlcjO6uiy/A+k9L2bO6IM+jAGolwJeM2B0xI7 oZm0WWIHujKGwUkYpiYz8+i52O/0GU5FQuhYg4EGR9L0zqgb7dJ/uVki0zj9xwSaoCyZ q+MewAIFzMLXa6PdQGwrvoruC6sPBQtYNeElq4MemM3L7qCpQoHx2foZnx+FZ5Sv4ETh Jo4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=KdoGIl1yU6ytmBIfhkEKpDjTjVXRjNQ+L3QzfJwexIY=; b=VtolRyO5gCRkt5v+dPiF8vktwecZ/E71w/RdGdXnGb85bLjs+QhdTlMWiNygfCcuV2 RNgTEVIcnmg86eATeABu5leopyFwfx0br7em8xksCOjvcZmIJAgVMcHO/xdwIO2e0TxU JlDH2EO9oqSJ0bBXVxCzKJQlq5MxJ/1Jp4e7EuBuEDv9ZmafxwYcS7lmEjEJ9YcIVxfO 9e+BjS1oifNZZ7Wqybbntb0fl9O6j6u63EwbVZkPcyclhroQr6/AsA5k7EIew22jwJG6 w0+CmgQWV2vONgItSkulhmDn8V8aRuHvM1t7x7x6CAT4zKOdzFIaBVCCUL2H2aely0Jv xEdw== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy18si10293752edb.148.2020.09.22.01.34.20; Tue, 22 Sep 2020 01:34:43 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730027AbgIVHht (ORCPT + 99 others); Tue, 22 Sep 2020 03:37:49 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:58287 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729906AbgIVHhr (ORCPT ); Tue, 22 Sep 2020 03:37:47 -0400 Received: from mail-oi1-f198.google.com ([209.85.167.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kKcrx-0006Gw-3D for linux-kernel@vger.kernel.org; Tue, 22 Sep 2020 07:37:45 +0000 Received: by mail-oi1-f198.google.com with SMTP id v21so7620780oif.1 for ; Tue, 22 Sep 2020 00:37:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KdoGIl1yU6ytmBIfhkEKpDjTjVXRjNQ+L3QzfJwexIY=; b=T2EbVNZjWw6h4Ali6qMVBXAiDpXhgKk6P3Cl0Ntq3eHGxge+I4AoN8M26WXC2xFzPD j2iaLSKsEWJO4LCUXvjqoI41EYosTY7gZpMS2NyfnawMRe5pitpSoHbdn6IQ0LIoB70b IPyYILZDmS4BC7dV9WZ1kn/4JiN5WkIQNO+ZE9DXSFS1FnSLP59QgF6dvElBHEa6ju86 EhMBtZ8eymm6V2vKYqYDQfOSbaGNLZqjmD7r72MnvrI0Hxh2TxpsaUid5hIOU4jSpxYo uB0HiLlLx/hfNg/scxjdQuJMA/0+6ukH9GNU9u2UQ9cqHlCICPXEAyAvz7ancxJjq76S ITbA== X-Gm-Message-State: AOAM531zM6xQuez6AJ7Zk8CwSYYTJz2Hn/Xktalmr58Yxgiql1rDjRb9 tom7IODKO7RWvmN/KMOJbkwzwkZkVhg/S4bqlGNMla9/8AeMoVTwNBztGNQPbeaRvuB4M53rVly aM3FzeqP6CNYsM4C3C/1ury9KcU7MGfOIePoQvlrDE5YGxCVXVPeyzR+Cjw== X-Received: by 2002:aca:603:: with SMTP id 3mr1880713oig.49.1600760263786; Tue, 22 Sep 2020 00:37:43 -0700 (PDT) X-Received: by 2002:aca:603:: with SMTP id 3mr1880697oig.49.1600760263461; Tue, 22 Sep 2020 00:37:43 -0700 (PDT) MIME-Version: 1.0 References: <20200911034431.29059-1-koba.ko@canonical.com> <5f99b65c8a092df343c68249f2bce62e4cd0abff.camel@redhat.com> In-Reply-To: <5f99b65c8a092df343c68249f2bce62e4cd0abff.camel@redhat.com> From: Koba Ko Date: Tue, 22 Sep 2020 15:37:32 +0800 Message-ID: Subject: Re: [PATCH v3] drm/dp_mst: Retrieve extended DPCD caps for topology manager To: Lyude Paul , Maarten Lankhorst , Maxime Ripard , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Anthony Wong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2020 at 2:11 AM Lyude Paul wrote: > > Hi, sorry I lost track of this until just now. Comments down below: > Sorry, the wrong base. I will modify it based on v2 and will send v4. > On Fri, 2020-09-11 at 11:44 +0800, Koba Ko wrote: > > 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 > > Reviewed-by: Lyude Paul > > --- > > Changelog: > > 1. Adjust the commit message. > > 2. use drm_dbg_kms instead and print the return code. > > --- > > drivers/gpu/drm/drm_dp_mst_topology.c | 14 +++----------- > > 1 file changed, 3 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > > b/drivers/gpu/drm/drm_dp_mst_topology.c > > index 7753c718ddf9..63f8809b9aa4 100644 > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > @@ -3671,8 +3671,6 @@ EXPORT_SYMBOL(drm_dp_read_mst_cap); > > 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); > > @@ -3686,17 +3684,11 @@ 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); > > > Uh, are you sure you formatted this patch correctly? None of these hunks are present upstream, this looks like it's a diff for the previous version of this patch that you sent out > > > > /* get dpcd info */ > > - 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"); > > + ret = drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd); > > + if (ret < 0) { > > + drm_dbg_kms(mgr->dev, "failed to read DPCD, ret %d\n", > > ret); > > goto out_unlock; > > } > > > -- > Cheers, > Lyude Paul (she/her) > Software Engineer at Red Hat >