From patchwork Wed Jan 31 10:23:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Murthy, Arun R" X-Patchwork-Id: 13539157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 30DFCC47258 for ; Wed, 31 Jan 2024 10:34:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19F41113B34; Wed, 31 Jan 2024 10:33:55 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1158113B14; Wed, 31 Jan 2024 10:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706697233; x=1738233233; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=e/LvwFxrQNVCce+zkTCrQHdg7BYgjVpv+8lXG1cOAwg=; b=D+IijPV6em3fhZk1QfKMJWAJJFsy4vUkgcQWvJZn61I0LSUKNjig9PI+ f4gSuPuy2kE49Lg0qkSgA32ePF2vly9KB94HP3drZ8u/I1W+5W7OPMUVx wf/czhO16avyG3RSF3Fnai64XPORJhICa3obFCLFx3+odB3SOFjc/9iHj wZwL6YM9WHNBKcQeWoW9ev/MxYCTzgHHjzzuWwuS2Dn23ED9spN7lhHXP MU7k8EUOdneqtw55euOvBEoNcczOdIvOgjosxZB1g/mdG6rEdv/FRAWOp lUFHw8hp2wGSl8KTb68gHRNX+8tUqUQvzIBKCV9CsBKTVEwEvgdFnjM7U g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="407278655" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="407278655" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 02:33:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="22747025" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa002.fm.intel.com with ESMTP; 31 Jan 2024 02:33:50 -0800 From: Arun R Murthy To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCHv2 1/2] drm/display/dp: Check for MSTM_CAP before MSTM_CTRL write Date: Wed, 31 Jan 2024 15:53:43 +0530 Message-Id: <20240131102344.1671929-1-arun.r.murthy@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: jani.nikula@intel.com, Arun R Murthy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With DP2.1, multistream packetization and the underneth MST protocol will be required for SST. So check for MSTM_CAP to see if MST is really required and skip the MSTM_CTRL write so that we ensure that only the underneth protocol and the multistream packetization will be enabled and sink will not be confused by a corresponding dpcd write. Signed-off-by: Arun R Murthy --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 8ca01a6bf645..c5b3e51ea0c9 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3666,12 +3666,14 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms mgr->mst_primary = mstb; drm_dp_mst_topology_get_mstb(mgr->mst_primary); - ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, - DP_MST_EN | - DP_UP_REQ_EN | - DP_UPSTREAM_IS_SRC); - if (ret < 0) - goto out_unlock; + if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd)) { + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | + DP_UP_REQ_EN | + DP_UPSTREAM_IS_SRC); + if (ret < 0) + goto out_unlock; + } /* Write reset payload */ drm_dp_dpcd_write_payload(mgr, 0, 0, 0x3f); @@ -3684,7 +3686,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms mstb = mgr->mst_primary; mgr->mst_primary = NULL; /* this can fail if the device is gone */ - drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0); + if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd)) + drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0); ret = 0; mgr->payload_id_table_cleared = false; @@ -3724,8 +3727,9 @@ drm_dp_mst_topology_mgr_invalidate_mstb(struct drm_dp_mst_branch *mstb) void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr) { mutex_lock(&mgr->lock); - drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, - DP_MST_EN | DP_UPSTREAM_IS_SRC); + if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd)) + drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | DP_UPSTREAM_IS_SRC); mutex_unlock(&mgr->lock); flush_work(&mgr->up_req_work); flush_work(&mgr->work); @@ -3773,13 +3777,15 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr, goto out_fail; } - ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, - DP_MST_EN | - DP_UP_REQ_EN | - DP_UPSTREAM_IS_SRC); - if (ret < 0) { - drm_dbg_kms(mgr->dev, "mst write failed - undocked during suspend?\n"); - goto out_fail; + if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd)) { + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | + DP_UP_REQ_EN | + DP_UPSTREAM_IS_SRC); + if (ret < 0) { + drm_dbg_kms(mgr->dev, "mst write failed - undocked during suspend?\n"); + goto out_fail; + } } /* Some hubs forget their guids after they resume */ From patchwork Wed Jan 31 10:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Murthy, Arun R" X-Patchwork-Id: 13539156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EC218C47DDF for ; Wed, 31 Jan 2024 10:33:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3699113B14; Wed, 31 Jan 2024 10:33:54 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA8D9113B2C; Wed, 31 Jan 2024 10:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706697233; x=1738233233; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vNR2f1kvwlmj65LDk9wvVGrMmCJtkKPK9rpti39qRX8=; b=SaeitCwwj8N5MB0X7YKxh8GHdHFZ3aVPKWIpxcD15bkBNfDQ2vy0IPBe 39S+Uf2tUXykfdw4GX94OwtFBWM+XkYFfyJf98PlTYJofQvYC1KKyNGUQ u2iXuh6mNlAEWHMrHbEqBwBGRIUF5P0EbAwtsMRyHCDcZX5ye6qCAPV9x Q3U6L0Q/iWnKuosc/gYy5F6HCbikAs/oAGqQKqQRFK28THYnedLgRxq1I qErpkNb+3xRqpYe/3ZMFvGn1wtu5VIxkSJ8m+ootkeAqCs9E+7okMp/tl lXITVrRBffG3YsP4EC3tHSgA84LcUdbbPEIjKewY6gLwt3ofCkqj7LchF g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="407278657" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="407278657" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 02:33:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="22747031" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa002.fm.intel.com with ESMTP; 31 Jan 2024 02:33:52 -0800 From: Arun R Murthy To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCHv2 2/2] drm/i915/display/dp: 128/132b DP-capable with SST Date: Wed, 31 Jan 2024 15:53:44 +0530 Message-Id: <20240131102344.1671929-2-arun.r.murthy@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240131102344.1671929-1-arun.r.murthy@intel.com> References: <20240131102344.1671929-1-arun.r.murthy@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: jani.nikula@intel.com, Arun R Murthy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With a value of '0' read from MSTM_CAP register MST to be enabled. DP2.1 SCR updates the spec for 128/132b DP capable supporting only one stream and not supporting single stream sideband MSG. The underlying protocol will be MST to enable use of MTP. Signed-off-by: Arun R Murthy --- drivers/gpu/drm/i915/display/intel_dp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 9ff0cbd9c0df..05722f10cdd7 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4037,9 +4037,15 @@ intel_dp_configure_mst(struct intel_dp *intel_dp) if (!intel_dp_mst_source_support(intel_dp)) return; - - intel_dp->is_mst = sink_can_mst && - i915->display.params.enable_dp_mst; + /* + * Even if dpcd reg MSTM_CAP is 0, if the sink supports UHBR rates then + * DP2.1 can be enabled with underlying protocol using MST for MTP + * TODO: Need to accommodate MSTM_CAP bit[0]=0, bit[1]=1 condition, i.e + * one stream with single stream sideband msg. + */ + intel_dp->is_mst = (sink_can_mst || (intel_dp->dpcd[DP_MAIN_LINK_CHANNEL_CODING] & + DP_CAP_ANSI_128B132B)) && + i915->display.params.enable_dp_mst; drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);