From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH v3 01/21] drm/i915/dp_mst: Align TUs to avoid splitting symbols across MTPs
Date: Mon, 10 Jun 2024 19:49:13 +0300 [thread overview]
Message-ID: <20240610164933.2947366-2-imre.deak@intel.com> (raw)
In-Reply-To: <20240610164933.2947366-1-imre.deak@intel.com>
Symbols consisting of multiple (4) TU timeslots may get split across
MTPs when using 2 or 1 link lanes. Avoid this, as required by Bspec by
aligning the allocated TUs to 2 when using 2 lanes and 4 when using 1
lane.
Atm, we also have to align the PBNs used to allocate BW along the MST
path, since DRM core keeps track of its own TU value, derived from the
PBN and that TU value must match what the driver calculates.
On some platforms the alignment is only required on 8b/10b links, a
follow-up patch will remove the limitation for those.
Bspec: 49266, 68922
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 27 ++++++++++++++++++---
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 00fdcbc28e9b7..9362eb958310f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -207,6 +207,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
int remote_bw_overhead;
int link_bpp_x16;
int remote_tu;
+ fixed20_12 pbn;
drm_dbg_kms(&i915->drm, "Trying bpp %d\n", bpp);
@@ -237,11 +238,29 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
* crtc_state->dp_m_n.tu), provided that the driver doesn't
* enable SSC on the corresponding link.
*/
- crtc_state->pbn = intel_dp_mst_calc_pbn(adjusted_mode->crtc_clock,
- link_bpp_x16,
- remote_bw_overhead);
+ pbn.full = dfixed_const(intel_dp_mst_calc_pbn(adjusted_mode->crtc_clock,
+ link_bpp_x16,
+ remote_bw_overhead));
+ remote_tu = DIV_ROUND_UP(pbn.full, mst_state->pbn_div.full);
- remote_tu = DIV_ROUND_UP(dfixed_const(crtc_state->pbn), mst_state->pbn_div.full);
+ /*
+ * Aligning the TUs ensures that symbols consisting of multiple
+ * (4) symbol cycles don't get split between two consecutive
+ * MTPs, as required by Bspec.
+ * TODO: remove the alignment restriction for 128b/132b links
+ * on some platforms, where Bspec allows this.
+ */
+ remote_tu = ALIGN(remote_tu, 4 / crtc_state->lane_count);
+
+ /*
+ * Also align PBNs accordingly, since MST core will derive its
+ * own copy of TU from the PBN in drm_dp_atomic_find_time_slots().
+ * The above comment about the difference between the PBN
+ * allocated for the whole path and the TUs allocated for the
+ * first branch device's link also applies here.
+ */
+ pbn.full = remote_tu * mst_state->pbn_div.full;
+ crtc_state->pbn = dfixed_trunc(pbn);
drm_WARN_ON(&i915->drm, remote_tu < crtc_state->dp_m_n.tu);
crtc_state->dp_m_n.tu = remote_tu;
--
2.43.3
next prev parent reply other threads:[~2024-06-10 16:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 16:49 [PATCH v3 00/21] drm/i915/dp_mst: Enable link training fallback Imre Deak
2024-06-10 16:49 ` Imre Deak [this message]
2024-06-10 16:49 ` [PATCH v3 02/21] drm/i915/dp: Move link train params to a substruct in intel_dp Imre Deak
2024-06-10 16:49 ` [PATCH v3 03/21] drm/i915/dp: Move link train fallback to intel_dp_link_training.c Imre Deak
2024-06-10 16:49 ` [PATCH v3 04/21] drm/i915/dp: Sanitize intel_dp_get_link_train_fallback_values() Imre Deak
2024-06-10 16:49 ` [PATCH v3 05/21] drm/i915: Factor out function to modeset commit a set of pipes Imre Deak
2024-06-10 16:49 ` [PATCH v3 06/21] drm/i915/dp: Use a commit modeset for link retraining MST links Imre Deak
2024-06-10 16:49 ` [PATCH v3 07/21] drm/i915/dp: Recheck link state after modeset Imre Deak
2024-06-10 18:14 ` [PATCH v4 " Imre Deak
2024-06-10 16:49 ` [PATCH v3 08/21] drm/i915/dp: Reduce link params only after retrying with unchanged params Imre Deak
2024-06-10 16:49 ` [PATCH v3 09/21] drm/i915/dp: Pass atomic state to link training function Imre Deak
2024-06-10 16:49 ` [PATCH v3 10/21] drm/i915/dp: Send a link training modeset-retry uevent to all MST connectors Imre Deak
2024-06-10 16:49 ` [PATCH v3 11/21] drm/i915/dp: Use check link state work in the hotplug handler Imre Deak
2024-06-10 16:49 ` [PATCH v3 12/21] drm/i915/dp: Use check link state work in the detect handler Imre Deak
2024-06-10 16:49 ` [PATCH v3 13/21] drm/i915/dp: Use check link state work in the HPD IRQ handler Imre Deak
2024-06-10 16:49 ` [PATCH v3 14/21] drm/i915/dp: Disable link retraining after the last fallback step Imre Deak
2024-06-10 16:49 ` [PATCH v3 15/21] drm/i915/dp_mst: Reset intel_dp->link_trained during disabling Imre Deak
2024-06-10 16:49 ` [PATCH v3 16/21] drm/i915/dp_mst: Enable link training fallback for MST Imre Deak
2024-06-10 16:49 ` [PATCH v3 17/21] drm/i915/dp: Add debugfs entries to force the link rate/lane count Imre Deak
2024-06-10 16:49 ` [PATCH v3 18/21] drm/i915/dp: Add debugfs entries to get the max " Imre Deak
2024-06-10 16:49 ` [PATCH v3 19/21] drm/i915/dp: Add debugfs entry to force link training failure Imre Deak
2024-06-10 16:49 ` [PATCH v3 20/21] drm/i915/dp: Add debugfs entry to force link retrain Imre Deak
2024-06-10 16:49 ` [PATCH v3 21/21] drm/i915/dp: Add debugfs entry to get the link retrain disabled state Imre Deak
2024-06-10 17:43 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp_mst: Enable link training fallback (rev4) Patchwork
2024-06-10 17:43 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-10 17:51 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-06-10 19:29 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp_mst: Enable link training fallback (rev5) Patchwork
2024-06-10 19:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-10 19:39 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-11 7:15 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-06-13 19:40 ` Imre Deak
2024-06-12 12:29 ` [PATCH v3 00/21] drm/i915/dp_mst: Enable link training fallback Ville Syrjälä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240610164933.2947366-2-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.