From patchwork Wed Jul 3 15:59:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13722505 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 7A252C30653 for ; Wed, 3 Jul 2024 15:59:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2201010E924; Wed, 3 Jul 2024 15:59:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Y+QJeEcU"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 638C610E926 for ; Wed, 3 Jul 2024 15:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720022371; x=1751558371; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a5G7GdCvYtVSgoq8mJSDbDY0emnk/htaPIkcwOG8Uh0=; b=Y+QJeEcUXrsZz+WN3Mibesm6O5vJZ19FBlWT73jP+GsarXbj3AuBpSvm 3VUl3AsjtJHEBUgeHx2J0vmXaA6f79u8mtcxxnu7aQuOGJdk9L8AlGJqy +UGiJbi5scclVVCdcC9e8qIF9NZpBG6hRouH+AY9NZ5b9LvSfzuYo5hsl RS3/3pulswh/kk5D69owRhXukVSsJTirnKn+4HbjKHdqkkUrSTUrq0Pqe 0rIbt2TqOlgb7UaqLzjuice1JD0Fm7nhT8bBZun1jHb+RRb238jgOKD3p o5lGoPcY6mdj10wN974UEhEnzJjOmYOLJOb9UCZgGKo+IuNCzhk5T7/up Q==; X-CSE-ConnectionGUID: CmkRlgGwT4C6ZWsrl1JyDQ== X-CSE-MsgGUID: naTWZsD4QEuBRUPx26AkoQ== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17131764" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17131764" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:29 -0700 X-CSE-ConnectionGUID: /OZVeDPrT4SelhBKUHjfWQ== X-CSE-MsgGUID: QkPpuAfhSz24BeP84Fuyrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46964108" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:26 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Cc: Gareth Yu , stable@vger.kernel.org, =?utf-8?b?Vmls?= =?utf-8?b?bGUgU3lyasOkbMOk?= Subject: [PATCH 1/5] drm/i915/dp: Don't switch the LTTPR mode on an active link Date: Wed, 3 Jul 2024 18:59:33 +0300 Message-ID: <20240703155937.1674856-2-imre.deak@intel.com> X-Mailer: git-send-email 2.43.3 In-Reply-To: <20240703155937.1674856-1-imre.deak@intel.com> References: <20240703155937.1674856-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Switching to transparent mode leads to a loss of link synchronization, so prevent doing this on an active link. This happened at least on an Intel N100 system / DELL UD22 dock, the LTTPR residing either on the host or the dock. To fix the issue, keep the current mode on an active link, adjusting the LTTPR count accordingly (resetting it to 0 in transparent mode). Fixes: 7b2a4ab8b0ef ("drm/i915: Switch to LTTPR transparent mode link training") Reported-and-tested-by: Gareth Yu Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10902 Cc: # v5.15+ Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä --- .../drm/i915/display/intel_dp_link_training.c | 49 +++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c index 1bc4ef84ff3bc..08a27fe077917 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -117,10 +117,24 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable) return drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) == 1; } -static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +static bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp) +{ + return intel_dp->lttpr_common_caps[DP_PHY_REPEATER_MODE - + DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV] == + DP_PHY_REPEATER_MODE_TRANSPARENT; +} + +/* + * Read the LTTPR common capabilities and switch the LTTPR PHYs to + * non-transparent mode if this is supported. Preserve the + * transparent/non-transparent mode on an active link. + * + * Return the number of detected LTTPRs in non-transparent mode or 0 if the + * LTTPRs are in transparent mode or the detection failed. + */ +static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) { int lttpr_count; - int i; if (!intel_dp_read_lttpr_common_caps(intel_dp, dpcd)) return 0; @@ -134,6 +148,19 @@ static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEI if (lttpr_count == 0) return 0; + /* + * Don't change the mode on an active link, to prevent a loss of link + * synchronization. See DP Standard v2.0 3.6.7. about the LTTPR + * resetting its internal state when the mode is changed from + * non-transparent to transparent. + */ + if (intel_dp->link_trained) { + if (lttpr_count < 0 || intel_dp_lttpr_transparent_mode_enabled(intel_dp)) + goto out_reset_lttpr_count; + + return lttpr_count; + } + /* * See DP Standard v2.0 3.6.6.1. about the explicit disabling of * non-transparent mode and the disable->enable non-transparent mode @@ -154,11 +181,25 @@ static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEI "Switching to LTTPR non-transparent LT mode failed, fall-back to transparent mode\n"); intel_dp_set_lttpr_transparent_mode(intel_dp, true); - intel_dp_reset_lttpr_count(intel_dp); - return 0; + goto out_reset_lttpr_count; } + return lttpr_count; + +out_reset_lttpr_count: + intel_dp_reset_lttpr_count(intel_dp); + + return 0; +} + +static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + int lttpr_count; + int i; + + lttpr_count = intel_dp_init_lttpr_phys(intel_dp, dpcd); + for (i = 0; i < lttpr_count; i++) intel_dp_read_lttpr_phy_caps(intel_dp, dpcd, DP_PHY_LTTPR(i)); From patchwork Wed Jul 3 15:59:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13722504 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 BA3F6C2BD09 for ; Wed, 3 Jul 2024 15:59:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A55F10E926; Wed, 3 Jul 2024 15:59:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="SpyvNcSM"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 978E310E924 for ; Wed, 3 Jul 2024 15:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720022371; x=1751558371; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=s/ZjmkhvzNv2bsAprAE4TVPIuSJqq52D7ODMugIKcKI=; b=SpyvNcSMkC9X6zmBoxDhKr87Txx526tBA6VhyKkQ0eJk4ALey9pQg0yj 1HTgUXI8/8PUYt95Z2BhKF90+9L6AFdjnmhtNVJWkwPSG063sO3uvt8Pu epbmqR96TFSSEK4uqkqv9x2+R7gsCP0/RKh9T6YHin9kT+Gkdt6EbnwUq lJywXwmzXHyv7okIhP3zbwbeLSR7D6qMlCBatMnK+ak58ZJ4eRZWPOob8 wmR/TLdLvB9ZNzQ/mGDHJYwjM5jIdgUaS3VCmPvh8yyEEkpcQdj6BZrc2 /8LC0AY8j8Bi1LlRTKHuAfgVBWy9G4hevY+fWFUDMLZkTlqp0jsd/mSQz A==; X-CSE-ConnectionGUID: EwEPBHCJRv6yfgGHU2L35w== X-CSE-MsgGUID: miMK6oNgSmWhtQu2TOIPaA== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17131765" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17131765" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:29 -0700 X-CSE-ConnectionGUID: Wibapj1FR5CFFT0Ad5DanA== X-CSE-MsgGUID: 7zzt8D+xSPmB1wPVGVuGuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46964111" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:28 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/5] drm/i915/dp: Reset cached LTTPR count if number of LTTPRs is unsupported Date: Wed, 3 Jul 2024 18:59:34 +0300 Message-ID: <20240703155937.1674856-3-imre.deak@intel.com> X-Mailer: git-send-email 2.43.3 In-Reply-To: <20240703155937.1674856-1-imre.deak@intel.com> References: <20240703155937.1674856-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" After detection the cached LTTPR count can be checked to determine if LTTPRs in non-transparent mode were detected. Reset the cached LTTPR count if the reported number of LTTPRs is invalid to ensure the above checks work as expected. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_dp_link_training.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c index 08a27fe077917..df9b35491fc44 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -174,7 +174,7 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_ * still taking into account any LTTPR common lane- rate/count limits. */ if (lttpr_count < 0) - return 0; + goto out_reset_lttpr_count; if (!intel_dp_set_lttpr_transparent_mode(intel_dp, false)) { lt_dbg(intel_dp, DP_PHY_DPRX, From patchwork Wed Jul 3 15:59:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13722507 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 23F2DC3814E for ; Wed, 3 Jul 2024 15:59:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E25D10E928; Wed, 3 Jul 2024 15:59:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="eVjizxDB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id A561710E926 for ; Wed, 3 Jul 2024 15:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720022371; x=1751558371; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pN1VnzTfh2Gp1qlYUOrxb1EdoWIL8ZmV1gzqpj7prbo=; b=eVjizxDBqN1yeqgy3itSrc3enBgqz5ZVYiLXBVolNeQY3unG8Ayxws4H cJNTWMWPtC1xzR1jxqBJwNJ6uoTg6piDjQH17Vj1nPWGojCwcDSntSNV6 QIt3jlxshCM4kvrExNUn+QJRXtQqnxqO1g3AbRjK6q154aKi3EDGn0yE9 MqfcVpQNfUIIRzrMygWJVsE/BIWXk5iv5N1PdlBrV1M+kEJJJmsZ+HaDk xJzq5bkw90W+TSfVKxqd/z5TD29s3nP9h+A+HKh/OI+Vf4Y8HiVxPHYvn E17h09Ol2Bo4hHeDGCtDtLvdYifPatcH8Ja8Y/kqQ3WfdQQXoVXptMdNf A==; X-CSE-ConnectionGUID: e5KAkAueT7O/tkozT6hnKQ== X-CSE-MsgGUID: +0Jsmzu+TG2pr3TthNnhFg== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17131769" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17131769" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:30 -0700 X-CSE-ConnectionGUID: fhfpP8QJRDq4IiOoB0TBtQ== X-CSE-MsgGUID: T/FBkVuFTFqlx4iE0ceRpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46964118" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:29 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/5] drm/i915/dp: Keep cached LTTPR mode up-to-date Date: Wed, 3 Jul 2024 18:59:35 +0300 Message-ID: <20240703155937.1674856-4-imre.deak@intel.com> X-Mailer: git-send-email 2.43.3 In-Reply-To: <20240703155937.1674856-1-imre.deak@intel.com> References: <20240703155937.1674856-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Nothing depends on the cached LTTPR mode, however for consistency keep it up-to-date with the value programmed to the DPCD register. Signed-off-by: Imre Deak --- drivers/gpu/drm/i915/display/intel_dp_link_training.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c index df9b35491fc44..31089f1b316d2 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -114,7 +114,13 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable) u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : DP_PHY_REPEATER_MODE_NON_TRANSPARENT; - return drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) == 1; + if (drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) != 1) + return false; + + intel_dp->lttpr_common_caps[DP_PHY_REPEATER_MODE - + DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV] = val; + + return true; } static bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp) From patchwork Wed Jul 3 15:59:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13722508 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 B2860C2BD09 for ; Wed, 3 Jul 2024 15:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 49AF910E933; Wed, 3 Jul 2024 15:59:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Js39l3hF"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id D399110E92E; Wed, 3 Jul 2024 15:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720022375; x=1751558375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4iV+aQttd3YAfBPE810KZ/J0jy+wRBDu8do37P7beec=; b=Js39l3hFe4wRqeEkvPBLDa5hz2IgWRtS4oq1U1j5fpg94rvgQsz8qVX3 NfuC6f5hetLye8q9csl1qnSO5bBDeBzjG+qa6p337+ena+Ox+DU+siFX/ 6k7MpiIt+rqKVC5UmpOtUwOUXeNnvIgNlo5+w4e6iWEXPBqXvd3SxUjW1 nI0xJk5+7buzbFrPvIPH9ujsDBeptby1IUjVEqPRo4FDxfxAuAeTu6HAU J7iXDfAH2/vhZYk/ura7AqMOrvpad6Q2Lj46YOI626lT4Rz1/9aUuU4qK SDHkYz0xqe3FXsTXDA4wrKRch4zmMNtdJffdsPOpy4E+djzOZs01c9iXF w==; X-CSE-ConnectionGUID: bpf3/gAVTUigD72lKKuFPg== X-CSE-MsgGUID: HdygV9ioSFykzS+Y7b2kUg== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17131779" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17131779" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:31 -0700 X-CSE-ConnectionGUID: i/QyMJXrRfS4Ein5BUpKUg== X-CSE-MsgGUID: OGCyA94YTDy98SREk2YD/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46964121" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:30 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/dp: Add the LTTPR PHY OUI DPCD register Date: Wed, 3 Jul 2024 18:59:36 +0300 Message-ID: <20240703155937.1674856-5-imre.deak@intel.com> X-Mailer: git-send-email 2.43.3 In-Reply-To: <20240703155937.1674856-1-imre.deak@intel.com> References: <20240703155937.1674856-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add the DPCD register for the LTTPR PHY OUI. This will be used by a later i915 patch to dump the descriptors for the detected LTTPR PHYs. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- include/drm/display/drm_dp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index 173548c6473a9..a6f8b098c56f1 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -1543,6 +1543,10 @@ enum drm_dp_phy { #define DP_SYMBOL_ERROR_COUNT_LANE2_PHY_REPEATER1 0xf0039 /* 1.3 */ #define DP_SYMBOL_ERROR_COUNT_LANE3_PHY_REPEATER1 0xf003b /* 1.3 */ +#define DP_OUI_PHY_REPEATER1 0xf003d /* 1.3 */ +#define DP_OUI_PHY_REPEATER(dp_phy) \ + DP_LTTPR_REG(dp_phy, DP_OUI_PHY_REPEATER1) + #define __DP_FEC1_BASE 0xf0290 /* 1.4 */ #define __DP_FEC2_BASE 0xf0298 /* 1.4 */ #define DP_FEC_BASE(dp_phy) \ From patchwork Wed Jul 3 15:59:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13722509 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 D2628C30653 for ; Wed, 3 Jul 2024 15:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 70CCF10E934; Wed, 3 Jul 2024 15:59:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MPGDl4Sg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 11A1510E933 for ; Wed, 3 Jul 2024 15:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720022375; x=1751558375; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=NT6Aw5qtVIYJ1rnxcozOacNB3kE1MRxNYDGeKqmwXJ0=; b=MPGDl4Sgl/bQ4l66Oi2paZoLkZlCuS2Ls024Cf0VtJTlaWqv7oa03SQ0 kwlo0+8+QvAaFKjlRQUtkAybXg6kDhx1WfJkZ+0zBuzLOBUxCOj7g+lzT JdFwA43H58AgEt0Sujayx3APOk7pLeRyiFVOnJeAq+kSsIJMuNcGsG4rX CUNjAG8M6TESezHy9OBCfc7Bk/PcbLIbWtgylDIf09FfMznvlqYu285nn U37NSNffk7n6/Ul6fCniQCgPuH1K7GDzC4Yt1RsXB8LdJE5tKyAoFQQKP uGfAMbm0i6Ky3fRtrd0+03h2hANAEUIb78lMzk/+YbdFN3VEzquvcWEwF A==; X-CSE-ConnectionGUID: 36q2mLIhT4ms2+oY48sBfQ== X-CSE-MsgGUID: A/FhNtrWQHGDUPgWqiAV3w== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17131782" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17131782" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:32 -0700 X-CSE-ConnectionGUID: +62xzA0qSGiOph3gKtBUfw== X-CSE-MsgGUID: uOcI2F+RQ+y/QDZxxAQzKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46964127" Received: from ideak-desk.fi.intel.com ([10.237.72.78]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 08:59:31 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH 5/5] drm/i915/dp: Dump the LTTPR PHY descriptors Date: Wed, 3 Jul 2024 18:59:37 +0300 Message-ID: <20240703155937.1674856-6-imre.deak@intel.com> X-Mailer: git-send-email 2.43.3 In-Reply-To: <20240703155937.1674856-1-imre.deak@intel.com> References: <20240703155937.1674856-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Dump the descriptor of the detected LTTPRs in non-transparent mode to help the debugging related to LTTPRs easier. Signed-off-by: Imre Deak --- .../drm/i915/display/intel_dp_link_training.c | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c index 31089f1b316d2..52b149793f3d0 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -199,6 +199,24 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_ return 0; } +static void intel_dp_dump_lttpr_phy_desc(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy) +{ + struct drm_i915_private *i915 = dp_to_i915(intel_dp); + struct drm_dp_dpcd_ident ident; + + if (drm_dp_dpcd_read(&intel_dp->aux, DP_OUI_PHY_REPEATER(dp_phy), + &ident, sizeof(ident)) < 0) + return; + + drm_dbg_kms(&i915->drm, + "%s: %s: OUI %*phD dev-ID %*pE HW-rev %d.%d SW-rev %d.%d\n", + intel_dp->aux.name, drm_dp_phy_name(dp_phy), + (int)sizeof(ident.oui), ident.oui, + (int)strnlen(ident.device_id, sizeof(ident.device_id)), ident.device_id, + ident.hw_rev >> 4, ident.hw_rev & 0xf, + ident.sw_major_rev, ident.sw_minor_rev); +} + static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) { int lttpr_count; @@ -206,8 +224,10 @@ static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEI lttpr_count = intel_dp_init_lttpr_phys(intel_dp, dpcd); - for (i = 0; i < lttpr_count; i++) + for (i = 0; i < lttpr_count; i++) { intel_dp_read_lttpr_phy_caps(intel_dp, dpcd, DP_PHY_LTTPR(i)); + intel_dp_dump_lttpr_phy_desc(intel_dp, DP_PHY_LTTPR(i)); + } return lttpr_count; }