* [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST
@ 2024-12-13 10:39 Jani Nikula
2024-12-13 10:39 ` [RFC v0 01/13] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() Jani Nikula
` (14 more replies)
0 siblings, 15 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
This is a completely untested set towards enabling 128b/132b SST,
initially without support for compression. I erred on the side of
posting it early for comments instead of waiting until I've had a chance
to give it a spin on a display that supports 128b/132b SST.
I've chopped this up to unnecessarily small pieces just to make it
easier for me to juggle the patches. If desired, it's trivial to squash
them before posting the series for merging. But maybe this helps the
reviews too?
128b/132b SST+DSC still needs the compute config, and link training
fallbacks need to be reviewed with UHBR SST in mind, but this is the
first step.
Many thanks to Imre for helping me get the facts straight with MTP; all
errors are still mine.
BR,
Jani.
Jani Nikula (13):
drm/mst: remove mgr parameter and debug logging from
drm_dp_get_vc_payload_bw()
drm/i915/mst: use intel_dp_compute_config_limits() for DP MST
drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead()
drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n()
drm/i915/mst: change return value of
mst_stream_find_vcpi_slots_for_bpp()
drm/i915/mst: add helper independent of MST for figuring out the TU
drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST
drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST
drm/i915/ddi: write payload for 128b/132b SST
drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers
drm/i915/ddi: enable ACT handling for 128b/132b SST
drm/i915/ddi: start distinguishing 128b/132b SST and MST at state
readout
drm/i915/dp: compute config for 128b/132b SST w/o DSC
drivers/gpu/drm/display/drm_dp_mst_topology.c | 10 +-
drivers/gpu/drm/i915/display/intel_ddi.c | 76 ++++++++-
drivers/gpu/drm/i915/display/intel_dp.c | 67 +++++---
drivers/gpu/drm/i915/display/intel_dp.h | 10 +-
drivers/gpu/drm/i915/display/intel_dp_mst.c | 154 ++++++++----------
drivers/gpu/drm/i915/display/intel_dp_mst.h | 7 +
drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 +-
.../gpu/drm/tests/drm_dp_mst_helper_test.c | 4 +-
include/drm/display/drm_dp_mst_helper.h | 3 +-
9 files changed, 193 insertions(+), 141 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 17+ messages in thread
* [RFC v0 01/13] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw()
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 02/13] drm/i915/mst: use intel_dp_compute_config_limits() for DP MST Jani Nikula
` (13 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v,
Lyude Paul
The struct drm_dp_mst_topology_mgr *mgr parameter is only used for debug
logging in case the passed in link rate or lane count are zero. There's
no further error checking as such, and the function returns 0.
There should be no case where the parameters are zero. The returned
value is generally used as a divisor, and if we were hitting this, we'd
be seeing division by zero.
Just remove the debug logging altogether, along with the mgr parameter,
so that the function can be used in non-MST contexts without the
topology manager.
Cc: Imre Deak <imre.deak@intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/display/drm_dp_mst_topology.c | 10 ++--------
drivers/gpu/drm/i915/display/intel_dp_mst.c | 3 +--
drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 +--
drivers/gpu/drm/tests/drm_dp_mst_helper_test.c | 4 +---
include/drm/display/drm_dp_mst_helper.h | 3 +--
5 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 687c70308d82..89623ff7f8ea 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -3572,8 +3572,7 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr,
}
/**
- * drm_dp_get_vc_payload_bw - get the VC payload BW for an MST link
- * @mgr: The &drm_dp_mst_topology_mgr to use
+ * drm_dp_get_vc_payload_bw - get the VC payload BW for an MTP link
* @link_rate: link rate in 10kbits/s units
* @link_lane_count: lane count
*
@@ -3584,17 +3583,12 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr,
*
* Returns the BW / timeslot value in 20.12 fixed point format.
*/
-fixed20_12 drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr,
- int link_rate, int link_lane_count)
+fixed20_12 drm_dp_get_vc_payload_bw(int link_rate, int link_lane_count)
{
int ch_coding_efficiency =
drm_dp_bw_channel_coding_efficiency(drm_dp_is_uhbr_rate(link_rate));
fixed20_12 ret;
- if (link_rate == 0 || link_lane_count == 0)
- drm_dbg_kms(mgr->dev, "invalid link rate/lane count: (%d / %d)\n",
- link_rate, link_lane_count);
-
/* See DP v2.0 2.6.4.2, 2.7.6.3 VCPayload_Bandwidth_for_OneTimeSlotPer_MTP_Allocation */
ret.full = DIV_ROUND_DOWN_ULL(mul_u32_u32(link_rate * link_lane_count,
ch_coding_efficiency),
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 123c4ece6268..822500d4d2af 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -244,8 +244,7 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
crtc_state->fec_enable = !intel_dp_is_uhbr(crtc_state);
}
- mst_state->pbn_div = drm_dp_get_vc_payload_bw(&intel_dp->mst_mgr,
- crtc_state->port_clock,
+ mst_state->pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
crtc_state->lane_count);
max_dpt_bpp = intel_dp_mst_max_dpt_bpp(crtc_state, dsc);
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index eed579a6c858..36c3c99852e5 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -992,8 +992,7 @@ nv50_msto_atomic_check(struct drm_encoder *encoder,
if (!mst_state->pbn_div.full) {
struct nouveau_encoder *outp = mstc->mstm->outp;
- mst_state->pbn_div = drm_dp_get_vc_payload_bw(&mstm->mgr,
- outp->dp.link_bw, outp->dp.link_nr);
+ mst_state->pbn_div = drm_dp_get_vc_payload_bw(outp->dp.link_bw, outp->dp.link_nr);
}
slots = drm_dp_atomic_find_time_slots(state, &mstm->mgr, mstc->port, asyh->dp.pbn);
diff --git a/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c b/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
index 89cd9e4f4d32..ad29593d28cf 100644
--- a/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
@@ -199,10 +199,8 @@ static const struct drm_dp_mst_calc_pbn_div_test drm_dp_mst_calc_pbn_div_dp1_4_c
static void drm_test_dp_mst_calc_pbn_div(struct kunit *test)
{
const struct drm_dp_mst_calc_pbn_div_test *params = test->param_value;
- /* mgr->dev is only needed by drm_dbg_kms(), but it's not called for the test cases. */
- struct drm_dp_mst_topology_mgr *mgr = test->priv;
- KUNIT_EXPECT_EQ(test, drm_dp_get_vc_payload_bw(mgr, params->link_rate, params->lane_count).full,
+ KUNIT_EXPECT_EQ(test, drm_dp_get_vc_payload_bw(params->link_rate, params->lane_count).full,
params->expected.full);
}
diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h
index a80ba457a858..e39de161c938 100644
--- a/include/drm/display/drm_dp_mst_helper.h
+++ b/include/drm/display/drm_dp_mst_helper.h
@@ -867,8 +867,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector,
struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port);
-fixed20_12 drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr,
- int link_rate, int link_lane_count);
+fixed20_12 drm_dp_get_vc_payload_bw(int link_rate, int link_lane_count);
int drm_dp_calc_pbn_mode(int clock, int bpp);
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 02/13] drm/i915/mst: use intel_dp_compute_config_limits() for DP MST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 01/13] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 03/13] drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead() Jani Nikula
` (12 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
There's a lot of duplication between mst_stream_compute_config_limits()
and intel_dp_compute_config_limits(). Adjust the latter to suit the
needs of the former, and use the same function for both. This reduces
duplication and highlights the differences for SST and MST and UHBR.
Remove the kernel-doc for intel_dp_compute_config_link_bpp_limits()
which now becomes static.
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 44 +++++++++++++--------
drivers/gpu/drm/i915/display/intel_dp.h | 10 ++---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 29 +-------------
3 files changed, 34 insertions(+), 49 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index f8100c4f4d20..9b930622b8ce 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2455,19 +2455,11 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
return 0;
}
-/**
- * intel_dp_compute_config_link_bpp_limits - compute output link bpp limits
- * @intel_dp: intel DP
- * @crtc_state: crtc state
- * @dsc: DSC compression mode
- * @limits: link configuration limits
- *
- * Calculates the output link min, max bpp values in @limits based on the
- * pipe bpp range, @crtc_state and @dsc mode.
- *
- * Returns %true in case of success.
+/*
+ * Calculate the output link min, max bpp values in limits based on the pipe bpp
+ * range, crtc_state and dsc mode. Return true on success.
*/
-bool
+static bool
intel_dp_compute_config_link_bpp_limits(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
bool dsc,
@@ -2515,29 +2507,47 @@ intel_dp_compute_config_link_bpp_limits(struct intel_dp *intel_dp,
return true;
}
-static bool
+bool
intel_dp_compute_config_limits(struct intel_dp *intel_dp,
struct intel_crtc_state *crtc_state,
bool respect_downstream_limits,
bool dsc,
struct link_config_limits *limits)
{
+ bool is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST);
+
limits->min_rate = intel_dp_min_link_rate(intel_dp);
limits->max_rate = intel_dp_max_link_rate(intel_dp);
/* FIXME 128b/132b SST support missing */
- limits->max_rate = min(limits->max_rate, 810000);
+ if (!is_mst)
+ limits->max_rate = min(limits->max_rate, 810000);
limits->min_rate = min(limits->min_rate, limits->max_rate);
limits->min_lane_count = intel_dp_min_lane_count(intel_dp);
limits->max_lane_count = intel_dp_max_lane_count(intel_dp);
limits->pipe.min_bpp = intel_dp_min_bpp(crtc_state->output_format);
- limits->pipe.max_bpp = intel_dp_max_bpp(intel_dp, crtc_state,
- respect_downstream_limits);
+ if (is_mst) {
+ /*
+ * FIXME: If all the streams can't fit into the link with their
+ * current pipe_bpp we should reduce pipe_bpp across the board
+ * until things start to fit. Until then we limit to <= 8bpc
+ * since that's what was hardcoded for all MST streams
+ * previously. This hack should be removed once we have the
+ * proper retry logic in place.
+ */
+ limits->pipe.max_bpp = min(crtc_state->pipe_bpp, 24);
+ } else {
+ limits->pipe.max_bpp = intel_dp_max_bpp(intel_dp, crtc_state,
+ respect_downstream_limits);
+ }
- if (intel_dp->use_max_params) {
+ if (is_mst || intel_dp->use_max_params) {
/*
+ * For MST we always configure max link bw - the spec doesn't
+ * seem to suggest we should do otherwise.
+ *
* Use the maximum clock and number of lanes the eDP panel
* advertizes being capable of in case the initial fast
* optimal params failed us. The panels are generally
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 48f10876be65..8572d7df5335 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -193,11 +193,11 @@ void intel_dp_invalidate_source_oui(struct intel_dp *intel_dp);
void intel_dp_wait_source_oui(struct intel_dp *intel_dp);
int intel_dp_output_bpp(enum intel_output_format output_format, int bpp);
-bool
-intel_dp_compute_config_link_bpp_limits(struct intel_dp *intel_dp,
- const struct intel_crtc_state *crtc_state,
- bool dsc,
- struct link_config_limits *limits);
+bool intel_dp_compute_config_limits(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state,
+ bool respect_downstream_limits,
+ bool dsc,
+ struct link_config_limits *limits);
void intel_dp_get_dsc_sink_cap(u8 dpcd_rev, struct intel_connector *connector);
bool intel_dp_has_gamut_metadata_dip(struct intel_encoder *encoder);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 822500d4d2af..67b0e40a7888 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -584,33 +584,8 @@ mst_stream_compute_config_limits(struct intel_dp *intel_dp,
bool dsc,
struct link_config_limits *limits)
{
- /*
- * for MST we always configure max link bw - the spec doesn't
- * seem to suggest we should do otherwise.
- */
- limits->min_rate = limits->max_rate =
- intel_dp_max_link_rate(intel_dp);
-
- limits->min_lane_count = limits->max_lane_count =
- intel_dp_max_lane_count(intel_dp);
-
- limits->pipe.min_bpp = intel_dp_min_bpp(crtc_state->output_format);
- /*
- * FIXME: If all the streams can't fit into the link with
- * their current pipe_bpp we should reduce pipe_bpp across
- * the board until things start to fit. Until then we
- * limit to <= 8bpc since that's what was hardcoded for all
- * MST streams previously. This hack should be removed once
- * we have the proper retry logic in place.
- */
- limits->pipe.max_bpp = min(crtc_state->pipe_bpp, 24);
-
- intel_dp_test_compute_config(intel_dp, crtc_state, limits);
-
- if (!intel_dp_compute_config_link_bpp_limits(intel_dp,
- crtc_state,
- dsc,
- limits))
+ if (!intel_dp_compute_config_limits(intel_dp, crtc_state, false, dsc,
+ limits))
return false;
return adjust_limits_for_dsc_hblank_expansion_quirk(connector,
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 03/13] drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead()
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 01/13] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() Jani Nikula
2024-12-13 10:39 ` [RFC v0 02/13] drm/i915/mst: use intel_dp_compute_config_limits() for DP MST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 04/13] drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n() Jani Nikula
` (11 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
intel_dp_mst_bw_overhead() doesn't need the connector. Remove the
parameter.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 67b0e40a7888..b7e4c530f7a6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -139,7 +139,6 @@ static int intel_dp_mst_max_dpt_bpp(const struct intel_crtc_state *crtc_state,
}
static int intel_dp_mst_bw_overhead(const struct intel_crtc_state *crtc_state,
- const struct intel_connector *connector,
bool ssc, int dsc_slice_count, int bpp_x16)
{
const struct drm_display_mode *adjusted_mode =
@@ -278,9 +277,9 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
link_bpp_x16 = fxp_q4_from_int(dsc ? bpp :
intel_dp_output_bpp(crtc_state->output_format, bpp));
- local_bw_overhead = intel_dp_mst_bw_overhead(crtc_state, connector,
+ 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, connector,
+ 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, connector,
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 04/13] drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n()
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (2 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 03/13] drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead() Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 05/13] drm/i915/mst: change return value of mst_stream_find_vcpi_slots_for_bpp() Jani Nikula
` (10 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
intel_dp_mst_compute_m_n() doesn't need the connector. Remove the
parameter.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index b7e4c530f7a6..322c8a1c8b0e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -167,7 +167,6 @@ static int intel_dp_mst_bw_overhead(const struct intel_crtc_state *crtc_state,
}
static void intel_dp_mst_compute_m_n(const struct intel_crtc_state *crtc_state,
- const struct intel_connector *connector,
int overhead,
int bpp_x16,
struct intel_link_m_n *m_n)
@@ -282,7 +281,7 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
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, connector,
+ intel_dp_mst_compute_m_n(crtc_state,
local_bw_overhead,
link_bpp_x16,
&crtc_state->dp_m_n);
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 05/13] drm/i915/mst: change return value of mst_stream_find_vcpi_slots_for_bpp()
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (3 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 04/13] drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n() Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU Jani Nikula
` (9 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
The callers of mst_stream_find_vcpi_slots_for_bpp() don't need the
returned slots for anything. On the contrary, they need to jump through
hoops to just distinguish between success and failure. Just return 0
instead of slots from mst_stream_find_vcpi_slots_for_bpp() for success,
and simplify the callers.
There's a pointless ret local variable that we can drop in the process.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 52 +++++++--------------
1 file changed, 18 insertions(+), 34 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 322c8a1c8b0e..5218b1f7679a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -226,7 +226,6 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
int bpp, slots = -EINVAL;
int dsc_slice_count = 0;
int max_dpt_bpp;
- int ret = 0;
mst_state = drm_atomic_get_mst_topology_state(state, &intel_dp->mst_mgr);
if (IS_ERR(mst_state))
@@ -340,23 +339,21 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
}
}
- /* We failed to find a proper bpp/timeslots, return error */
- if (ret)
- slots = ret;
-
if (slots < 0) {
drm_dbg_kms(display->drm, "failed finding vcpi slots:%d\n",
slots);
- } else {
- if (!dsc)
- crtc_state->pipe_bpp = bpp;
- else
- crtc_state->dsc.compressed_bpp_x16 = fxp_q4_from_int(bpp);
- drm_dbg_kms(display->drm, "Got %d slots for pipe bpp %d dsc %d\n",
- slots, bpp, dsc);
+ return slots;
}
- return slots;
+ if (!dsc)
+ crtc_state->pipe_bpp = bpp;
+ else
+ crtc_state->dsc.compressed_bpp_x16 = fxp_q4_from_int(bpp);
+
+ drm_dbg_kms(display->drm, "Got %d slots for pipe bpp %d dsc %d\n",
+ slots, bpp, dsc);
+
+ return 0;
}
static int mst_stream_compute_link_config(struct intel_dp *intel_dp,
@@ -364,22 +361,15 @@ static int mst_stream_compute_link_config(struct intel_dp *intel_dp,
struct drm_connector_state *conn_state,
struct link_config_limits *limits)
{
- int slots = -EINVAL;
-
/*
* FIXME: allocate the BW according to link_bpp, which in the case of
* YUV420 is only half of the pipe bpp value.
*/
- slots = mst_stream_find_vcpi_slots_for_bpp(intel_dp, crtc_state,
- fxp_q4_to_int(limits->link.max_bpp_x16),
- fxp_q4_to_int(limits->link.min_bpp_x16),
- limits,
- conn_state, 2 * 3, false);
-
- if (slots < 0)
- return slots;
-
- return 0;
+ return mst_stream_find_vcpi_slots_for_bpp(intel_dp, crtc_state,
+ fxp_q4_to_int(limits->link.max_bpp_x16),
+ fxp_q4_to_int(limits->link.min_bpp_x16),
+ limits,
+ conn_state, 2 * 3, false);
}
static int mst_stream_dsc_compute_link_config(struct intel_dp *intel_dp,
@@ -390,7 +380,6 @@ static int mst_stream_dsc_compute_link_config(struct intel_dp *intel_dp,
struct intel_display *display = to_intel_display(intel_dp);
struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct drm_i915_private *i915 = to_i915(connector->base.dev);
- int slots = -EINVAL;
int i, num_bpc;
u8 dsc_bpc[3] = {};
int min_bpp, max_bpp, sink_min_bpp, sink_max_bpp;
@@ -452,14 +441,9 @@ static int mst_stream_dsc_compute_link_config(struct intel_dp *intel_dp,
min_compressed_bpp = intel_dp_dsc_nearest_valid_bpp(i915, min_compressed_bpp,
crtc_state->pipe_bpp);
- slots = mst_stream_find_vcpi_slots_for_bpp(intel_dp, crtc_state, max_compressed_bpp,
- min_compressed_bpp, limits,
- conn_state, 1, true);
-
- if (slots < 0)
- return slots;
-
- return 0;
+ return mst_stream_find_vcpi_slots_for_bpp(intel_dp, crtc_state, max_compressed_bpp,
+ min_compressed_bpp, limits,
+ conn_state, 1, true);
}
static int mst_stream_update_slots(struct intel_dp *intel_dp,
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (4 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 05/13] drm/i915/mst: change return value of mst_stream_find_vcpi_slots_for_bpp() Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 18:44 ` Imre Deak
2024-12-13 10:39 ` [RFC v0 07/13] drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST Jani Nikula
` (8 subsequent siblings)
14 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
Extract intel_dp_mtp_tu_compute_config() independent of MST for figuring
out the TU. Move the link configuration and mst state access to the
callers. This should be usable for 128b/132b SST as well.
The name isn't great, and it's all a bit too interconnected instead of
having more generic building blocks, but should do the job.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 64 ++++++++++++++-------
drivers/gpu/drm/i915/display/intel_dp_mst.h | 7 +++
2 files changed, 50 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 5218b1f7679a..8ad42c757ddf 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -209,31 +209,23 @@ static int intel_dp_mst_dsc_get_slice_count(const struct intel_connector *connec
num_joined_pipes);
}
-static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
- struct intel_crtc_state *crtc_state,
- int max_bpp, int min_bpp,
- struct link_config_limits *limits,
- struct drm_connector_state *conn_state,
- int step, bool dsc)
+int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state,
+ int max_bpp, int min_bpp,
+ struct drm_connector_state *conn_state,
+ int step, bool dsc)
{
struct intel_display *display = to_intel_display(intel_dp);
struct drm_atomic_state *state = crtc_state->uapi.state;
- struct drm_dp_mst_topology_state *mst_state;
struct intel_connector *connector =
to_intel_connector(conn_state->connector);
const struct drm_display_mode *adjusted_mode =
&crtc_state->hw.adjusted_mode;
+ fixed20_12 pbn_div;
int bpp, slots = -EINVAL;
int dsc_slice_count = 0;
int max_dpt_bpp;
- mst_state = drm_atomic_get_mst_topology_state(state, &intel_dp->mst_mgr);
- if (IS_ERR(mst_state))
- return PTR_ERR(mst_state);
-
- crtc_state->lane_count = limits->max_lane_count;
- crtc_state->port_clock = limits->max_rate;
-
if (dsc) {
if (!intel_dp_supports_fec(intel_dp, connector, crtc_state))
return -EINVAL;
@@ -241,8 +233,8 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
crtc_state->fec_enable = !intel_dp_is_uhbr(crtc_state);
}
- mst_state->pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
- crtc_state->lane_count);
+ pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
+ crtc_state->lane_count);
max_dpt_bpp = intel_dp_mst_max_dpt_bpp(crtc_state, dsc);
if (max_bpp > max_dpt_bpp) {
@@ -302,7 +294,7 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
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(pbn.full, pbn_div.full);
/*
* Aligning the TUs ensures that symbols consisting of multiple
@@ -320,15 +312,20 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
* 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;
+ pbn.full = remote_tu * pbn_div.full;
crtc_state->pbn = dfixed_trunc(pbn);
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,
- crtc_state->pbn);
+ if (intel_dp->is_mst)
+ slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
+ connector->port,
+ crtc_state->pbn);
+ else
+ /* FIXME: cross-check against pbn_div? */
+ slots = crtc_state->dp_m_n.tu;
+
if (slots == -EDEADLK)
return slots;
@@ -356,6 +353,31 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
return 0;
}
+static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state,
+ int max_bpp, int min_bpp,
+ struct link_config_limits *limits,
+ struct drm_connector_state *conn_state,
+ int step, bool dsc)
+{
+ struct drm_atomic_state *state = crtc_state->uapi.state;
+ struct drm_dp_mst_topology_state *mst_state;
+
+ mst_state = drm_atomic_get_mst_topology_state(state, &intel_dp->mst_mgr);
+ if (IS_ERR(mst_state))
+ return PTR_ERR(mst_state);
+
+ crtc_state->lane_count = limits->max_lane_count;
+ crtc_state->port_clock = limits->max_rate;
+
+ mst_state->pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
+ crtc_state->lane_count);
+
+ return intel_dp_mtp_tu_compute_config(intel_dp, crtc_state,
+ max_bpp, min_bpp,
+ conn_state, step, dsc);
+}
+
static int mst_stream_compute_link_config(struct intel_dp *intel_dp,
struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.h b/drivers/gpu/drm/i915/display/intel_dp_mst.h
index 8343804ce3f8..c6bdc1d190a4 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.h
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.h
@@ -8,6 +8,7 @@
#include <linux/types.h>
+struct drm_connector_state;
struct intel_atomic_state;
struct intel_crtc;
struct intel_crtc_state;
@@ -30,4 +31,10 @@ bool intel_dp_mst_crtc_needs_modeset(struct intel_atomic_state *state,
void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp);
bool intel_dp_mst_verify_dpcd_state(struct intel_dp *intel_dp);
+int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state,
+ int max_bpp, int min_bpp,
+ struct drm_connector_state *conn_state,
+ int step, bool dsc);
+
#endif /* __INTEL_DP_MST_H__ */
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 07/13] drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (5 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 08/13] drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST Jani Nikula
` (7 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
128b/132b SST needs 128b/132b mode enabled in the TRANS_DDI_FUNC_CTL
register.
This is preparation for enabling 128b/132b SST. This path is not
reachable yet.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 4f9c50996446..ec5f0534f4df 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -577,7 +577,10 @@ intel_ddi_transcoder_func_reg_val_get(struct intel_encoder *encoder,
temp |= TRANS_DDI_MST_TRANSPORT_SELECT(master);
}
} else {
- temp |= TRANS_DDI_MODE_SELECT_DP_SST;
+ if (intel_dp_is_uhbr(crtc_state))
+ temp |= TRANS_DDI_MODE_SELECT_FDI_OR_128B132B;
+ else
+ temp |= TRANS_DDI_MODE_SELECT_DP_SST;
temp |= DDI_PORT_WIDTH(crtc_state->lane_count);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 08/13] drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (6 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 07/13] drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 09/13] drm/i915/ddi: write payload for 128b/132b SST Jani Nikula
` (6 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
It's not very clearly specified, and the hardware bit is ill-named, but
128b/132b SST also needs the MST mode set in the DP_TP_CTL register.
This is preparation for enabling 128b/132b SST. This path is not
reachable yet.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index ec5f0534f4df..eebeebef42ed 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3658,7 +3658,8 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
/* 6.d Configure and enable DP_TP_CTL with link training pattern 1 selected */
dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
- if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
+ if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
+ intel_dp_is_uhbr(crtc_state)) {
dp_tp_ctl |= DP_TP_CTL_MODE_MST;
} else {
dp_tp_ctl |= DP_TP_CTL_MODE_SST;
@@ -3718,7 +3719,8 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
}
dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
- if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
+ if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
+ intel_dp_is_uhbr(crtc_state)) {
dp_tp_ctl |= DP_TP_CTL_MODE_MST;
} else {
dp_tp_ctl |= DP_TP_CTL_MODE_SST;
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 09/13] drm/i915/ddi: write payload for 128b/132b SST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (7 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 08/13] drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 10/13] drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers Jani Nikula
` (5 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
Write the payload allocation table for 128b/132b SST. Use VCPID 1 and
start from slot 0, with dp_m_n.tu slots.
This is preparation for enabling 128b/132b SST. This path is not
reachable yet. Indeed, we don't yet compute TU for 128b/132b SST.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index eebeebef42ed..ebe098ef396a 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2671,6 +2671,12 @@ static void mtl_ddi_pre_enable_dp(struct intel_atomic_state *state,
/* 6.o Configure and enable FEC if needed */
intel_ddi_enable_fec(encoder, crtc_state);
+ /* 7.a 128b/132b SST. */
+ if (!is_mst && intel_dp_is_uhbr(crtc_state)) {
+ /* VCPID 1, start slot 0 for 128b/132b, tu slots */
+ drm_dp_dpcd_write_payload(&intel_dp->aux, 1, 0, crtc_state->dp_m_n.tu);
+ }
+
if (!is_mst)
intel_dsc_dp_pps_write(encoder, crtc_state);
}
@@ -2810,6 +2816,11 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,
/* 7.l Configure and enable FEC if needed */
intel_ddi_enable_fec(encoder, crtc_state);
+ if (!is_mst && intel_dp_is_uhbr(crtc_state)) {
+ /* VCPID 1, start slot 0 for 128b/132b, tu slots */
+ drm_dp_dpcd_write_payload(&intel_dp->aux, 1, 0, crtc_state->dp_m_n.tu);
+ }
+
if (!is_mst)
intel_dsc_dp_pps_write(encoder, crtc_state);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 10/13] drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (8 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 09/13] drm/i915/ddi: write payload for 128b/132b SST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 11/13] drm/i915/ddi: enable ACT handling for 128b/132b SST Jani Nikula
` (4 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
Write the DP2 specific VFREQ registers.
This is preparation for enabling 128b/132b SST. This path is not
reachable yet.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index ebe098ef396a..5f96fc629429 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3469,8 +3469,20 @@ static void intel_ddi_enable(struct intel_atomic_state *state,
{
struct intel_display *display = to_intel_display(encoder);
struct intel_crtc *pipe_crtc;
+ enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
int i;
+ /* 128b/132b SST */
+ if (intel_dp_is_uhbr(crtc_state)) {
+ const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
+ u64 crtc_clock_hz = KHz(adjusted_mode->crtc_clock);
+
+ intel_de_write(display, TRANS_DP2_VFREQHIGH(cpu_transcoder),
+ TRANS_DP2_VFREQ_PIXEL_CLOCK(crtc_clock_hz >> 24));
+ intel_de_write(display, TRANS_DP2_VFREQLOW(cpu_transcoder),
+ TRANS_DP2_VFREQ_PIXEL_CLOCK(crtc_clock_hz & 0xffffff));
+ }
+
intel_ddi_enable_transcoder_func(encoder, crtc_state);
/* Enable/Disable DP2.0 SDP split config before transcoder */
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 11/13] drm/i915/ddi: enable ACT handling for 128b/132b SST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (9 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 10/13] drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 12/13] drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout Jani Nikula
` (3 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
Add ACT handling for 128b/132b SST.
This is preparation for enabling 128b/132b SST. This path is not
reachable yet.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 5f96fc629429..5f1528179038 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3488,6 +3488,19 @@ static void intel_ddi_enable(struct intel_atomic_state *state,
/* Enable/Disable DP2.0 SDP split config before transcoder */
intel_audio_sdp_split_update(crtc_state);
+ /* 128b/132b SST */
+ if (intel_dp_is_uhbr(crtc_state)) {
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+
+ intel_ddi_clear_act_sent(encoder, crtc_state);
+
+ intel_de_rmw(display, TRANS_DDI_FUNC_CTL(display, cpu_transcoder), 0,
+ TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
+
+ intel_ddi_wait_for_act_sent(encoder, crtc_state);
+ drm_dp_dpcd_poll_act_handled(&intel_dp->aux, 0);
+ }
+
intel_enable_transcoder(crtc_state);
intel_ddi_wait_for_fec_status(encoder, crtc_state, true);
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 12/13] drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (10 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 11/13] drm/i915/ddi: enable ACT handling for 128b/132b SST Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 10:39 ` [RFC v0 13/13] drm/i915/dp: compute config for 128b/132b SST w/o DSC Jani Nikula
` (2 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
We'll want to distinguish 128b/132b SST and MST modes at state
readout. There's a catch, though. From the hardware perspective,
128b/132b SST and MST programming are pretty much the same. And we can't
really ask the sink at this point.
If we have more than one transcoder in 128b/132b mode associated with
the port, we can safely assume it's MST. But for MST with only a single
stream enabled, we are pretty much out of luck. Let's fall back to
looking at the software state, i.e. intel_dp->is_mst. It should be fine
for the state checker, but for hardware takeover at probe, we'll have to
trust the GOP has only enabled SST.
TODO: Not sure how this *or* our current code handles 128b/132b enabled
by GOP.
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 29 +++++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 5f1528179038..21dba8735085 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -788,7 +788,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
intel_wakeref_t wakeref;
enum pipe p;
u32 tmp;
- u8 mst_pipe_mask;
+ u8 mst_pipe_mask = 0, dp128b132b_pipe_mask = 0;
*pipe_mask = 0;
*is_dp_mst = false;
@@ -825,7 +825,6 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
goto out;
}
- mst_pipe_mask = 0;
for_each_pipe(dev_priv, p) {
enum transcoder cpu_transcoder = (enum transcoder)p;
u32 port_mask, ddi_select, ddi_mode;
@@ -854,9 +853,10 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
ddi_mode = tmp & TRANS_DDI_MODE_SELECT_MASK;
- if (ddi_mode == TRANS_DDI_MODE_SELECT_DP_MST ||
- (ddi_mode == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B && HAS_DP20(display)))
+ if (ddi_mode == TRANS_DDI_MODE_SELECT_DP_MST)
mst_pipe_mask |= BIT(p);
+ else if (ddi_mode == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B && HAS_DP20(display))
+ dp128b132b_pipe_mask |= BIT(p);
*pipe_mask |= BIT(p);
}
@@ -866,6 +866,23 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
"No pipe for [ENCODER:%d:%s] found\n",
encoder->base.base.id, encoder->base.name);
+ if (!mst_pipe_mask && dp128b132b_pipe_mask) {
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+
+ /*
+ * If we don't have 8b/10b MST, but have more than one
+ * transcoder in 128b/132b mode, we know it must be 128b/132b
+ * MST.
+ *
+ * Otherwise, we fall back to checking the current MST
+ * state. It's not accurate for hardware takeover at probe, but
+ * we don't expect MST to have been enabled at that point, and
+ * can assume it's SST.
+ */
+ if (hweight8(dp128b132b_pipe_mask) > 1 || intel_dp->is_mst)
+ mst_pipe_mask = dp128b132b_pipe_mask;
+ }
+
if (!mst_pipe_mask && hweight8(*pipe_mask) > 1) {
drm_dbg_kms(&dev_priv->drm,
"Multiple pipes for [ENCODER:%d:%s] (pipe_mask %02x)\n",
@@ -876,9 +893,9 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
if (mst_pipe_mask && mst_pipe_mask != *pipe_mask)
drm_dbg_kms(&dev_priv->drm,
- "Conflicting MST and non-MST state for [ENCODER:%d:%s] (pipe_mask %02x mst_pipe_mask %02x)\n",
+ "Conflicting MST and non-MST state for [ENCODER:%d:%s] (pipe masks: all %02x, MST %02x, 128b/132b %02x)\n",
encoder->base.base.id, encoder->base.name,
- *pipe_mask, mst_pipe_mask);
+ *pipe_mask, mst_pipe_mask, dp128b132b_pipe_mask);
else
*is_dp_mst = mst_pipe_mask;
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [RFC v0 13/13] drm/i915/dp: compute config for 128b/132b SST w/o DSC
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (11 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 12/13] drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout Jani Nikula
@ 2024-12-13 10:39 ` Jani Nikula
2024-12-13 11:53 ` ✗ Fi.CI.SPARSE: warning for drm/i915/dp: 128b/132b uncompressed SST Patchwork
2024-12-13 12:08 ` ✗ i915.CI.BAT: failure " Patchwork
14 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2024-12-13 10:39 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: jani.nikula, imre.deak, ville.syrjala, nagavenkata.srikanth.v
Enable basic 128b/132b SST functionality without compression. Reuse
intel_dp_mtp_tu_compute_config() to figure out the TU after we've
determined we need to use an UHBR rate.
It's slightly complicated as the M/N computation is done in different
places in MST and SST paths, so we need to avoid trashing the values
later for UHBR.
If uncompressed UHBR fails, we drop to compressed non-UHBR, which is
quite likely to fail as well. We still lack 128b/132b SST+DSC.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 9b930622b8ce..68ce9765eaf2 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2519,8 +2519,8 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
limits->min_rate = intel_dp_min_link_rate(intel_dp);
limits->max_rate = intel_dp_max_link_rate(intel_dp);
- /* FIXME 128b/132b SST support missing */
- if (!is_mst)
+ /* FIXME 128b/132b SST+DSC support missing */
+ if (!is_mst && dsc)
limits->max_rate = min(limits->max_rate, 810000);
limits->min_rate = min(limits->min_rate, limits->max_rate);
@@ -2634,6 +2634,13 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
*/
ret = intel_dp_compute_link_config_wide(intel_dp, pipe_config,
conn_state, &limits);
+ if (!ret && intel_dp_is_uhbr(pipe_config))
+ ret = intel_dp_mtp_tu_compute_config(intel_dp,
+ pipe_config,
+ pipe_config->pipe_bpp,
+ pipe_config->pipe_bpp,
+ conn_state,
+ 0, false);
if (ret)
dsc_needed = true;
}
@@ -3171,12 +3178,14 @@ intel_dp_compute_config(struct intel_encoder *encoder,
intel_dp_audio_compute_config(encoder, pipe_config, conn_state);
- intel_link_compute_m_n(link_bpp_x16,
- pipe_config->lane_count,
- adjusted_mode->crtc_clock,
- pipe_config->port_clock,
- intel_dp_bw_fec_overhead(pipe_config->fec_enable),
- &pipe_config->dp_m_n);
+ if (!intel_dp_is_uhbr(pipe_config)) {
+ intel_link_compute_m_n(link_bpp_x16,
+ pipe_config->lane_count,
+ adjusted_mode->crtc_clock,
+ pipe_config->port_clock,
+ intel_dp_bw_fec_overhead(pipe_config->fec_enable),
+ &pipe_config->dp_m_n);
+ }
/* FIXME: abstract this better */
if (pipe_config->splitter.enable)
--
2.39.5
^ permalink raw reply related [flat|nested] 17+ messages in thread
* ✗ Fi.CI.SPARSE: warning for drm/i915/dp: 128b/132b uncompressed SST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (12 preceding siblings ...)
2024-12-13 10:39 ` [RFC v0 13/13] drm/i915/dp: compute config for 128b/132b SST w/o DSC Jani Nikula
@ 2024-12-13 11:53 ` Patchwork
2024-12-13 12:08 ` ✗ i915.CI.BAT: failure " Patchwork
14 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2024-12-13 11:53 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/dp: 128b/132b uncompressed SST
URL : https://patchwork.freedesktop.org/series/142547/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✗ i915.CI.BAT: failure for drm/i915/dp: 128b/132b uncompressed SST
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
` (13 preceding siblings ...)
2024-12-13 11:53 ` ✗ Fi.CI.SPARSE: warning for drm/i915/dp: 128b/132b uncompressed SST Patchwork
@ 2024-12-13 12:08 ` Patchwork
14 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2024-12-13 12:08 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/dp: 128b/132b uncompressed SST
URL : https://patchwork.freedesktop.org/series/142547/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_15837 -> Patchwork_142547v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_142547v1 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_142547v1, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/index.html
Participating hosts (45 -> 44)
------------------------------
Missing (1): fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_142547v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gt_lrc:
- bat-jsl-3: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-jsl-3/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-jsl-3/igt@i915_selftest@live@gt_lrc.html
Known issues
------------
Here are the changes found in Patchwork_142547v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@debugfs_test@basic-hwmon:
- fi-pnv-d510: NOTRUN -> [SKIP][3] +3 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/fi-pnv-d510/igt@debugfs_test@basic-hwmon.html
* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: NOTRUN -> [ABORT][4] ([i915#13169])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
* igt@i915_pm_rpm@module-reload:
- bat-dg1-7: [PASS][5] -> [FAIL][6] ([i915#12903])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-dg1-7/igt@i915_pm_rpm@module-reload.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-dg1-7/igt@i915_pm_rpm@module-reload.html
* igt@i915_selftest@live:
- bat-arls-5: NOTRUN -> [ABORT][7] ([i915#12061])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-arls-5/igt@i915_selftest@live.html
- bat-jsl-3: [PASS][8] -> [INCOMPLETE][9] ([i915#13241])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-jsl-3/igt@i915_selftest@live.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-jsl-3/igt@i915_selftest@live.html
* igt@i915_selftest@live@workarounds:
- bat-arlh-3: [PASS][10] -> [ABORT][11] ([i915#12061]) +1 other test abort
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-arlh-3/igt@i915_selftest@live@workarounds.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-arlh-3/igt@i915_selftest@live@workarounds.html
- bat-arls-5: [PASS][12] -> [ABORT][13] ([i915#12061])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-arls-5/igt@i915_selftest@live@workarounds.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-arls-5/igt@i915_selftest@live@workarounds.html
- bat-mtlp-6: [PASS][14] -> [ABORT][15] ([i915#12061]) +1 other test abort
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-mtlp-6/igt@i915_selftest@live@workarounds.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-mtlp-6/igt@i915_selftest@live@workarounds.html
#### Possible fixes ####
* igt@dmabuf@all-tests:
- bat-apl-1: [INCOMPLETE][16] ([i915#12904]) -> [PASS][17] +1 other test pass
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-apl-1/igt@dmabuf@all-tests.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-apl-1/igt@dmabuf@all-tests.html
* igt@i915_module_load@load:
- fi-pnv-d510: [ABORT][18] ([i915#13203]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/fi-pnv-d510/igt@i915_module_load@load.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/fi-pnv-d510/igt@i915_module_load@load.html
* igt@i915_pm_rpm@module-reload:
- bat-rpls-4: [FAIL][20] ([i915#12903]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15837/bat-rpls-4/igt@i915_pm_rpm@module-reload.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/bat-rpls-4/igt@i915_pm_rpm@module-reload.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
[i915#12903]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12903
[i915#12904]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12904
[i915#13169]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13169
[i915#13203]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13203
[i915#13241]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13241
Build changes
-------------
* Linux: CI_DRM_15837 -> Patchwork_142547v1
CI-20190529: 20190529
CI_DRM_15837: 8f7b64e137723da601f3c07d0cda22566cf994d5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8154: 8603734a61b57f766ee60f24e63d18f88232a3c6 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_142547v1: 8f7b64e137723da601f3c07d0cda22566cf994d5 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142547v1/index.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU
2024-12-13 10:39 ` [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU Jani Nikula
@ 2024-12-13 18:44 ` Imre Deak
0 siblings, 0 replies; 17+ messages in thread
From: Imre Deak @ 2024-12-13 18:44 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx, intel-xe, ville.syrjala, nagavenkata.srikanth.v
On Fri, Dec 13, 2024 at 12:39:50PM +0200, Jani Nikula wrote:
> Extract intel_dp_mtp_tu_compute_config() independent of MST for figuring
> out the TU. Move the link configuration and mst state access to the
> callers. This should be usable for 128b/132b SST as well.
>
> The name isn't great, and it's all a bit too interconnected instead of
> having more generic building blocks, but should do the job.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 64 ++++++++++++++-------
> drivers/gpu/drm/i915/display/intel_dp_mst.h | 7 +++
> 2 files changed, 50 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index 5218b1f7679a..8ad42c757ddf 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -209,31 +209,23 @@ static int intel_dp_mst_dsc_get_slice_count(const struct intel_connector *connec
> num_joined_pipes);
> }
>
> -static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
> - struct intel_crtc_state *crtc_state,
> - int max_bpp, int min_bpp,
> - struct link_config_limits *limits,
> - struct drm_connector_state *conn_state,
> - int step, bool dsc)
> +int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
> + struct intel_crtc_state *crtc_state,
> + int max_bpp, int min_bpp,
> + struct drm_connector_state *conn_state,
> + int step, bool dsc)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> struct drm_atomic_state *state = crtc_state->uapi.state;
> - struct drm_dp_mst_topology_state *mst_state;
> struct intel_connector *connector =
> to_intel_connector(conn_state->connector);
> const struct drm_display_mode *adjusted_mode =
> &crtc_state->hw.adjusted_mode;
> + fixed20_12 pbn_div;
> int bpp, slots = -EINVAL;
> int dsc_slice_count = 0;
> int max_dpt_bpp;
>
> - mst_state = drm_atomic_get_mst_topology_state(state, &intel_dp->mst_mgr);
> - if (IS_ERR(mst_state))
> - return PTR_ERR(mst_state);
> -
> - crtc_state->lane_count = limits->max_lane_count;
> - crtc_state->port_clock = limits->max_rate;
> -
> if (dsc) {
> if (!intel_dp_supports_fec(intel_dp, connector, crtc_state))
> return -EINVAL;
> @@ -241,8 +233,8 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
> crtc_state->fec_enable = !intel_dp_is_uhbr(crtc_state);
> }
>
> - mst_state->pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
> - crtc_state->lane_count);
> + pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
> + crtc_state->lane_count);
>
> max_dpt_bpp = intel_dp_mst_max_dpt_bpp(crtc_state, dsc);
> if (max_bpp > max_dpt_bpp) {
> @@ -302,7 +294,7 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
In the SST case the TUs are calculated for the first - only - link, the
overhead for that tracked in local_bw_overhead (since we don't enable SSC). So
crtc_state->dp_m_n at this point contains already what's needed for SST,
except for the 4/lane_count alignment. The things calculated for remote
links - PBN, remote_tu - are not needed for SST, so the TUs for SST
could be aligned separately and all the MST specific bits below extracted
to an MST helper.
> 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(pbn.full, pbn_div.full);
>
> /*
> * Aligning the TUs ensures that symbols consisting of multiple
> @@ -320,15 +312,20 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
> * 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;
> + pbn.full = remote_tu * pbn_div.full;
> crtc_state->pbn = dfixed_trunc(pbn);
AFAICS crtc_state->pbn is not used anywhere else besides this function,
so could be removed from crtc_state while at it.
>
> 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,
> - crtc_state->pbn);
> + if (intel_dp->is_mst)
> + slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
> + connector->port,
> + crtc_state->pbn);
> + else
> + /* FIXME: cross-check against pbn_div? */
> + slots = crtc_state->dp_m_n.tu;
The loop should be bounded like slots <= 64 then for SST (done by DRM
core in the MST helper above).
> +
> if (slots == -EDEADLK)
> return slots;
>
> @@ -356,6 +353,31 @@ static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
> return 0;
> }
>
> +static int mst_stream_find_vcpi_slots_for_bpp(struct intel_dp *intel_dp,
> + struct intel_crtc_state *crtc_state,
> + int max_bpp, int min_bpp,
> + struct link_config_limits *limits,
> + struct drm_connector_state *conn_state,
> + int step, bool dsc)
> +{
> + struct drm_atomic_state *state = crtc_state->uapi.state;
> + struct drm_dp_mst_topology_state *mst_state;
> +
> + mst_state = drm_atomic_get_mst_topology_state(state, &intel_dp->mst_mgr);
> + if (IS_ERR(mst_state))
> + return PTR_ERR(mst_state);
> +
> + crtc_state->lane_count = limits->max_lane_count;
> + crtc_state->port_clock = limits->max_rate;
> +
> + mst_state->pbn_div = drm_dp_get_vc_payload_bw(crtc_state->port_clock,
> + crtc_state->lane_count);
> +
> + return intel_dp_mtp_tu_compute_config(intel_dp, crtc_state,
> + max_bpp, min_bpp,
> + conn_state, step, dsc);
> +}
> +
> static int mst_stream_compute_link_config(struct intel_dp *intel_dp,
> struct intel_crtc_state *crtc_state,
> struct drm_connector_state *conn_state,
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.h b/drivers/gpu/drm/i915/display/intel_dp_mst.h
> index 8343804ce3f8..c6bdc1d190a4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.h
> @@ -8,6 +8,7 @@
>
> #include <linux/types.h>
>
> +struct drm_connector_state;
> struct intel_atomic_state;
> struct intel_crtc;
> struct intel_crtc_state;
> @@ -30,4 +31,10 @@ bool intel_dp_mst_crtc_needs_modeset(struct intel_atomic_state *state,
> void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp);
> bool intel_dp_mst_verify_dpcd_state(struct intel_dp *intel_dp);
>
> +int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
> + struct intel_crtc_state *crtc_state,
> + int max_bpp, int min_bpp,
> + struct drm_connector_state *conn_state,
> + int step, bool dsc);
> +
> #endif /* __INTEL_DP_MST_H__ */
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-12-13 18:44 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 10:39 [RFC v0 00/13] drm/i915/dp: 128b/132b uncompressed SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 01/13] drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() Jani Nikula
2024-12-13 10:39 ` [RFC v0 02/13] drm/i915/mst: use intel_dp_compute_config_limits() for DP MST Jani Nikula
2024-12-13 10:39 ` [RFC v0 03/13] drm/i915/mst: drop connector parameter from intel_dp_mst_bw_overhead() Jani Nikula
2024-12-13 10:39 ` [RFC v0 04/13] drm/i915/mst: drop connector parameter from intel_dp_mst_compute_m_n() Jani Nikula
2024-12-13 10:39 ` [RFC v0 05/13] drm/i915/mst: change return value of mst_stream_find_vcpi_slots_for_bpp() Jani Nikula
2024-12-13 10:39 ` [RFC v0 06/13] drm/i915/mst: add helper independent of MST for figuring out the TU Jani Nikula
2024-12-13 18:44 ` Imre Deak
2024-12-13 10:39 ` [RFC v0 07/13] drm/i915/ddi: enable 128b/132b TRANS_DDI_FUNC_CTL mode for UHBR SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 08/13] drm/i915/ddi: 128b/132b SST also needs DP_TP_CTL_MODE_MST Jani Nikula
2024-12-13 10:39 ` [RFC v0 09/13] drm/i915/ddi: write payload for 128b/132b SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 10/13] drm/i915/ddi: initialize 128b/132b SST DP2 VFREQ registers Jani Nikula
2024-12-13 10:39 ` [RFC v0 11/13] drm/i915/ddi: enable ACT handling for 128b/132b SST Jani Nikula
2024-12-13 10:39 ` [RFC v0 12/13] drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout Jani Nikula
2024-12-13 10:39 ` [RFC v0 13/13] drm/i915/dp: compute config for 128b/132b SST w/o DSC Jani Nikula
2024-12-13 11:53 ` ✗ Fi.CI.SPARSE: warning for drm/i915/dp: 128b/132b uncompressed SST Patchwork
2024-12-13 12:08 ` ✗ i915.CI.BAT: failure " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox