From patchwork Mon Feb 1 12:01:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 12058879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB4E0C433E9 for ; Mon, 1 Feb 2021 12:02:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8F78364E95 for ; Mon, 1 Feb 2021 12:02:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F78364E95 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00E7889DE1; Mon, 1 Feb 2021 12:02:01 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id A260E89DDD; Mon, 1 Feb 2021 12:01:59 +0000 (UTC) IronPort-SDR: se2IYS/+0nHF0cRx+DOixL73MhbHFmIrXSFXN1ECmWzqajjuu1zFXYGfAVVgxY01bMF45WeRX2 xc639x72V7pQ== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="178108174" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="178108174" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:01:57 -0800 IronPort-SDR: 5te+dSWzpMjVjVAiMVuT0uYTTW+X4Fm9d9PDwHyO2uO0y6kdDAkJIbTf+KhPwe3nBlIcjMOLQt +pchkhiYUWMw== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390880803" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:01:52 -0800 From: Imre Deak To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/dp_mst: Don't report ports connected if nothing is attached to them Date: Mon, 1 Feb 2021 14:01:42 +0200 Message-Id: <20210201120145.350258-1-imre.deak@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org, Wayne Lin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Reporting a port as connected if nothing is attached to them leads to any i2c transactions on this port trying to use an uninitialized i2c adapter, fix this. Let's account for this case even if branch devices have no good reason to report a port as unplugged with their peer device type set to 'none'. Fixes: db1a07956968 ("drm/dp_mst: Handle SST-only branch device case") References: https://gitlab.freedesktop.org/drm/intel/-/issues/2987 References: https://gitlab.freedesktop.org/drm/intel/-/issues/1963 Cc: Wayne Lin Cc: Lyude Paul Cc: # v5.5+ Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Imre Deak Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index e82b596d646c..deb7995f42fa 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -4224,6 +4224,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector, switch (port->pdt) { case DP_PEER_DEVICE_NONE: + break; case DP_PEER_DEVICE_MST_BRANCHING: if (!port->mcs) ret = connector_status_connected; From patchwork Mon Feb 1 12:01:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 12058877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD28C433E0 for ; Mon, 1 Feb 2021 12:02:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9D92764E95 for ; Mon, 1 Feb 2021 12:02:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D92764E95 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB64089DDD; Mon, 1 Feb 2021 12:02:00 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id C53C289DE1 for ; Mon, 1 Feb 2021 12:01:59 +0000 (UTC) IronPort-SDR: knmR3ki9RXmfKVr/6cBF3mhczFWhq2OV9lOYC+rwmrPI9tQ6fqbfhG4J52EHTiU5uBvG8hORiG 7FmgbBAescag== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="178108176" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="178108176" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:01:59 -0800 IronPort-SDR: gv0TYJFBjjz2oK9pFv4WMZSrGQ/4ADtxSMJXv0jV4rCkNeYMj3ru9sR0KUg6DQ7Q2zwH7nIsf2 hS1BIsxqnybg== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390880843" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:01:57 -0800 From: Imre Deak To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm/dp_mst: Don't cache EDIDs for physical ports Date: Mon, 1 Feb 2021 14:01:43 +0200 Message-Id: <20210201120145.350258-2-imre.deak@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210201120145.350258-1-imre.deak@intel.com> References: <20210201120145.350258-1-imre.deak@intel.com> MIME-Version: 1.0 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: Wayne Lin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Caching EDIDs for physical ports prevents updating the EDID if a port gets reconnected via a Connection Status Notification message, fix this. Fixes: db1a07956968 ("drm/dp_mst: Handle SST-only branch device case") Cc: Wayne Lin Cc: Lyude Paul Signed-off-by: Imre Deak --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index deb7995f42fa..309afe61afdd 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2302,7 +2302,8 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb, } if (port->pdt != DP_PEER_DEVICE_NONE && - drm_dp_mst_is_end_device(port->pdt, port->mcs)) { + drm_dp_mst_is_end_device(port->pdt, port->mcs) && + port->port_num >= DP_MST_LOGICAL_PORT_0) { port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); drm_connector_set_tile_property(port->connector); From patchwork Mon Feb 1 12:01:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 12058881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7016AC433DB for ; Mon, 1 Feb 2021 12:02:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1B10F64E8F for ; Mon, 1 Feb 2021 12:02:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B10F64E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D656889F75; Mon, 1 Feb 2021 12:02:04 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC1D289F6D for ; Mon, 1 Feb 2021 12:02:03 +0000 (UTC) IronPort-SDR: CvJPCa7Wbn+tNhoAH+AnMew5rsTO6bliC8DyUvlLqVgn6DKKU3BwgZ5bjOLFJARuu28V+ECp5K dmrjxmcTE+Rw== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="178108183" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="178108183" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:02:03 -0800 IronPort-SDR: wk3sov0KxQZKIo6okTR2+/NhFIJ4TaP5UT8nTDLU6fIXUA47a0GuAjiWbR5oZvEpmofV3/Et6+ mKpwLkiYBCkA== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390880856" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:01:59 -0800 From: Imre Deak To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/dp_mst: Remove redundant tile property setting Date: Mon, 1 Feb 2021 14:01:44 +0200 Message-Id: <20210201120145.350258-3-imre.deak@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210201120145.350258-1-imre.deak@intel.com> References: <20210201120145.350258-1-imre.deak@intel.com> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm_get_edid() already updates the tile property since commit 2de3a078497b ("drm/dp: Set the connector's TILE property even for DP SST connectors") so no need to update it after calling this function. Cc: Lyude Paul Signed-off-by: Imre Deak --- drivers/gpu/drm/drm_dp_mst_topology.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 309afe61afdd..43a40660136c 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2303,11 +2303,9 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb, if (port->pdt != DP_PEER_DEVICE_NONE && drm_dp_mst_is_end_device(port->pdt, port->mcs) && - port->port_num >= DP_MST_LOGICAL_PORT_0) { + port->port_num >= DP_MST_LOGICAL_PORT_0) port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); - drm_connector_set_tile_property(port->connector); - } drm_connector_register(port->connector); return; From patchwork Mon Feb 1 12:01:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 12058883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C367C433DB for ; Mon, 1 Feb 2021 12:02:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 35EE264DD8 for ; Mon, 1 Feb 2021 12:02:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35EE264DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F0D289FE6; Mon, 1 Feb 2021 12:02:07 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3310A89FE6 for ; Mon, 1 Feb 2021 12:02:06 +0000 (UTC) IronPort-SDR: CEX86Y9dOgoBLt+CN2ppkz4BcVLP86DmbtMUA8bIdaNOj8AnkKkUsoxbzSq9j7mEch3jPu2ove lSMq9JbdOOxQ== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="178108193" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="178108193" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:02:06 -0800 IronPort-SDR: OnnGcMac/+IUnQuljWEghNpBhwSPHtOwwOo+E13V1C0DTdqSS+ThUK/Y/lW3MUPjpiSv2pJfEe n0CiPn2jhLYg== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390880874" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 04:02:03 -0800 From: Imre Deak To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm/dp_mst: Use DP_MST_LOGICAL_PORT_0 instead of magic number Date: Mon, 1 Feb 2021 14:01:45 +0200 Message-Id: <20210201120145.350258-4-imre.deak@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210201120145.350258-1-imre.deak@intel.com> References: <20210201120145.350258-1-imre.deak@intel.com> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the macro defined for the first logical port instead of the corresponding magic number. Cc: Lyude Paul Signed-off-by: Imre Deak --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 43a40660136c..0a54506c2773 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -4232,9 +4232,8 @@ drm_dp_mst_detect_port(struct drm_connector *connector, case DP_PEER_DEVICE_SST_SINK: ret = connector_status_connected; /* for logical ports - cache the EDID */ - if (port->port_num >= 8 && !port->cached_edid) { + if (port->port_num >= DP_MST_LOGICAL_PORT_0 && !port->cached_edid) port->cached_edid = drm_get_edid(connector, &port->aux.ddc); - } break; case DP_PEER_DEVICE_DP_LEGACY_CONV: if (port->ldps)