From: Jani Nikula <jani.nikula@intel.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 07/16] drm/i915/mst: adapt intel_dp_mtp_tu_compute_config() for 128b/132b SST
Date: Thu, 02 Jan 2025 12:30:34 +0200 [thread overview]
Message-ID: <87a5c9o6d1.fsf@intel.com> (raw)
In-Reply-To: <Z3QY1txezARd21LY@ideak-desk.fi.intel.com>
On Tue, 31 Dec 2024, Imre Deak <imre.deak@intel.com> wrote:
> On Thu, Dec 19, 2024 at 11:33:56PM +0200, Jani Nikula wrote:
>> Handle 128b/132b SST in intel_dp_mtp_tu_compute_config(). The remote
>> bandwidth overhead and time slot allocation are only relevant for MST;
>> SST only needs the local bandwidth and a check that 64 slots isn't
>> exceeded.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_dp_mst.c | 109 +++++++++++---------
>> 1 file changed, 61 insertions(+), 48 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> index d08824d2fefe..3fbf9163272b 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> @@ -257,10 +257,7 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
>>
>> for (bpp = max_bpp; bpp >= min_bpp; bpp -= step) {
>> int local_bw_overhead;
>> - int remote_bw_overhead;
>> int link_bpp_x16;
>> - int remote_tu;
>> - fixed20_12 pbn;
>>
>> drm_dbg_kms(display->drm, "Trying bpp %d\n", bpp);
>>
>> @@ -269,57 +266,73 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
>>
>> local_bw_overhead = intel_dp_mst_bw_overhead(crtc_state,
>> false, dsc_slice_count, link_bpp_x16);
>> - remote_bw_overhead = intel_dp_mst_bw_overhead(crtc_state,
>> - true, dsc_slice_count, link_bpp_x16);
>> -
>> intel_dp_mst_compute_m_n(crtc_state,
>> local_bw_overhead,
>> link_bpp_x16,
>> &crtc_state->dp_m_n);
>>
>> - /*
>> - * The TU size programmed to the HW determines which slots in
>> - * an MTP frame are used for this stream, which needs to match
>> - * the payload size programmed to the first downstream branch
>> - * device's payload table.
>> - *
>> - * Note that atm the payload's PBN value DRM core sends via
>> - * the ALLOCATE_PAYLOAD side-band message matches the payload
>> - * size (which it calculates from the PBN value) it programs
>> - * to the first branch device's payload table. The allocation
>> - * in the payload table could be reduced though (to
>> - * crtc_state->dp_m_n.tu), provided that the driver doesn't
>> - * enable SSC on the corresponding link.
>> - */
>> - 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, 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 * pbn_div.full;
>> -
>> - drm_WARN_ON(display->drm, remote_tu < crtc_state->dp_m_n.tu);
>> - crtc_state->dp_m_n.tu = remote_tu;
>> + if (intel_dp->is_mst) {
>> + int remote_bw_overhead;
>> + int remote_tu;
>> + fixed20_12 pbn;
>
> Nit: pbn_div is only used for MST, so would (calculate/look it up from
> mst_state) here. Also this MST block could be in a separate function,
> perhaps for symmetry with the SST part in a function too, but this could
> be a follow-up as well. Either way:
I guess I'm just not sure yet which direction this should be taken. It
would be easy enough to add the functions, but is that the right
division? How to handle pbn_div in that case? How is UHBR SST DSC going
to impact all this?
I know I'm kind of weaseling out of fixing this up front, but I also try
to avoid adding stuff that we may have to back out of later.
I think I'd let this be for now.
> Reviewed-by: Imre Deak <imre.deak@intel.com>
Thanks,
Jani.
>
>> +
>> + remote_bw_overhead = intel_dp_mst_bw_overhead(crtc_state,
>> + true, dsc_slice_count, link_bpp_x16);
>> +
>> + /*
>> + * The TU size programmed to the HW determines which slots in
>> + * an MTP frame are used for this stream, which needs to match
>> + * the payload size programmed to the first downstream branch
>> + * device's payload table.
>> + *
>> + * Note that atm the payload's PBN value DRM core sends via
>> + * the ALLOCATE_PAYLOAD side-band message matches the payload
>> + * size (which it calculates from the PBN value) it programs
>> + * to the first branch device's payload table. The allocation
>> + * in the payload table could be reduced though (to
>> + * crtc_state->dp_m_n.tu), provided that the driver doesn't
>> + * enable SSC on the corresponding link.
>> + */
>> + 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, 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 * pbn_div.full;
>> +
>> + drm_WARN_ON(display->drm, remote_tu < crtc_state->dp_m_n.tu);
>> + crtc_state->dp_m_n.tu = remote_tu;
>> +
>> + slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
>> + connector->port,
>> + dfixed_trunc(pbn));
>> + } else {
>> + /* Same as above for remote_tu */
>> + crtc_state->dp_m_n.tu = ALIGN(crtc_state->dp_m_n.tu,
>> + 4 / crtc_state->lane_count);
>> +
>> + if (crtc_state->dp_m_n.tu <= 64)
>> + slots = crtc_state->dp_m_n.tu;
>> + else
>> + slots = -EINVAL;
>> + }
>>
>> - slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
>> - connector->port,
>> - dfixed_trunc(pbn));
>> if (slots == -EDEADLK)
>> return slots;
>>
>> --
>> 2.39.5
>>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-01-02 10:30 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 21:33 [PATCH v2 00/16] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
2024-12-19 21:33 ` [PATCH v2 01/16] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() Jani Nikula
2024-12-31 15:24 ` Imre Deak
2025-01-02 10:15 ` [PATCH] " Jani Nikula
2025-01-02 11:50 ` Jani Nikula
2024-12-19 21:33 ` [PATCH v2 02/16] drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead() Jani Nikula
2024-12-31 15:26 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 03/16] drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n() Jani Nikula
2024-12-31 15:27 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 04/16] drm/i915/mst: change return value of mst_stream_find_vcpi_slots_for_bpp() Jani Nikula
2024-12-31 15:34 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 05/16] drm/i915/mst: remove crtc_state->pbn Jani Nikula
2024-12-31 15:35 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 06/16] drm/i915/mst: split out a helper for figuring out the TU Jani Nikula
2024-12-31 15:51 ` Imre Deak
2025-01-02 10:19 ` Jani Nikula
2024-12-19 21:33 ` [PATCH v2 07/16] drm/i915/mst: adapt intel_dp_mtp_tu_compute_config() for 128b/132b SST Jani Nikula
2024-12-31 16:16 ` Imre Deak
2025-01-02 10:30 ` Jani Nikula [this message]
2025-01-02 13:40 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 08/16] drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST Jani Nikula
2024-12-31 16:21 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 09/16] drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST Jani Nikula
2024-12-31 16:27 ` Imre Deak
2024-12-19 21:33 ` [PATCH v2 10/16] drm/i915/ddi: write payload for 128b/132b SST Jani Nikula
2024-12-31 16:41 ` Imre Deak
2025-01-02 10:52 ` Jani Nikula
2025-01-02 13:54 ` Imre Deak
2024-12-19 21:34 ` [PATCH v2 11/16] drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers Jani Nikula
2024-12-31 16:44 ` Imre Deak
2024-12-31 16:52 ` Imre Deak
2025-01-02 9:39 ` Jani Nikula
2025-01-02 12:09 ` Imre Deak
2024-12-19 21:34 ` [PATCH v2 12/16] drm/i915/ddi: enable ACT handling for 128b/132b SST Jani Nikula
2025-01-02 15:59 ` Imre Deak
2024-12-19 21:34 ` [PATCH v2 13/16] drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout Jani Nikula
2025-01-02 14:41 ` Imre Deak
2025-01-03 11:30 ` Jani Nikula
2024-12-19 21:34 ` [PATCH v2 14/16] drm/i915/ddi: handle 128b/132b SST in intel_ddi_read_func_ctl() Jani Nikula
2025-01-02 14:45 ` Imre Deak
2024-12-19 21:34 ` [PATCH v2 15/16] drm/i915/ddi: disable trancoder port select for 128b/132b SST Jani Nikula
2025-01-02 15:03 ` Imre Deak
2024-12-19 21:34 ` [PATCH v2 16/16] drm/i915/dp: compute config for 128b/132b SST w/o DSC Jani Nikula
2025-01-02 15:13 ` Imre Deak
2025-01-03 11:35 ` Jani Nikula
2025-02-04 15:38 ` Imre Deak
2025-02-04 15:50 ` Jani Nikula
2024-12-19 21:40 ` ✓ CI.Patch_applied: success for drm/i915/dp: 128b/132b uncompressed SST (rev2) Patchwork
2024-12-19 21:41 ` ✗ CI.checkpatch: warning " Patchwork
2024-12-19 21:42 ` ✓ CI.KUnit: success " Patchwork
2024-12-19 22:00 ` ✓ CI.Build: " Patchwork
2024-12-19 22:02 ` ✓ CI.Hooks: " Patchwork
2024-12-19 22:04 ` ✗ CI.checksparse: warning " Patchwork
2024-12-19 22:43 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-20 22:05 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-02 10:23 ` ✓ CI.Patch_applied: success for drm/i915/dp: 128b/132b uncompressed SST (rev3) Patchwork
2025-01-02 10:24 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-02 10:25 ` ✓ CI.KUnit: success " Patchwork
2025-01-02 10:43 ` ✓ CI.Build: " Patchwork
2025-01-02 10:45 ` ✓ CI.Hooks: " Patchwork
2025-01-02 10:47 ` ✗ CI.checksparse: warning " Patchwork
2025-01-02 11:21 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-02 12:47 ` ✗ Xe.CI.Full: failure " Patchwork
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=87a5c9o6d1.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).