* [PATCH 0/7] Add support for 3 VDSC engines 12 slices
@ 2024-10-27 13:45 Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 1/7] drm/i915/dp: Update Comment for Valid DSC Slices per Line Ankit Nautiyal
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
For BMG 3 VDSC engines are supported and each pipe can then support
3 slices. For Ultra joiner cases for modes like 8k@120 Hz we require
ultrajoiner and 3 x 4= 12 slices.
Add support for 3 VDSC engines and 12 DSC slices.
Rev2: Rebase
Rev3:
-Add patch to account for pixel replication in pipe_src.
-Fix kernel test bot warning.
-Minor refactoring.
Rev4:
-Address review comments from last version.
-Add BW consideration with pixel replication
-Split Odd pixel handling in separate patches.
Rev 5:
-Use num_streams instead of dsc_split.
Rev 6:
-Dropped patches for pixel replication and odd pixel removal.
Ankit Nautiyal (7):
drm/i915/dp: Update Comment for Valid DSC Slices per Line
drm/i915/display: Prepare for dsc 3 stream splitter
drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine
drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2
drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine
drm/i915/dp: Ensure hactive is divisible by slice count
drm/i915/dp: Enable 3 DSC engines for 12 slices
drivers/gpu/drm/i915/display/icl_dsi.c | 4 +-
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
.../drm/i915/display/intel_display_types.h | 2 +-
drivers/gpu/drm/i915/display/intel_dp.c | 36 +++++++++++++++---
drivers/gpu/drm/i915/display/intel_vdsc.c | 38 +++++++++++++------
.../gpu/drm/i915/display/intel_vdsc_regs.h | 12 +++++-
6 files changed, 73 insertions(+), 21 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/7] drm/i915/dp: Update Comment for Valid DSC Slices per Line
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter Ankit Nautiyal
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
For some platforms, the maximum slices per DSC engine is 4, while for
others it is 2. Update the comment to reflect this and clarify that
the 'valid_dsc_slicecount' list represents the valid number of slices
per pipe.
Currently, we are working with 1, and 2 slices per DSC engine,
which works for all platforms. With this the number of slices per pipe
can be 1,2 or 4 with different slice & DSC engine configuration.
Add a #TODO for adding support for 4 slices per DSC engine where
supported.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 7e29619ba040..bd9f37e1a13f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -109,8 +109,14 @@
/* Constants for DP DSC configurations */
static const u8 valid_dsc_bpp[] = {6, 8, 10, 12, 15};
-/* With Single pipe configuration, HW is capable of supporting maximum
- * of 4 slices per line.
+/*
+ * With Single pipe configuration, HW is capable of supporting maximum of:
+ * 2 slices per line for ICL, BMG
+ * 4 slices per line for other platforms.
+ * For now consider a max of 2 slices per line, which works for all platforms.
+ * With this we can have max of 4 DSC Slices per pipe.
+ *
+ * #TODO Split this better to use 4 slices/dsc engine where supported.
*/
static const u8 valid_dsc_slicecount[] = {1, 2, 4};
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 1/7] drm/i915/dp: Update Comment for Valid DSC Slices per Line Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-28 4:26 ` Nautiyal, Ankit K
2024-10-27 13:45 ` [PATCH 3/7] drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine Ankit Nautiyal
` (5 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
At the moment dsc_split represents whether the dsc splitter is used
or not. With 3 DSC engines, the splitter can split into two streams
or three streams.
Instead of representing the splitter's state, it is more effective to
represent the number of DSC streams per pipe.
Replace the `dsc.dsc_split` member with `dsc.num_streams` to indicate the
number of DSC streams used per pipe. This change will implicitly
convey the splitter's operation mode.
v2: Avoid new enum for dsc split. (Suraj)
v3:
-Replace dsc_split with num_stream. (Suraj)
-Avoid extra parentheses. (Jani)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/icl_dsi.c | 4 +++-
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
.../gpu/drm/i915/display/intel_display_types.h | 2 +-
drivers/gpu/drm/i915/display/intel_dp.c | 4 +++-
drivers/gpu/drm/i915/display/intel_vdsc.c | 16 +++++++++++-----
5 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
index 115d79c80b9a..b01dfbeb314b 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -1596,7 +1596,9 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
/* FIXME: split only when necessary */
if (crtc_state->dsc.slice_count > 1)
- crtc_state->dsc.dsc_split = true;
+ crtc_state->dsc.num_streams = 2;
+ else
+ crtc_state->dsc.num_streams = 1;
/* FIXME: initialize from VBT */
vdsc_cfg->rc_model_size = DSC_RC_MODEL_SIZE_CONST;
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index ef1436146325..3dfff0a8c386 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5741,7 +5741,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
PIPE_CONF_CHECK_I(dsc.config.nsl_bpg_offset);
PIPE_CONF_CHECK_BOOL(dsc.compression_enable);
- PIPE_CONF_CHECK_BOOL(dsc.dsc_split);
+ PIPE_CONF_CHECK_I(dsc.num_streams);
PIPE_CONF_CHECK_I(dsc.compressed_bpp_x16);
PIPE_CONF_CHECK_BOOL(splitter.enable);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 2bb1fa64da2f..5611a4dd6a6f 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1235,7 +1235,7 @@ struct intel_crtc_state {
/* Display Stream compression state */
struct {
bool compression_enable;
- bool dsc_split;
+ int num_streams;
/* Compressed Bpp in U6.4 format (first 4 bits for fractional part) */
u16 compressed_bpp_x16;
u8 slice_count;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index bd9f37e1a13f..dbb1d75c0576 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2410,7 +2410,9 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
* then we need to use 2 VDSC instances.
*/
if (pipe_config->joiner_pipes || pipe_config->dsc.slice_count > 1)
- pipe_config->dsc.dsc_split = true;
+ pipe_config->dsc.num_streams = 2;
+ else
+ pipe_config->dsc.num_streams = 1;
ret = intel_dp_dsc_compute_params(connector, pipe_config);
if (ret < 0) {
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
index 40525f5c4c42..afc40d180dec 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc.c
+++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
@@ -379,7 +379,7 @@ intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
static int intel_dsc_get_vdsc_per_pipe(const struct intel_crtc_state *crtc_state)
{
- return crtc_state->dsc.dsc_split ? 2 : 1;
+ return crtc_state->dsc.num_streams;
}
int intel_dsc_get_num_vdsc_instances(const struct intel_crtc_state *crtc_state)
@@ -976,8 +976,14 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state)
if (!crtc_state->dsc.compression_enable)
goto out;
- crtc_state->dsc.dsc_split = (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE) &&
- (dss_ctl1 & JOINER_ENABLE);
+ if (dss_ctl1 & JOINER_ENABLE) {
+ if (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE)
+ crtc_state->dsc.num_streams = 2;
+ else
+ crtc_state->dsc.num_streams = 1;
+ } else {
+ crtc_state->dsc.num_streams = 0;
+ }
intel_dsc_get_pps_config(crtc_state);
out:
@@ -988,10 +994,10 @@ static void intel_vdsc_dump_state(struct drm_printer *p, int indent,
const struct intel_crtc_state *crtc_state)
{
drm_printf_indent(p, indent,
- "dsc-dss: compressed-bpp:" FXP_Q4_FMT ", slice-count: %d, split: %s\n",
+ "dsc-dss: compressed-bpp:" FXP_Q4_FMT ", slice-count: %d, num_streams: %d\n",
FXP_Q4_ARGS(crtc_state->dsc.compressed_bpp_x16),
crtc_state->dsc.slice_count,
- str_yes_no(crtc_state->dsc.dsc_split));
+ crtc_state->dsc.num_streams);
}
void intel_vdsc_state_dump(struct drm_printer *p, int indent,
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/7] drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 1/7] drm/i915/dp: Update Comment for Valid DSC Slices per Line Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 4/7] drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2 Ankit Nautiyal
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
Drop use of LEFT/RIGHT VDSC engine and use VDSC0/VDSC1 instead.
While at it, use REG_BIT macro for the bits.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_vdsc.c | 8 ++++----
drivers/gpu/drm/i915/display/intel_vdsc_regs.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
index afc40d180dec..159f83edd5b0 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc.c
+++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
@@ -770,9 +770,9 @@ void intel_dsc_enable(const struct intel_crtc_state *crtc_state)
intel_dsc_pps_configure(crtc_state);
- dss_ctl2_val |= LEFT_BRANCH_VDSC_ENABLE;
+ dss_ctl2_val |= VDSC0_ENABLE;
if (vdsc_instances_per_pipe > 1) {
- dss_ctl2_val |= RIGHT_BRANCH_VDSC_ENABLE;
+ dss_ctl2_val |= VDSC1_ENABLE;
dss_ctl1_val |= JOINER_ENABLE;
}
if (crtc_state->joiner_pipes) {
@@ -972,12 +972,12 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state)
dss_ctl1 = intel_de_read(dev_priv, dss_ctl1_reg(crtc, cpu_transcoder));
dss_ctl2 = intel_de_read(dev_priv, dss_ctl2_reg(crtc, cpu_transcoder));
- crtc_state->dsc.compression_enable = dss_ctl2 & LEFT_BRANCH_VDSC_ENABLE;
+ crtc_state->dsc.compression_enable = dss_ctl2 & VDSC0_ENABLE;
if (!crtc_state->dsc.compression_enable)
goto out;
if (dss_ctl1 & JOINER_ENABLE) {
- if (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE)
+ if (dss_ctl2 & VDSC1_ENABLE)
crtc_state->dsc.num_streams = 2;
else
crtc_state->dsc.num_streams = 1;
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
index bf32a3b46fb1..d7a72b95ee7e 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
@@ -21,8 +21,8 @@
#define MAX_DL_BUFFER_TARGET_DEPTH 0x5a0
#define DSS_CTL2 _MMIO(0x67404)
-#define LEFT_BRANCH_VDSC_ENABLE (1 << 31)
-#define RIGHT_BRANCH_VDSC_ENABLE (1 << 15)
+#define VDSC0_ENABLE REG_BIT(31)
+#define VDSC1_ENABLE REG_BIT(15)
#define RIGHT_DL_BUF_TARGET_DEPTH_MASK (0xfff << 0)
#define RIGHT_DL_BUF_TARGET_DEPTH(pixels) ((pixels) << 0)
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/7] drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
` (2 preceding siblings ...)
2024-10-27 13:45 ` [PATCH 3/7] drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 5/7] drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine Ankit Nautiyal
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
Introduce the register bits to enable the 3rd DSC engine VDSC2.
Add support to read/write these bits.
v2: Only introduce bits that are used and update the subject and commit
message. (Suraj)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_vdsc.c | 10 +++++++++-
drivers/gpu/drm/i915/display/intel_vdsc_regs.h | 2 ++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
index 159f83edd5b0..29b1aa7f4f94 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc.c
+++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
@@ -775,6 +775,12 @@ void intel_dsc_enable(const struct intel_crtc_state *crtc_state)
dss_ctl2_val |= VDSC1_ENABLE;
dss_ctl1_val |= JOINER_ENABLE;
}
+
+ if (vdsc_instances_per_pipe > 2) {
+ dss_ctl2_val |= VDSC2_ENABLE;
+ dss_ctl2_val |= SMALL_JOINER_CONFIG_3_ENGINES;
+ }
+
if (crtc_state->joiner_pipes) {
if (intel_crtc_ultrajoiner_enable_needed(crtc_state))
dss_ctl1_val |= ULTRA_JOINER_ENABLE;
@@ -977,7 +983,9 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state)
goto out;
if (dss_ctl1 & JOINER_ENABLE) {
- if (dss_ctl2 & VDSC1_ENABLE)
+ if (dss_ctl2 & (VDSC2_ENABLE | SMALL_JOINER_CONFIG_3_ENGINES))
+ crtc_state->dsc.num_streams = 3;
+ else if (dss_ctl2 & VDSC1_ENABLE)
crtc_state->dsc.num_streams = 2;
else
crtc_state->dsc.num_streams = 1;
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
index d7a72b95ee7e..474a7f9f3881 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
@@ -22,6 +22,8 @@
#define DSS_CTL2 _MMIO(0x67404)
#define VDSC0_ENABLE REG_BIT(31)
+#define VDSC2_ENABLE REG_BIT(30)
+#define SMALL_JOINER_CONFIG_3_ENGINES REG_BIT(23)
#define VDSC1_ENABLE REG_BIT(15)
#define RIGHT_DL_BUF_TARGET_DEPTH_MASK (0xfff << 0)
#define RIGHT_DL_BUF_TARGET_DEPTH(pixels) ((pixels) << 0)
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/7] drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
` (3 preceding siblings ...)
2024-10-27 13:45 ` [PATCH 4/7] drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2 Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 6/7] drm/i915/dp: Ensure hactive is divisible by slice count Ankit Nautiyal
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
With BMG each pipe has 3 DSC engines, so add bits to read/write the PPS
registers for the 3rd DSC engine
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_vdsc.c | 8 +++++---
drivers/gpu/drm/i915/display/intel_vdsc_regs.h | 6 ++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
index 29b1aa7f4f94..4143109aaab6 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc.c
+++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
@@ -402,8 +402,10 @@ static void intel_dsc_get_pps_reg(const struct intel_crtc_state *crtc_state, int
pipe_dsc = is_pipe_dsc(crtc, cpu_transcoder);
- if (dsc_reg_num >= 3)
+ if (dsc_reg_num >= 4)
MISSING_CASE(dsc_reg_num);
+ if (dsc_reg_num >= 3)
+ dsc_reg[2] = BMG_DSC2_PPS(pipe, pps);
if (dsc_reg_num >= 2)
dsc_reg[1] = pipe_dsc ? ICL_DSC1_PPS(pipe, pps) : DSCC_PPS(pps);
if (dsc_reg_num >= 1)
@@ -415,7 +417,7 @@ static void intel_dsc_pps_write(const struct intel_crtc_state *crtc_state,
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
- i915_reg_t dsc_reg[2];
+ i915_reg_t dsc_reg[3];
int i, vdsc_per_pipe, dsc_reg_num;
vdsc_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
@@ -815,7 +817,7 @@ static u32 intel_dsc_pps_read(struct intel_crtc_state *crtc_state, int pps,
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
- i915_reg_t dsc_reg[2];
+ i915_reg_t dsc_reg[3];
int i, vdsc_per_pipe, dsc_reg_num;
u32 val;
diff --git a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
index 474a7f9f3881..2d478a84b07c 100644
--- a/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_vdsc_regs.h
@@ -59,8 +59,10 @@
#define DSCC_PPS(pps) _MMIO(_DSCC_PPS_0 + ((pps) < 12 ? (pps) : (pps) + 12) * 4)
#define _ICL_DSC0_PICTURE_PARAMETER_SET_0_PB 0x78270
#define _ICL_DSC1_PICTURE_PARAMETER_SET_0_PB 0x78370
+#define _BMG_DSC2_PICTURE_PARAMETER_SET_0_PB 0x78970
#define _ICL_DSC0_PICTURE_PARAMETER_SET_0_PC 0x78470
#define _ICL_DSC1_PICTURE_PARAMETER_SET_0_PC 0x78570
+#define _BMG_DSC2_PICTURE_PARAMETER_SET_0_PC 0x78A70
#define ICL_DSC0_PICTURE_PARAMETER_SET_0(pipe) _MMIO_PIPE((pipe) - PIPE_B, \
_ICL_DSC0_PICTURE_PARAMETER_SET_0_PB, \
_ICL_DSC0_PICTURE_PARAMETER_SET_0_PC)
@@ -73,8 +75,12 @@
#define _ICL_DSC1_PPS_0(pipe) _PICK_EVEN((pipe) - PIPE_B, \
_ICL_DSC1_PICTURE_PARAMETER_SET_0_PB, \
_ICL_DSC1_PICTURE_PARAMETER_SET_0_PC)
+#define _BMG_DSC2_PPS_0(pipe) _PICK_EVEN((pipe) - PIPE_B, \
+ _BMG_DSC2_PICTURE_PARAMETER_SET_0_PB, \
+ _BMG_DSC2_PICTURE_PARAMETER_SET_0_PC)
#define ICL_DSC0_PPS(pipe, pps) _MMIO(_ICL_DSC0_PPS_0(pipe) + ((pps) * 4))
#define ICL_DSC1_PPS(pipe, pps) _MMIO(_ICL_DSC1_PPS_0(pipe) + ((pps) * 4))
+#define BMG_DSC2_PPS(pipe, pps) _MMIO(_BMG_DSC2_PPS_0(pipe) + ((pps) * 4))
/* PPS 0 */
#define DSC_PPS0_NATIVE_422_ENABLE REG_BIT(23)
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/7] drm/i915/dp: Ensure hactive is divisible by slice count
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
` (4 preceding siblings ...)
2024-10-27 13:45 ` [PATCH 5/7] drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 7/7] drm/i915/dp: Enable 3 DSC engines for 12 slices Ankit Nautiyal
2024-11-06 13:00 ` [PATCH 0/7] Add support for 3 VDSC engines " Nautiyal, Ankit K
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
According to the DSC spec, the slice width should be chosen such that
the picture width (hactive) is evenly divisible by the slice width.
If not, extra pixels (padding) must be added to the last slice to
ensure all slices have the same width.
Currently, we do not support handling these extra pixels.
Therefore, select a slice count that evenly divides the hactive
(slice_width = hactive / slice_count).
This check is already implemented for DSI, where the slice count is
selected from the BIOS.
For DP, currently with 1, 2, 4 slices per pipe it is unlikely to have
slice count not being able to divide hactive, but with 3 DSC engines
and 3 slices, we can have such cases. Adding this check prepares for
future scenarios where such configurations might be used.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index dbb1d75c0576..d7d42eac4be3 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1038,6 +1038,9 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
if (num_joined_pipes > 1 && valid_dsc_slicecount[i] < 2)
continue;
+ if (mode_hdisplay % test_slice_count)
+ continue;
+
if (min_slice_count <= test_slice_count)
return test_slice_count;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/7] drm/i915/dp: Enable 3 DSC engines for 12 slices
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
` (5 preceding siblings ...)
2024-10-27 13:45 ` [PATCH 6/7] drm/i915/dp: Ensure hactive is divisible by slice count Ankit Nautiyal
@ 2024-10-27 13:45 ` Ankit Nautiyal
2024-11-06 13:00 ` [PATCH 0/7] Add support for 3 VDSC engines " Nautiyal, Ankit K
7 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-27 13:45 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
Certain resolutions require 12 DSC slices support along with ultrajoiner.
For such cases, the third DSC Engine per Pipe is enabled. Each DSC
Engine processes 1 Slice, resulting in a total of 12 VDSC slices
(4 Pipes * 3 DSC Instances per Pipe).
Add support for 12 DSC slices and 3 DSC engines for such modes.
v2: Add missing check for 3 slices support only with 4 joined pipes.
(Suraj)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index d7d42eac4be3..a38ae79d3812 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -116,9 +116,12 @@ static const u8 valid_dsc_bpp[] = {6, 8, 10, 12, 15};
* For now consider a max of 2 slices per line, which works for all platforms.
* With this we can have max of 4 DSC Slices per pipe.
*
+ * For higher resolutions where 12 slice support is required with
+ * ultrajoiner, only then each pipe can support 3 slices.
+ *
* #TODO Split this better to use 4 slices/dsc engine where supported.
*/
-static const u8 valid_dsc_slicecount[] = {1, 2, 4};
+static const u8 valid_dsc_slicecount[] = {1, 2, 3, 4};
/**
* intel_dp_is_edp - is the given port attached to an eDP panel (either CPU or PCH)
@@ -1026,6 +1029,13 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
for (i = 0; i < ARRAY_SIZE(valid_dsc_slicecount); i++) {
u8 test_slice_count = valid_dsc_slicecount[i] * num_joined_pipes;
+ /*
+ * 3 DSC Slices per pipe need 3 DSC engines,
+ * which is supported only with Ultrajoiner.
+ */
+ if (valid_dsc_slicecount[i] == 3 && num_joined_pipes != 4)
+ continue;
+
if (test_slice_count >
drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd, false))
break;
@@ -2411,8 +2421,13 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
* VDSC engine operates at 1 Pixel per clock, so if peak pixel rate
* is greater than the maximum Cdclock and if slice count is even
* then we need to use 2 VDSC instances.
+ * In case of Ultrajoiner along with 12 slices we need to use 3
+ * VDSC instances.
*/
- if (pipe_config->joiner_pipes || pipe_config->dsc.slice_count > 1)
+ if (pipe_config->joiner_pipes && num_joined_pipes == 4 &&
+ pipe_config->dsc.slice_count == 12)
+ pipe_config->dsc.num_streams = 3;
+ else if (pipe_config->joiner_pipes || pipe_config->dsc.slice_count > 1)
pipe_config->dsc.num_streams = 2;
else
pipe_config->dsc.num_streams = 1;
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter
2024-10-27 13:45 ` [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter Ankit Nautiyal
@ 2024-10-28 4:26 ` Nautiyal, Ankit K
0 siblings, 0 replies; 11+ messages in thread
From: Nautiyal, Ankit K @ 2024-10-28 4:26 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
On 10/27/2024 7:15 PM, Ankit Nautiyal wrote:
> At the moment dsc_split represents whether the dsc splitter is used
> or not. With 3 DSC engines, the splitter can split into two streams
> or three streams.
>
> Instead of representing the splitter's state, it is more effective to
> represent the number of DSC streams per pipe.
>
> Replace the `dsc.dsc_split` member with `dsc.num_streams` to indicate the
> number of DSC streams used per pipe. This change will implicitly
> convey the splitter's operation mode.
>
> v2: Avoid new enum for dsc split. (Suraj)
> v3:
> -Replace dsc_split with num_stream. (Suraj)
> -Avoid extra parentheses. (Jani)
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/icl_dsi.c | 4 +++-
> drivers/gpu/drm/i915/display/intel_display.c | 2 +-
> .../gpu/drm/i915/display/intel_display_types.h | 2 +-
> drivers/gpu/drm/i915/display/intel_dp.c | 4 +++-
> drivers/gpu/drm/i915/display/intel_vdsc.c | 16 +++++++++++-----
> 5 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
> index 115d79c80b9a..b01dfbeb314b 100644
> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
> @@ -1596,7 +1596,9 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
>
> /* FIXME: split only when necessary */
> if (crtc_state->dsc.slice_count > 1)
> - crtc_state->dsc.dsc_split = true;
> + crtc_state->dsc.num_streams = 2;
> + else
> + crtc_state->dsc.num_streams = 1;
>
> /* FIXME: initialize from VBT */
> vdsc_cfg->rc_model_size = DSC_RC_MODEL_SIZE_CONST;
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index ef1436146325..3dfff0a8c386 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -5741,7 +5741,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
> PIPE_CONF_CHECK_I(dsc.config.nsl_bpg_offset);
>
> PIPE_CONF_CHECK_BOOL(dsc.compression_enable);
> - PIPE_CONF_CHECK_BOOL(dsc.dsc_split);
> + PIPE_CONF_CHECK_I(dsc.num_streams);
> PIPE_CONF_CHECK_I(dsc.compressed_bpp_x16);
>
> PIPE_CONF_CHECK_BOOL(splitter.enable);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 2bb1fa64da2f..5611a4dd6a6f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1235,7 +1235,7 @@ struct intel_crtc_state {
> /* Display Stream compression state */
> struct {
> bool compression_enable;
> - bool dsc_split;
> + int num_streams;
> /* Compressed Bpp in U6.4 format (first 4 bits for fractional part) */
> u16 compressed_bpp_x16;
> u8 slice_count;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index bd9f37e1a13f..dbb1d75c0576 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2410,7 +2410,9 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
> * then we need to use 2 VDSC instances.
> */
> if (pipe_config->joiner_pipes || pipe_config->dsc.slice_count > 1)
> - pipe_config->dsc.dsc_split = true;
> + pipe_config->dsc.num_streams = 2;
> + else
> + pipe_config->dsc.num_streams = 1;
>
> ret = intel_dp_dsc_compute_params(connector, pipe_config);
> if (ret < 0) {
> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
> index 40525f5c4c42..afc40d180dec 100644
> --- a/drivers/gpu/drm/i915/display/intel_vdsc.c
> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
> @@ -379,7 +379,7 @@ intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
>
> static int intel_dsc_get_vdsc_per_pipe(const struct intel_crtc_state *crtc_state)
> {
> - return crtc_state->dsc.dsc_split ? 2 : 1;
> + return crtc_state->dsc.num_streams;
> }
>
> int intel_dsc_get_num_vdsc_instances(const struct intel_crtc_state *crtc_state)
> @@ -976,8 +976,14 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state)
> if (!crtc_state->dsc.compression_enable)
> goto out;
>
> - crtc_state->dsc.dsc_split = (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE) &&
> - (dss_ctl1 & JOINER_ENABLE);
> + if (dss_ctl1 & JOINER_ENABLE) {
> + if (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE)
> + crtc_state->dsc.num_streams = 2;
> + else
> + crtc_state->dsc.num_streams = 1;
> + } else {
> + crtc_state->dsc.num_streams = 0;
I realized that this is a mistake, num_streams cannot be 0 when
dsc.compression_enable is set.
Will correct this to num_streams = 1, and simplify the if-else block.
Regards,
Ankit
> + }
>
> intel_dsc_get_pps_config(crtc_state);
> out:
> @@ -988,10 +994,10 @@ static void intel_vdsc_dump_state(struct drm_printer *p, int indent,
> const struct intel_crtc_state *crtc_state)
> {
> drm_printf_indent(p, indent,
> - "dsc-dss: compressed-bpp:" FXP_Q4_FMT ", slice-count: %d, split: %s\n",
> + "dsc-dss: compressed-bpp:" FXP_Q4_FMT ", slice-count: %d, num_streams: %d\n",
> FXP_Q4_ARGS(crtc_state->dsc.compressed_bpp_x16),
> crtc_state->dsc.slice_count,
> - str_yes_no(crtc_state->dsc.dsc_split));
> + crtc_state->dsc.num_streams);
> }
>
> void intel_vdsc_state_dump(struct drm_printer *p, int indent,
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/7] Add support for 3 VDSC engines 12 slices
@ 2024-10-30 4:10 Ankit Nautiyal
0 siblings, 0 replies; 11+ messages in thread
From: Ankit Nautiyal @ 2024-10-30 4:10 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
For BMG 3 VDSC engines are supported and each pipe can then support
3 slices. For Ultra joiner cases for modes like 8k@120 Hz we require
ultrajoiner and 3 x 4= 12 slices.
Add support for 3 VDSC engines and 12 DSC slices.
Rev2: Rebase
Rev3:
-Add patch to account for pixel replication in pipe_src.
-Fix kernel test bot warning.
-Minor refactoring.
Rev4:
-Address review comments from last version.
-Add BW consideration with pixel replication
-Split Odd pixel handling in separate patches.
Rev 5:
-Use num_streams instead of dsc_split.
Rev 6:
-Drop patches for pixel replication and odd pixel removal.
Rev 7:
-Fix Hw readout for DSC in Patch#2, and rebase.
Ankit Nautiyal (7):
drm/i915/dp: Update Comment for Valid DSC Slices per Line
drm/i915/display: Prepare for dsc 3 stream splitter
drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine
drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2
drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine
drm/i915/dp: Ensure hactive is divisible by slice count
drm/i915/dp: Enable 3 DSC engines for 12 slices
drivers/gpu/drm/i915/display/icl_dsi.c | 4 ++-
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
.../drm/i915/display/intel_display_types.h | 2 +-
drivers/gpu/drm/i915/display/intel_dp.c | 36 ++++++++++++++++---
drivers/gpu/drm/i915/display/intel_vdsc.c | 34 ++++++++++++------
.../gpu/drm/i915/display/intel_vdsc_regs.h | 12 +++++--
6 files changed, 69 insertions(+), 21 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/7] Add support for 3 VDSC engines 12 slices
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
` (6 preceding siblings ...)
2024-10-27 13:45 ` [PATCH 7/7] drm/i915/dp: Enable 3 DSC engines for 12 slices Ankit Nautiyal
@ 2024-11-06 13:00 ` Nautiyal, Ankit K
7 siblings, 0 replies; 11+ messages in thread
From: Nautiyal, Ankit K @ 2024-11-06 13:00 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, suraj.kandpal
On 10/27/2024 7:15 PM, Ankit Nautiyal wrote:
> For BMG 3 VDSC engines are supported and each pipe can then support
> 3 slices. For Ultra joiner cases for modes like 8k@120 Hz we require
> ultrajoiner and 3 x 4= 12 slices.
> Add support for 3 VDSC engines and 12 DSC slices.
>
> Rev2: Rebase
> Rev3:
> -Add patch to account for pixel replication in pipe_src.
> -Fix kernel test bot warning.
> -Minor refactoring.
> Rev4:
> -Address review comments from last version.
> -Add BW consideration with pixel replication
> -Split Odd pixel handling in separate patches.
> Rev 5:
> -Use num_streams instead of dsc_split.
> Rev 6:
> -Dropped patches for pixel replication and odd pixel removal.
>
> Ankit Nautiyal (7):
> drm/i915/dp: Update Comment for Valid DSC Slices per Line
> drm/i915/display: Prepare for dsc 3 stream splitter
> drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine
> drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2
> drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine
> drm/i915/dp: Ensure hactive is divisible by slice count
> drm/i915/dp: Enable 3 DSC engines for 12 slices
Pushed to drm-intel-next. Thanks for the reviews and comments.
Regards,
Ankit
>
> drivers/gpu/drm/i915/display/icl_dsi.c | 4 +-
> drivers/gpu/drm/i915/display/intel_display.c | 2 +-
> .../drm/i915/display/intel_display_types.h | 2 +-
> drivers/gpu/drm/i915/display/intel_dp.c | 36 +++++++++++++++---
> drivers/gpu/drm/i915/display/intel_vdsc.c | 38 +++++++++++++------
> .../gpu/drm/i915/display/intel_vdsc_regs.h | 12 +++++-
> 6 files changed, 73 insertions(+), 21 deletions(-)
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-11-06 13:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-27 13:45 [PATCH 0/7] Add support for 3 VDSC engines 12 slices Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 1/7] drm/i915/dp: Update Comment for Valid DSC Slices per Line Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 2/7] drm/i915/display: Prepare for dsc 3 stream splitter Ankit Nautiyal
2024-10-28 4:26 ` Nautiyal, Ankit K
2024-10-27 13:45 ` [PATCH 3/7] drm/i915/vdsc: Use VDSC0/VDSC1 for LEFT/RIGHT VDSC engine Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 4/7] drm/i915/vdsc: Introduce 3rd VDSC engine VDSC2 Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 5/7] drm/i915/vdsc: Add support for read/write PPS for 3rd DSC engine Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 6/7] drm/i915/dp: Ensure hactive is divisible by slice count Ankit Nautiyal
2024-10-27 13:45 ` [PATCH 7/7] drm/i915/dp: Enable 3 DSC engines for 12 slices Ankit Nautiyal
2024-11-06 13:00 ` [PATCH 0/7] Add support for 3 VDSC engines " Nautiyal, Ankit K
-- strict thread matches above, loose matches on Subject: below --
2024-10-30 4:10 Ankit Nautiyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox