From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH v4 5/6] drm/i915/dp: Verify branch devices' overall pixel throughput/line width
Date: Sat, 27 Sep 2025 00:12:35 +0300 [thread overview]
Message-ID: <20250926211236.474043-6-imre.deak@intel.com> (raw)
In-Reply-To: <20250926211236.474043-1-imre.deak@intel.com>
Read out the branch devices' maximum overall DSC pixel throughput and
line width and verify the mode's corresponding pixel clock and hactive
period against these.
v2: Use drm helpers to query the throughput/line-width caps. (Ville)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
.../drm/i915/display/intel_display_types.h | 8 +++
drivers/gpu/drm/i915/display/intel_dp.c | 51 +++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 029c47743f8b1..99d2c31236928 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -552,6 +552,14 @@ struct intel_connector {
u8 dsc_hblank_expansion_quirk:1;
u8 dsc_decompression_enabled:1;
+
+ struct {
+ struct {
+ int rgb_yuv444;
+ int yuv422_420;
+ } overall_throughput;
+ int max_line_width;
+ } dsc_branch_caps;
} dp;
struct {
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 2dcc20bcfa0ba..9de9356302f97 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1016,6 +1016,20 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
int tp_rgb_yuv444;
int tp_yuv422_420;
+ /*
+ * TODO: Use the throughput value specific to the actual RGB/YUV
+ * format of the output.
+ * The RGB/YUV444 throughput value should be always either equal
+ * or smaller than the YUV422/420 value, but let's not depend on
+ * this assumption.
+ */
+ if (mode_clock > max(connector->dp.dsc_branch_caps.overall_throughput.rgb_yuv444,
+ connector->dp.dsc_branch_caps.overall_throughput.yuv422_420))
+ return 0;
+
+ if (mode_hdisplay > connector->dp.dsc_branch_caps.max_line_width)
+ return 0;
+
/*
* TODO: Pass the total pixel rate of all the streams transferred to
* an MST tiled display, calculate the total slice count for all tiles
@@ -4180,6 +4194,33 @@ static void intel_dp_read_dsc_dpcd(struct drm_dp_aux *aux,
dsc_dpcd);
}
+static void init_dsc_overall_throughput_limits(struct intel_connector *connector, bool is_branch)
+{
+ u8 branch_caps[DP_DSC_BRANCH_CAP_SIZE];
+ int line_width;
+
+ connector->dp.dsc_branch_caps.overall_throughput.rgb_yuv444 = INT_MAX;
+ connector->dp.dsc_branch_caps.overall_throughput.yuv422_420 = INT_MAX;
+ connector->dp.dsc_branch_caps.max_line_width = INT_MAX;
+
+ if (!is_branch)
+ return;
+
+ if (drm_dp_dpcd_read_data(connector->dp.dsc_decompression_aux,
+ DP_DSC_BRANCH_OVERALL_THROUGHPUT_0, branch_caps,
+ sizeof(branch_caps)) != 0)
+ return;
+
+ connector->dp.dsc_branch_caps.overall_throughput.rgb_yuv444 =
+ drm_dp_dsc_branch_max_overall_throughput(branch_caps, true) ? : INT_MAX;
+
+ connector->dp.dsc_branch_caps.overall_throughput.yuv422_420 =
+ drm_dp_dsc_branch_max_overall_throughput(branch_caps, false) ? : INT_MAX;
+
+ line_width = drm_dp_dsc_branch_max_line_width(branch_caps);
+ connector->dp.dsc_branch_caps.max_line_width = line_width > 0 ? line_width : INT_MAX;
+}
+
void intel_dp_get_dsc_sink_cap(u8 dpcd_rev,
const struct drm_dp_desc *desc, bool is_branch,
struct intel_connector *connector)
@@ -4195,6 +4236,8 @@ void intel_dp_get_dsc_sink_cap(u8 dpcd_rev,
/* Clear fec_capable to avoid using stale values */
connector->dp.fec_capability = 0;
+ memset(&connector->dp.dsc_branch_caps, 0, sizeof(connector->dp.dsc_branch_caps));
+
if (dpcd_rev < DP_DPCD_REV_14)
return;
@@ -4209,6 +4252,11 @@ void intel_dp_get_dsc_sink_cap(u8 dpcd_rev,
drm_dbg_kms(display->drm, "FEC CAPABILITY: %x\n",
connector->dp.fec_capability);
+
+ if (!(connector->dp.dsc_dpcd[0] & DP_DSC_DECOMPRESSION_IS_SUPPORTED))
+ return;
+
+ init_dsc_overall_throughput_limits(connector, is_branch);
}
static void intel_edp_get_dsc_sink_cap(u8 edp_dpcd_rev, struct intel_connector *connector)
@@ -4217,6 +4265,9 @@ static void intel_edp_get_dsc_sink_cap(u8 edp_dpcd_rev, struct intel_connector *
return;
intel_dp_read_dsc_dpcd(connector->dp.dsc_decompression_aux, connector->dp.dsc_dpcd);
+
+ if (connector->dp.dsc_dpcd[0] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
+ init_dsc_overall_throughput_limits(connector, false);
}
static void
--
2.49.1
next prev parent reply other threads:[~2025-09-26 21:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 21:12 [PATCH v4 0/6] drm/i915/dp: Work around a DSC pixel throughput issue Imre Deak
2025-09-26 21:12 ` [PATCH v4 1/6] drm/dp: Add quirk for Synaptics DSC throughput link-bpp limit Imre Deak
2025-09-26 21:12 ` [PATCH v4 2/6] drm/dp: Add helpers to query the branch DSC max throughput/line-width Imre Deak
2025-09-29 6:36 ` [PATCH v5 " Imre Deak
2025-09-29 9:00 ` Dmitry Baryshkov
2025-09-29 10:10 ` Imre Deak
2025-09-30 5:30 ` Dmitry Baryshkov
2025-09-30 11:38 ` Imre Deak
2025-09-30 20:04 ` Dmitry Baryshkov
2025-09-30 21:03 ` Imre Deak
2025-09-29 10:12 ` Ville Syrjälä
2025-09-29 10:47 ` Imre Deak
2025-09-26 21:12 ` [PATCH v4 3/6] drm/i915/dp: Calculate DSC slice count based on per-slice peak throughput Imre Deak
2025-09-26 21:12 ` [PATCH v4 4/6] drm/i915/dp: Pass DPCD device descriptor to intel_dp_get_dsc_sink_cap() Imre Deak
2025-09-26 21:12 ` Imre Deak [this message]
2025-09-26 21:12 ` [PATCH v4 6/6] drm/i915/dp: Handle Synaptics DSC throughput link-bpp quirk Imre Deak
2025-09-26 21:56 ` ✗ CI.checkpatch: warning for drm/i915/dp: Work around a DSC pixel throughput issue (rev5) Patchwork
2025-09-26 21:57 ` ✓ CI.KUnit: success " Patchwork
2025-09-26 22:33 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-27 5:36 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-29 7:12 ` ✗ CI.checkpatch: warning for drm/i915/dp: Work around a DSC pixel throughput issue (rev6) Patchwork
2025-09-29 7:13 ` ✓ CI.KUnit: success " Patchwork
2025-09-29 9:22 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-29 9:40 ` ✓ Xe.CI.Full: " Patchwork
2025-09-29 21:47 ` [PATCH v4 0/6] drm/i915/dp: Work around a DSC pixel throughput issue Sharma, Swati2
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=20250926211236.474043-6-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox