From patchwork Wed Sep 25 03:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun R Murthy X-Patchwork-Id: 13811585 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 8FDA4CF9C77 for ; Wed, 25 Sep 2024 03:54:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A886810E2C8; Wed, 25 Sep 2024 03:54:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="M6cQ4ucy"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7959010E2CA; Wed, 25 Sep 2024 03:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727236457; x=1758772457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WWEE1OBIpM2RwjaNWutcyLWaQlyyd2ifDQWPAXn+sV4=; b=M6cQ4ucyR+pOHlzf+kMeC0Wa/aJa4x8uSTdxfcV4zcZZW96WzVTLlu1t 5WR/ydASp0Qce7o0l4dXEZ+KnBTf4Z/Az2LUjPFYPKr3KgTAoXh3Gutit kPe4DWhqqYZ21Fjjqj2yHf5CQJcWtMF/zkXto3JAup4qEVZ7VaYTBa1SJ OeOCaMW6DKzrCDoYppCgGGKUASpkjPDzMt+1T1sGeF13KRHpDPvXVGkbS OpIQ+fi2jYw95hiYFhBuz1EThcLMKCPoGOEfS4k0BF5Yrs+0PiBSg2hCh ZswTIEmAJpZmQ534VvVZd/pYCuyD8ZIU6whPywaTnGrDMDPo1hb4f4lOp g==; X-CSE-ConnectionGUID: kn5qz+FpSIi0Icm39xnslQ== X-CSE-MsgGUID: 97S9HJsuSeGS+33e62Qdjw== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="37640816" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="37640816" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 20:54:17 -0700 X-CSE-ConnectionGUID: rAlBSc4eQsSmmQKwxNf16w== X-CSE-MsgGUID: boM7HBwsRN+w5qpEKDj94Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="71781153" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa008.fm.intel.com with ESMTP; 24 Sep 2024 20:54:16 -0700 From: Arun R Murthy To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Arun R Murthy , Srikanth V NagaVenkata , Jani Nikula Subject: [PATCHv2 1/3] drm/i915/dp: use fsleep instead of usleep_range for LT Date: Wed, 25 Sep 2024 09:14:30 +0530 Message-Id: <20240925034432.1777029-2-arun.r.murthy@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925034432.1777029-1-arun.r.murthy@intel.com> References: <20240925034432.1777029-1-arun.r.murthy@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" Sleeping for < 10us use udelay, for 10us to 20ms use usleep_range() and for > 10ms use msleep. flseep() will call the particular API based on the above condition. (Documentation/timers/timers-howto.rst) Aux RD Interval value depends on the value read from the dpcd register which is updated from the sink device, hence use flseep. Co-developed-by: Srikanth V NagaVenkata Signed-off-by: Arun R Murthy Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_dp_link_training.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 397cc4ebae52..f41b69840ad9 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -898,7 +898,7 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp, voltage_tries = 1; for (cr_tries = 0; cr_tries < max_cr_tries; ++cr_tries) { - usleep_range(delay_us, 2 * delay_us); + fsleep(delay_us); if (drm_dp_dpcd_read_phy_link_status(&intel_dp->aux, dp_phy, link_status) < 0) { @@ -1040,7 +1040,7 @@ intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp, } for (tries = 0; tries < 5; tries++) { - usleep_range(delay_us, 2 * delay_us); + fsleep(delay_us); if (drm_dp_dpcd_read_phy_link_status(&intel_dp->aux, dp_phy, link_status) < 0) { @@ -1417,7 +1417,7 @@ intel_dp_128b132b_lane_eq(struct intel_dp *intel_dp, deadline = jiffies + msecs_to_jiffies_timeout(400); for (try = 0; try < max_tries; try++) { - usleep_range(delay_us, 2 * delay_us); + fsleep(delay_us); /* * The delay may get updated. The transmitter shall read the From patchwork Wed Sep 25 03:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun R Murthy X-Patchwork-Id: 13811586 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 31543CF9C74 for ; Wed, 25 Sep 2024 03:54:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1F3B10E781; Wed, 25 Sep 2024 03:54:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="IdDhHTsj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DB2110E8F2; Wed, 25 Sep 2024 03:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727236459; x=1758772459; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tMKMfAEk7st0mQ7orHkYHUZ2g+yC6RJiwIM/FTiodcE=; b=IdDhHTsjNm6eQ/ogoz2i4Du8b2BCty7Gg5DxB6Axgq54Ue6m0juuv0sc uKxNDWtThfOcwINxSI/dn2zf11BsmXUjrA0As8cwT/Xq56icr5y/eYcm9 gU76AcEZpm9yVoSdYkv/71Tx0PtoNzyQV5MnQDTh1eKbviSr0Qj6lwfJe Mr4jdacipQ0+0Oq9owmmKwDJpsrRbDRer0uF5RxlDnCHxWkMbgjyNoZ3L SCc3YigVPIWlAUB/mXDSaSd59K+FFfVfm7G8mJYyuU+YEMu0f//gu87ql WmNPFHNHMJ2OGbuJu/K+2xmFOpO+wu2z/pcnneV8MdgaefWW7vgR/P+3l A==; X-CSE-ConnectionGUID: CVvtEdsWTD2ePfZeSP/AAw== X-CSE-MsgGUID: Xk1HrHhyQRi7KHyXhEe/1A== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="37640817" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="37640817" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 20:54:19 -0700 X-CSE-ConnectionGUID: evgcM7GiQBW7EH0B94QD0g== X-CSE-MsgGUID: 2PpTDy+hSu+IMzJJnY8z4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="71781162" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa008.fm.intel.com with ESMTP; 24 Sep 2024 20:54:18 -0700 From: Arun R Murthy To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Arun R Murthy , Srikanth V NagaVenkata , Suraj Kandpal Subject: [PATCHv3 2/3] drm/i915/dp: read Aux RD interval just before setting the FFE preset Date: Wed, 25 Sep 2024 09:14:31 +0530 Message-Id: <20240925034432.1777029-3-arun.r.murthy@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925034432.1777029-1-arun.r.murthy@intel.com> References: <20240925034432.1777029-1-arun.r.murthy@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" Figure 3-52: 128b132b DP DPTC LANEx_CHANNEL_EQ_DONE Sequence of DP2.1a spec. After reading LANEx_CHANNEL_EQ_DONE, read the FFE presets. AUX_RD_INTERVAL and then write the new FFE presets. Co-developed-by: Srikanth V NagaVenkata Signed-off-by: Arun R Murthy Reviewed-by: Suraj Kandpal --- .../gpu/drm/i915/display/intel_dp_link_training.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 f41b69840ad9..1bac00e46533 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -1419,12 +1419,6 @@ intel_dp_128b132b_lane_eq(struct intel_dp *intel_dp, for (try = 0; try < max_tries; try++) { fsleep(delay_us); - /* - * The delay may get updated. The transmitter shall read the - * delay before link status during link training. - */ - delay_us = drm_dp_128b132b_read_aux_rd_interval(&intel_dp->aux); - if (drm_dp_dpcd_read_link_status(&intel_dp->aux, link_status) < 0) { lt_err(intel_dp, DP_PHY_DPRX, "Failed to read link status\n"); return false; @@ -1451,8 +1445,14 @@ intel_dp_128b132b_lane_eq(struct intel_dp *intel_dp, if (time_after(jiffies, deadline)) timeout = true; /* try one last time after deadline */ - /* Update signal levels and training set as requested. */ intel_dp_get_adjust_train(intel_dp, crtc_state, DP_PHY_DPRX, link_status); + /* + * During LT, Tx shall read AUX_RD_INTERVAL just before writing the new FFE + * presets. + */ + delay_us = drm_dp_128b132b_read_aux_rd_interval(&intel_dp->aux); + + /* Update signal levels and training set as requested. */ if (!intel_dp_update_link_train(intel_dp, crtc_state, DP_PHY_DPRX)) { lt_err(intel_dp, DP_PHY_DPRX, "Failed to update TX FFE settings\n"); return false; From patchwork Wed Sep 25 03:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun R Murthy X-Patchwork-Id: 13811587 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 1491DCF9C71 for ; Wed, 25 Sep 2024 03:54:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B630910E8F1; Wed, 25 Sep 2024 03:54:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Q12Dw1bu"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48FE910E77F; Wed, 25 Sep 2024 03:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727236461; x=1758772461; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pfDHc0y2wR5gqBFWX4DS7FejSEwsFvibJo2PwwcIP2U=; b=Q12Dw1buggaA+PjJBwQSdE81Igv38Iwe6Z/TOf6JUbRVxPbpPpjFo+t3 Y/NlPZ7OrOxK+zqSExUhnauYWhWzT/iCckWmNVOuAq6Sz1wEzBYlbRFRk mte8KNqcBW8Nt9u2meDc0Rqig5C7/H6wRlbK4q4/lfEgTZE3kQV31uzES mKta2inYOtplCNMmTOaRZnOHXTUf3OdAT6BSJ1ahzbpbsqroaQQiub42p 9aYqJV7oJXEoDIHYfXPhW4CRX2JwUhHM1Nhn/Z2tEo5mJIoRNXEp3lpV4 UrLM3v5dKUUfZ6HfbrTELMO9SO6pXeNKNGrrQrYJOISLO3OoNjsLIQiFX g==; X-CSE-ConnectionGUID: l9Vnp9rZT3yUSy7eQ3Rj7A== X-CSE-MsgGUID: cnpEo2FKTrKbS8uaMdnIeg== X-IronPort-AV: E=McAfee;i="6700,10204,11205"; a="37640819" X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="37640819" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2024 20:54:21 -0700 X-CSE-ConnectionGUID: lgfzQB8cRjeFnt7CkeXV7A== X-CSE-MsgGUID: N7CuGbRQT86G/pWO3urIaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,256,1719903600"; d="scan'208";a="71781176" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa008.fm.intel.com with ESMTP; 24 Sep 2024 20:54:19 -0700 From: Arun R Murthy To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Arun R Murthy , Srikanth V NagaVenkata , Suraj Kandpal , Jani Nikula Subject: [PATCHv2 3/3] drm/i915/dp: Include the time taken by AUX Tx for timeout Date: Wed, 25 Sep 2024 09:14:32 +0530 Message-Id: <20240925034432.1777029-4-arun.r.murthy@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240925034432.1777029-1-arun.r.murthy@intel.com> References: <20240925034432.1777029-1-arun.r.murthy@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" As per DP spec the timeout for LANE_CHANNEL_EQ_DONE is 400ms. But this timeout value is exclusively for the Aux RD Interval and excludes the time consumed for the AUX Tx (i.e reading/writing FFE presets). Add another 50ms for these AUX Tx to the 400ms timeout. Ref: "Figure 3-52: 128b132b DP DPTC LANEx_CHANNEL_EQ_DONE Sequence" of DP2.1a spec. Co-developed-by: Srikanth V NagaVenkata Signed-off-by: Arun R Murthy Reviewed-by: Suraj Kandpal Acked-by: Jani Nikula --- 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 1bac00e46533..0dde31f2df20 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -1414,7 +1414,7 @@ intel_dp_128b132b_lane_eq(struct intel_dp *intel_dp, } /* Time budget for the LANEx_EQ_DONE Sequence */ - deadline = jiffies + msecs_to_jiffies_timeout(400); + deadline = jiffies + msecs_to_jiffies_timeout(450); for (try = 0; try < max_tries; try++) { fsleep(delay_us);