Enable YCbCr420 for VDSC
Subsystems (3)
v6 cover Enable YCbCr420 for VDSC
This patch series aims to enable the YCbCr420 format for DSC. Changes are mostly compute params related for hdmi,dp and dsi along with the addition of new rc_tables for native_420 and corresponding changes to macros used to fetch them.
---v2
-add fields missed for vdsc_cfg [Vandita]
-add corresponding registers and writing to the [Vandita]
---v3
-add 11 bit left shift missed in nsl_bpg_offset calculation
---v4
-add display version check before writing in new pps register
---v5
-add helper to check if sink supports given format with DSC -add debugfs entry to enforce DSC with YCbCr420 format only
--v6
-add patch to check dsc slice design requirement [Vandita]
Ankit Nautiyal (2):
drm/dp_helper: Add helper to check if the sink supports given format
with DSC
drm/i915/dp: Check if DSC supports the given output_format
Suraj Kandpal (4):
drm/i915: Adding the new registers for DSC drm/i915: Enable YCbCr420 for VDSC
drm/i915: Fill in native_420 field drm/i915/vdsc: Check slice design requirement
Swati Sharma (3):
drm/i915/dsc: Add debugfs entry to validate DSC YCbCr420 drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from
debugfs
drm/i915: Code styling fixes
drivers/gpu/drm/i915/display/icl_dsi.c | 2 - .../drm/i915/display/intel_display_debugfs.c | 91 ++++++++- .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 37 +++- .../gpu/drm/i915/display/intel_qp_tables.c | 187 ++++++++++++++++-- .../gpu/drm/i915/display/intel_qp_tables.h | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 108 +++++++++- drivers/gpu/drm/i915/i915_reg.h | 28 +++ include/drm/display/drm_dp_helper.h | 7 + 9 files changed, 440 insertions(+), 25 deletions(-)
Signature · 1 line
2.25.1
PATCH v6 1/9 drm/dp_helper: Add helper to check if the sink supports given format with DSC
From: Ankit Nautiyal <[email protected]>
Add helper function to check if the DP sink supports DSC with the given output format.
--- include/drm/display/drm_dp_helper.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/drm/display/drm_dp_helper.h +7 -0
@@ -194,6 +194,13 @@ drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])DP_DSC_SLICE_WIDTH_MULTIPLIER ; } +/* Check if sink supports DSC with given output format */ +static inline bool +drm_dp_dsc_sink_supports_format (const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE ],u8 output_format) +{ +return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP -DP_DSC_SUPPORT ] & output_format; +} +/* Forward Error Correction Support on DP 1.4 */ static inline bool drm_dp_sink_supports_fec (const u8 fec_capable)
Signature · 1 line
2.25.1
PATCH v6 2/9 drm/i915/dp: Check if DSC supports the given output_format
In reply to Suraj KandpalFrom: Ankit Nautiyal <[email protected]>
Go with DSC only if the given output_format is supported.
v2: Use drm helper to get DSC format support for sink.
--- drivers/gpu/drm/i915/display/intel_dp.c | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +30 -0
@@ -1483,6 +1483,31 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,return drm_dsc_compute_rc_parameters (vdsc_cfg); } +static bool intel_dp_dsc_supports_format (struct intel_dp *intel_dp, +enum intel_output_format output_format) +{ +u8 sink_dsc_format; + +switch (output_format) { +case INTEL_OUTPUT_FORMAT_RGB : + sink_dsc_format =DP_DSC_RGB ; +break ; +case INTEL_OUTPUT_FORMAT_YCBCR444 : + sink_dsc_format = DP_DSC_YCbCr444; +break ; +case INTEL_OUTPUT_FORMAT_YCBCR420 : +if (min (intel_dp_source_dsc_version_minor (intel_dp), +intel_dp_sink_dsc_version_minor (intel_dp)) <2 ) +return false; + sink_dsc_format = DP_DSC_YCbCr420_Native; +break ; +default : +return false; + } + +return drm_dp_dsc_sink_supports_format (intel_dp->dsc_dpcd, sink_dsc_format); +} + int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state,
@@ -1503,11 +1528,16 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,if (!intel_dp_supports_dsc (intel_dp, pipe_config))return -EINVAL ; +if (!intel_dp_dsc_supports_format (intel_dp, pipe_config->output_format)) +return -EINVAL ; +if (compute_pipe_bpp) pipe_bpp =intel_dp_dsc_compute_bpp (intel_dp, conn_state->max_requested_bpc);else pipe_bpp = pipe_config->pipe_bpp; + pipe_bpp =intel_dp_dsc_compute_bpp (intel_dp, conn_state->max_requested_bpc); +if (intel_dp->force_dsc_bpc) { pipe_bpp = intel_dp->force_dsc_bpc *3 ;drm_dbg_kms (&dev_priv->drm,"Input DSC BPP forced to %d" , pipe_bpp);
Signature · 1 line
2.25.1
PATCH v6 3/9 drm/i915: Adding the new registers for DSC
In reply to Suraj KandpalAdding new DSC register which are introducted MTL onwards
--- drivers/gpu/drm/i915/i915_reg.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +28 -0
@@ -7766,6 +7766,8 @@ enum skl_power_gate {#define ICL_DSC1_PICTURE_PARAMETER_SET_0 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ _ICL_DSC1_PICTURE_PARAMETER_SET_0_PB, \ _ICL_DSC1_PICTURE_PARAMETER_SET_0_PC) +#define DSC_NATIVE_422_ENABLE BIT(23) +#define DSC_NATIVE_420_ENABLE BIT(22)#define DSC_ALT_ICH_SEL (1 << 20)#define DSC_VBR_ENABLE (1 << 19)#define DSC_422_ENABLE (1 << 18)
@@ -8010,6 +8012,32 @@ enum skl_power_gate {#define DSC_SLICE_PER_LINE (slice_per_line) ((slice_per_line) << 16)#define DSC_SLICE_CHUNK_SIZE (slice_chunk_size) ((slice_chunk_size) << 0) +/* MTL Display Stream Compression registers */ +#define _MTL_DSC0_PICTURE_PARAMETER_SET_17_PB 0x782B4 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_17_PB 0x783B4 +#define _MTL_DSC0_PICTURE_PARAMETER_SET_17_PC 0x784B4 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_17_PC 0x785B4 +#define MTL_DSC0_PICTURE_PARAMETER_SET_17 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ + _MTL_DSC0_PICTURE_PARAMETER_SET_17_PB, \ + _MTL_DSC0_PICTURE_PARAMETER_SET_17_PC) +#define MTL_DSC1_PICTURE_PARAMETER_SET_17 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ + _MTL_DSC1_PICTURE_PARAMETER_SET_17_PB, \ + _MTL_DSC1_PICTURE_PARAMETER_SET_17_PC) +#define DSC_SL_BPG_OFFSET (offset) ((offset) << 27) + +#define _MTL_DSC0_PICTURE_PARAMETER_SET_18_PB 0x782B8 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_18_PB 0x783B8 +#define _MTL_DSC0_PICTURE_PARAMETER_SET_18_PC 0x784B8 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_18_PC 0x785B8 +#define MTL_DSC0_PICTURE_PARAMETER_SET_18 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ + _MTL_DSC0_PICTURE_PARAMETER_SET_18_PB, \ + _MTL_DSC0_PICTURE_PARAMETER_SET_18_PC) +#define MTL_DSC1_PICTURE_PARAMETER_SET_18 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ + _MTL_DSC1_PICTURE_PARAMETER_SET_18_PB, \ + _MTL_DSC1_PICTURE_PARAMETER_SET_18_PC) +#define DSC_NSL_BPG_OFFSET (offset) ((offset) << 16) +#define DSC_SL_OFFSET_ADJ (offset) ((offset) << 0) +/* Icelake Rate Control Buffer Threshold Registers */ #define DSCA_RC_BUF_THRESH_0 _MMIO(0x6B230)#define DSCA_RC_BUF_THRESH_0_UDW _MMIO(0x6B230 + 4)
Signature · 1 line
2.25.1
Re: [Intel-gfx] [PATCH v6 3/9] drm/i915: Adding the new registers for DSC
Quoted 9 lines
-----Original Message-----
From: Kandpal, Suraj <[email protected]>
Sent: Wednesday, January 11, 2023 11:09 AM
To: [email protected]
Cc: Nautiyal, Ankit K <[email protected]>; Kulkarni, Vandita <[email protected]>; Navare, Manasi D <[email protected]>; Kandpal, Suraj <[email protected]>
Subject: [PATCH v6 3/9] drm/i915: Adding the new registers for DSC
Quoted 3 lines
Adding new DSC register which are introducted MTL onwards
Signed-off-by Suraj Kandpal <[email protected]>
Quoted 70 lines
--- drivers/gpu/drm/i915/i915_reg.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/i915_reg.hindex8b2cf980f323..69a645ce0fe8100644drivers/gpu/drm/i915/i915_reg.h +2
-0@@ -7766,6 +7766,8 @@ enum skl_power_gate {#define ICL_DSC1_PICTURE_PARAMETER_SET_0 (pipe)_MMIO_PIPE ((pipe) -PIPE_B , \ _ICL_DSC1_PICTURE_PARAMETER_SET_0_PB, \ _ICL_DSC1_PICTURE_PARAMETER_SET_0_PC) +#define DSC_NATIVE_422_ENABLE BIT(23) +#define DSC_NATIVE_420_ENABLE BIT(22)#define DSC_ALT_ICH_SEL (1 << 20) #define DSC_VBR_ENABLE (1 << 19) #define DSC_422_ENABLE (1 << 18)drivers/gpu/drm/i915/i915_reg.h +7
-0@@ -8010,6 +8012,32 @@ enum skl_power_gate {#define DSC_SLICE_PER_LINE (slice_per_line) ((slice_per_line) << 16)#define DSC_SLICE_CHUNK_SIZE (slice_chunk_size) ((slice_chunk_size) <<0 ) +/* MTL Display Stream Compression registers */ +#define _MTL_DSC0_PICTURE_PARAMETER_SET_17_PB 0x782B4 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_17_PB 0x783B4 +#define _MTL_DSC0_PICTURE_PARAMETER_SET_17_PC 0x784B4 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_17_PC 0x785B4 +#define MTL_DSC0_PICTURE_PARAMETER_SET_17 (pipe) _MMIO_PIPE((pipe) - PIPE_B, \ +
_MTL_DSC0_PICTURE_PARAMETER_SET_17_PB, \
+_MTL_DSC0_PICTURE_PARAMETER_SET_17_PC)
+#defineMTL_DSC1_PICTURE_PARAMETER_SET_17(pipe)_MMIO_PIPE((pipe) - PIPE_B, \+
_MTL_DSC1_PICTURE_PARAMETER_SET_17_PB, \
+_MTL_DSC1_PICTURE_PARAMETER_SET_17_PC)drivers/gpu/drm/i915/i915_reg.h +7
-0+#define DSC_SL_BPG_OFFSET (offset) ((offset) << 27) + +#define _MTL_DSC0_PICTURE_PARAMETER_SET_18_PB 0x782B8 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_18_PB 0x783B8 +#define _MTL_DSC0_PICTURE_PARAMETER_SET_18_PC 0x784B8 +#define _MTL_DSC1_PICTURE_PARAMETER_SET_18_PC 0x785B8 +#define MTL_DSC0_PICTURE_PARAMETER_SET_18 (pipe)_MMIO_PIPE((pipe) - PIPE_B, \+
_MTL_DSC0_PICTURE_PARAMETER_SET_18_PB, \
+_MTL_DSC0_PICTURE_PARAMETER_SET_18_PC)
+#defineMTL_DSC1_PICTURE_PARAMETER_SET_18(pipe)_MMIO_PIPE((pipe) - PIPE_B, \+
_MTL_DSC1_PICTURE_PARAMETER_SET_18_PB, \
+_MTL_DSC1_PICTURE_PARAMETER_SET_18_PC)drivers/gpu/drm/i915/i915_reg.h +3
-1+#define DSC_NSL_BPG_OFFSET (offset) ((offset) << 16) +#define DSC_SL_OFFSET_ADJ (offset) ((offset) << 0) +/* Icelake Rate Control Buffer Threshold Registers */ #define DSCA_RC_BUF_THRESH_0 _MMIO(0x6B230)#define DSCA_RC_BUF_THRESH_0_UDW _MMIO(0x6B230 + 4) --2.25.1
PATCH v6 4/9 drm/i915: Enable YCbCr420 for VDSC
In reply to Suraj KandpalImplementation of VDSC for YCbCr420.
--- .../gpu/drm/i915/display/intel_qp_tables.c | 187 ++++++++++++++++-- .../gpu/drm/i915/display/intel_qp_tables.h | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- 3 files changed, 180 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/intel_qp_tables.c +176 -11
@@ -17,6 +17,15 @@/* from BPP 6 to 36 in steps of 0.5 */ #define RC_RANGE_QP444_12BPC_MAX_NUM_BPP 61 +/* from BPP 6 to 24 in steps of 0.5 */ +#define RC_RANGE_QP420_8BPC_MAX_NUM_BPP 17 + +/* from BPP 6 to 30 in steps of 0.5 */ +#define RC_RANGE_QP420_10BPC_MAX_NUM_BPP 23 + +/* from BPP 6 to 36 in steps of 0.5 */ +#define RC_RANGE_QP420_12BPC_MAX_NUM_BPP 29 +/* * These qp tables are as per the C model * and it has the rows pointing to bpps which increment
@@ -283,26 +292,182 @@ static const u8 rc_range_maxqp444_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_12BPC 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 5, 5, 4 } }; -#define PARAM_TABLE (_minmax, _bpc, _row, _col) do { \ - if (bpc == (_bpc)) \ - return rc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \ +static const u8 rc_range_minqp420_8bpc[DSC_NUM_BUF_RANGES ][RC_RANGE_QP420_8BPC_MAX_NUM_BPP ] = { + {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 }, + {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 }, + {1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 }, + {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 }, + {3 ,3 ,3 ,3 ,3 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 }, + {3 ,3 ,3 ,3 ,3 ,2 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 }, + {3 ,3 ,3 ,3 ,3 ,3 ,2 ,2 ,1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13 ,12 ,12 ,11 ,10 ,10 , +9 ,9 ,8 ,7 ,7 ,6 ,5 ,5 ,4 ,4 ,3 }, + {22 ,21 ,21 ,20 ,19 ,19 ,18 ,17 ,17 ,16 ,15 ,15 ,15 ,14 ,13 ,13 ,12 ,11 , +11 ,11 ,10 ,9 ,9 ,8 ,7 ,7 ,6 ,6 ,5 } +}; + +#define PARAM_TABLE (_minmax, _bpc, _row, _col, _is_420) do { \ + if (bpc == (_bpc)) { \ + if (_is_420) \ + return rc_range_##_minmax##qp420_##_bpc##bpc[_row][_col]; \ + else \ + return rc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \ + } \ } while (0) -u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i) +u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i,bool is_420) { -PARAM_TABLE (min,8 , buf_i, bpp_i); -PARAM_TABLE (min,10 , buf_i, bpp_i); -PARAM_TABLE (min,12 , buf_i, bpp_i); +PARAM_TABLE (min,8 , buf_i, bpp_i, is_420); +PARAM_TABLE (min,10 , buf_i, bpp_i, is_420); +PARAM_TABLE (min,12 , buf_i, bpp_i, is_420);MISSING_CASE (bpc);return 0 ; } -u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i) +u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i,bool is_420) { -PARAM_TABLE (max,8 , buf_i, bpp_i); -PARAM_TABLE (max,10 , buf_i, bpp_i); -PARAM_TABLE (max,12 , buf_i, bpp_i); +PARAM_TABLE (max,8 , buf_i, bpp_i, is_420); +PARAM_TABLE (max,10 , buf_i, bpp_i, is_420); +PARAM_TABLE (max,12 , buf_i, bpp_i, is_420);MISSING_CASE (bpc);return 0 ;
drivers/gpu/drm/i915/display/intel_qp_tables.h +2 -2
@@ -8,7 +8,7 @@#include <linux/types.h> -u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i); -u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i); +u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i,bool is_420); +u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i,bool is_420);#endif
drivers/gpu/drm/i915/display/intel_vdsc.c +2 -2
@@ -422,9 +422,9 @@ calculate_rc_params(struct rc_parameters *rc,for (buf_i =0 ; buf_i <DSC_NUM_BUF_RANGES ; buf_i++) {/* Read range_minqp and range_max_qp from qp tables */ rc->rc_range_params[buf_i].range_min_qp = -intel_lookup_range_min_qp (bpc, buf_i, bpp_i); +intel_lookup_range_min_qp (bpc, buf_i, bpp_i, vdsc_cfg->native_420); rc->rc_range_params[buf_i].range_max_qp = -intel_lookup_range_max_qp (bpc, buf_i, bpp_i); +intel_lookup_range_max_qp (bpc, buf_i, bpp_i, vdsc_cfg->native_420);/* Calculate range_bgp_offset */ if (bpp <=6 ) {
Signature · 1 line
2.25.1
Re: [Intel-gfx] [PATCH v6 4/9] drm/i915: Enable YCbCr420 for VDSC
Quoted 10 lines
-----Original Message-----
From: Kandpal, Suraj <[email protected]>
Sent: Wednesday, January 11, 2023 11:09 AM
To: [email protected]
Cc: Nautiyal, Ankit K <[email protected]>; Kulkarni, Vandita <[email protected]>; Navare, Manasi D <[email protected]>; Kandpal, Suraj <[email protected]>
Subject: [PATCH v6 4/9] drm/i915: Enable YCbCr420 for VDSCImplementation of VDSC for YCbCr420.
Some more description on from where the tables that are added in this patch were taken from and spec reference will be good to have here.
With that added the patch looks good to me.
Quoted 276 lines
Signed-off-by Suraj Kandpal <[email protected]>--- .../gpu/drm/i915/display/intel_qp_tables.c | 187 ++++++++++++++++-- .../gpu/drm/i915/display/intel_qp_tables.h | 4 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 4 +- 3 files changed, 180 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/display/intel_qp_tables.c +10
-0@@ -17,6 +17,15 @@/* from BPP 6 to 36 in steps of 0.5 */ #define RC_RANGE_QP444_12BPC_MAX_NUM_BPP 61 +/* from BPP 6 to 24 in steps of 0.5 */ +#define RC_RANGE_QP420_8BPC_MAX_NUM_BPP 17 + +/* from BPP 6 to 30 in steps of 0.5 */ +#define RC_RANGE_QP420_10BPC_MAX_NUM_BPP 23 + +/* from BPP 6 to 36 in steps of 0.5 */ +#define RC_RANGE_QP420_12BPC_MAX_NUM_BPP 29 +/* * These qp tables are as per the C model * and it has the rows pointing to bpps which increment @@ -283,26 +292,182 @@ static const u8 rc_range_maxqp444_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP444_ 12BPC
drivers/gpu/drm/i915/display/intel_qp_tables.c +0
-311, 11, 10, 10, 10, 10, 10, 9, 9, 8, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 5, 5, 4 } }; -#define PARAM_TABLE (_minmax, _bpc, _row, _col) do { \ - if (bpc == (_bpc)) \ - returnrc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \
+static const u8 rc_range_minqp420_8bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_8BPC_MAX_NUM_BPP] = {drivers/gpu/drm/i915/display/intel_qp_tables.c +17
-0+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, + { 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 }, + { 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0 }, + { 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 0 }, + { 3, 3, 3, 3, 3, 3, 2, 2, 2, 2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7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1 }, + { 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1 }, + { 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 7, 6, 6, 5, 4, 4, 3, 3, 2, 1 }, + { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 7, 7, 6, 5, 4, 4, 3, 3, 2, 1 }, + { 13, 12, 12, 11, 11, 11, 11, 11, 11, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, 3, 3, + 2, 2 }, + { 17, 16, 16, 15, 14, 14, 13, 12, 12, 11, 10, 10, 10, 9, 8, 8, 7, 6, 6, 5, + 5, 4, 4 } +}; + +static const u8rc_range_maxqp420_10bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_ 10BPC_MAX_NUM_BPP] = {
drivers/gpu/drm/i915/display/intel_qp_tables.c +30
-0+ { 8, 8, 7, 6, 4, 4, 3, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 8, 8, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 9, 9, 9, 8, 8, 7, 6, 5, 4, 3, 3, 3, 3, 3, 2, 1, 1, 1, 0, 0, 0, 0, 0 }, + { 10, 10, 10, 9, 9, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 0, + 0 }, + { 11, 11, 11, 10, 10, 8, 7, 6, 5, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, + 0 }, + { 11, 11, 11, 10, 10, 9, 8, 7, 6, 6, 6, 5, 4, 4, 3, 3, 2, 2, 2, 2, 2, 1, + 1 }, + { 11, 11, 11, 11, 11, 10, 9, 8, 7, 7, 7, 6, 5, 5, 4, 3, 3, 3, 3, 2, 2, 2, + 1 }, + { 12, 12, 12, 12, 12, 11, 10, 9, 8, 8, 8, 7, 6, 5, 5, 4, 3, 3, 3, 2, 2, + 2, 1 }, + { 13, 13, 13, 12, 12, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 5, 4, 4, 3, 3, 3, + 2, 2 }, + { 14, 14, 13, 13, 13, 12, 11, 10, 9, 9, 9, 8, 8, 7, 7, 6, 5, 4, 4, 3, 3, + 2, 2 }, + { 14, 14, 14, 13, 13, 12, 12, 11, 10, 10, 9, 9, 8, 8, 7, 6, 5, 5, 4, 4, + 3, 3, 2 }, + { 15, 15, 14, 14, 13, 13, 12, 11, 11, 10, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, + 4, 3, 2 }, + { 15, 15, 15, 14, 13, 13, 13, 12, 11, 11, 10, 9, 9, 8, 8, 7, 6, 5, 5, 4, + 4, 3, 2 }, + { 17, 16, 16, 15, 14, 14, 13, 12, 12, 11, 10, 10, 9, 8, 8, 7, 6, 6, 5, 4, + 4, 3, 3 }, + { 18, 17, 17, 16, 15, 15, 14, 13, 13, 12, 11, 11, 11, 10, 9, 9, 8, 7, 7, + 6, 6, 5, 5 } +}; + +static const u8rc_range_minqp420_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_1 2BPC_MAX_NUM_BPP] = {
drivers/gpu/drm/i915/display/intel_qp_tables.c +33
-0+ {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , + 0, 0, 0, 0, 0 }, + { 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 }, + { 9, 8, 8, 7, 7, 6, 5, 5, 4, 4, 4, 4, 3, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 }, + { 10, 9, 9, 8, 8, 8, 7, 7, 6, 6, 6, 5, 5, 4, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0 }, + { 11, 10, 10, 10, 10, 9, 9, 8, 7, 6, 6, 6, 6, 5, 5, 4, 3, 3, 3, 2, 2, 1, + 0, 0, 0, 0, 0, 0, 0 }, + { 11, 11, 11, 11, 11, 10, 10, 9, 9, 9, 9, 8, 7, 6, 5, 5, 4, 4, 3, 3, 3, 2, + 1, 1, 0, 0, 0, 0, 0 }, + { 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 9, 8, 8, 7, 6, 5, 5, 5, 5, 4, 3, 3, + 2, 1, 1, 1, 1, 1, 0 }, + { 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 9, 8, 8, 8, 7, 6, 6, 5, 4, 4, + 3, 2, 2, 1, 1, 1, 1, 1 }, + { 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 5, + 5, 4, 4, 2, 2, 1, 1, 1, 1 }, + { 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, + 5, 4, 4, 3, 2, 2, 1, 1, 1 }, + { 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, + 6, 5, 4, 3, 3, 2, 2, 1, 1 }, + { 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 11, 10, 10, 9, 8, 8, + 7, 7, 6, 5, 4, 3, 3, 2, 2, 1 }, + { 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 10, 9, 8, 8, + 7, 7, 6, 5, 4, 4, 3, 2, 2, 1 }, + { 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 13, 12, 11, 11, 10, 9, 9, 8, + 8, 7, 6, 6, 5, 4, 4, 3, 3, 2 }, + { 21, 20, 20, 19, 18, 18, 17, 16, 16, 15, 14, 14, 14, 13, 12, 12, 11, 10, + 10, 10, 9, 8, 8, 7, 6, 6, 5, 5, 4 } +}; + +static const u8rc_range_maxqp420_12bpc[DSC_NUM_BUF_RANGES][RC_RANGE_QP420_ 12BPC_MAX_NUM_BPP] = {
drivers/gpu/drm/i915/display/intel_qp_tables.c +35
-0+ {11 ,10 ,9 ,8 ,6 ,6 ,5 ,5 ,4 ,3 ,3 ,2 ,2 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 , + 0, 0, 0, 0, 0, 0 }, + { 12, 11, 11, 10, 9, 8, 7, 7, 6, 6, 5, 5, 4, 3, 3, 2, 1, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0 }, + { 13, 12, 12, 11, 11, 10, 9, 8, 7, 6, 6, 6, 5, 5, 4, 3, 3, 2, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0 }, + { 14, 13, 13, 12, 12, 11, 10, 9, 8, 7, 7, 6, 6, 5, 5, 4, 3, 3, 2, 2, 2, 1, + 1, 1, 0, 0, 0, 0, 0 }, + { 15, 14, 14, 13, 13, 11, 10, 9, 8, 7, 7, 7, 7, 6, 6, 5, 4, 4, 4, 3, 3, 2, + 1, 1, 1, 0, 0, 0, 0 }, + { 15, 15, 15, 14, 14, 13, 12, 11, 10, 10, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, + 4, 3, 2, 2, 1, 1, 0, 0, 0 }, + { 15, 15, 15, 15, 15, 14, 13, 12, 11, 11, 11, 10, 9, 8, 7, 6, 6, 6, 6, 5, + 4, 4, 3, 2, 2, 2, 1, 1, 0 }, + { 16, 16, 16, 16, 16, 15, 14, 13, 12, 12, 12, 11, 10, 9, 9, 8, 7, 7, 6, 5, + 5, 4, 3, 3, 2, 2, 2, 1, 1 }, + { 17, 17, 17, 16, 16, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 9, 8, 8, 7, + 6, 6, 5, 5, 3, 3, 2, 2, 1, 1 }, + { 18, 18, 17, 17, 17, 16, 15, 14, 13, 13, 13, 12, 12, 11, 11, 10, 9, 8, 8, + 7, 6, 5, 5, 4, 3, 3, 2, 2, 1 }, + { 18, 18, 18, 17, 17, 16, 16, 15, 14, 14, 13, 13, 12, 12, 11, 10, 9, 9, 8, + 8, 7, 6, 5, 4, 4, 3, 3, 2, 2 }, + { 19, 19, 18, 18, 17, 17, 16, 15, 15, 14, 14, 13, 13, 12, 11, 11, 10, 9, + 9, 8, 8, 7, 6, 5, 4, 4, 3, 3, 2 }, + { 19, 19, 19, 18, 17, 17, 17, 16, 15, 15, 14, 13, 13, 12, 12, 11, 10, 9, + 9, 8, 8, 7, 6, 5, 5, 4, 3, 3, 2 }, + { 21, 20, 20, 19, 18, 18, 17, 16, 16, 15, 14, 14, 13, 12, 12, 11, 10, 10, + 9, 9, 8, 7, 7, 6, 5, 5, 4, 4, 3 }, + { 22, 21, 21, 20, 19, 19, 18, 17, 17, 16, 15, 15, 15, 14, 13, 13, 12, 11, + 11, 11, 10, 9, 9, 8, 7, 7, 6, 6, 5 } }; + +#define PARAM_TABLE (_minmax, _bpc, _row, _col, _is_420) do { \ + if (bpc == (_bpc)) { \ + if (_is_420) \ + returnrc_range_##_minmax##qp420_##_bpc##bpc[_row][_col]; \
drivers/gpu/drm/i915/display/intel_qp_tables.c +2
-0+ else \ + returnrc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \
drivers/gpu/drm/i915/display/intel_qp_tables.c +11
-8+ } \ }while (0 ) -u8 intel_lookup_range_min_qp(int bpc, int buf_i, int bpp_i) +u8 intel_lookup_range_min_qp(int bpc, int buf_i, int bpp_i, bool +is_420) { -PARAM_TABLE (min,8 , buf_i, bpp_i); -PARAM_TABLE (min,10 , buf_i, bpp_i); -PARAM_TABLE (min,12 , buf_i, bpp_i); +PARAM_TABLE (min,8 , buf_i, bpp_i, is_420); +PARAM_TABLE (min,10 , buf_i, bpp_i, is_420); +PARAM_TABLE (min,12 , buf_i, bpp_i, is_420);MISSING_CASE (bpc);return 0 ; } -u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i) +u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i,bool +is_420) { -PARAM_TABLE (max,8 , buf_i, bpp_i); -PARAM_TABLE (max,10 , buf_i, bpp_i); -PARAM_TABLE (max,12 , buf_i, bpp_i); +PARAM_TABLE (max,8 , buf_i, bpp_i, is_420); +PARAM_TABLE (max,10 , buf_i, bpp_i, is_420); +PARAM_TABLE (max,12 , buf_i, bpp_i, is_420);MISSING_CASE (bpc);return 0 ;drivers/gpu/drm/i915/display/intel_qp_tables.h +4
-2@@ -8,7 +8,7 @@#include <linux/types.h> -u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i); -u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i); +u8 intel_lookup_range_min_qp (int bpc,int buf_i,int bpp_i,bool +is_420); +u8 intel_lookup_range_max_qp (int bpc,int buf_i,int bpp_i,bool +is_420);#endif drivers/gpu/drm/i915/display/intel_vdsc.c +2
-2@@ -422,9 +422,9 @@ calculate_rc_params(struct rc_parameters *rc,for (buf_i =0 ; buf_i <DSC_NUM_BUF_RANGES ; buf_i++) {/* Read range_minqp and range_max_qp from qp tables */ rc->rc_range_params[buf_i].range_min_qp = -intel_lookup_range_min_qp (bpc, buf_i, bpp_i); +intel_lookup_range_min_qp (bpc, buf_i, bpp_i, vdsc_cfg->native_420); rc->rc_range_params[buf_i].range_max_qp = -intel_lookup_range_max_qp (bpc, buf_i, bpp_i); +intel_lookup_range_max_qp (bpc, buf_i, bpp_i, vdsc_cfg->native_420);drivers/gpu/drm/i915/display/intel_vdsc.c +0
-1/* Calculate range_bgp_offset */ if (bpp <=6 ) { --2.25.1
PATCH v6 5/9 drm/i915: Fill in native_420 field
In reply to Suraj KandpalNow that we have laid the groundwork for YUV420 Enablement we fill up native_420 field in vdsc_cfg and add appropriate checks wherever required.
---v2
-adding native_422 field as 0 [Vandita]
-filling in second_line_bpg_offset, second_line_offset_adj and nsl_bpg_offset in vds_cfg when native_420 is true
---v3
-adding display version check to solve igt issue
--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_dp.c | 3 - drivers/gpu/drm/i915/display/intel_vdsc.c | 74 ++++++++++++++++++++++- 3 files changed, 71 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +0 -2
@@ -1626,8 +1626,6 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,if (crtc_state->dsc.slice_count >1 ) crtc_state->dsc.dsc_split = true; - vdsc_cfg->convert_rgb = true; -/* FIXME: initialize from VBT */ vdsc_cfg->rc_model_size =DSC_RC_MODEL_SIZE_CONST ;
drivers/gpu/drm/i915/display/intel_dp.c +0 -3
@@ -1459,9 +1459,6 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,min (intel_dp_source_dsc_version_minor (intel_dp),intel_dp_sink_dsc_version_minor (intel_dp)); - vdsc_cfg->convert_rgb = intel_dp->dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP -DP_DSC_SUPPORT ] & -DP_DSC_RGB ; - line_buf_depth =drm_dp_dsc_sink_line_buf_depth (intel_dp->dsc_dpcd);if (!line_buf_depth) { drm_dbg_kms(&i915->drm,
drivers/gpu/drm/i915/display/intel_vdsc.c +71 -3
99 lines not on this page · raw message
Signature · 1 line
2.25.1
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v6 5/9] drm/i915: Fill in native_420 field
Quoted 116 lines · Suraj Kandpal
Now that we have laid the groundwork for YUV420 Enablement we fill up
native_420field invdsc_cfgand add appropriate checks wherever required.---v2
(quoted diff) +0
-2-adding native_422 field as 0 [Vandita] -filling in second_line_bpg_offset, second_line_offset_adjand
nsl_bpg_offsetinvds_cfgwhennative_420is true---v3
-adding display version check to solve igt issueSigned-off-by Suraj Kandpal <[email protected]>--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_dp.c | 3 - drivers/gpu/drm/i915/display/intel_vdsc.c | 74 ++++++++++++++++++++++- 3 files changed, 71 insertions(+), 8 deletions(-)drivers/gpu/drm/i915/display/icl_dsi.c +0
-2@@ -1626,8 +1626,6 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,if (crtc_state->dsc.slice_count >1 ) crtc_state->dsc.dsc_split = true; - vdsc_cfg->convert_rgb = true; -/* FIXME: initialize from VBT */ vdsc_cfg->rc_model_size =DSC_RC_MODEL_SIZE_CONST ;drivers/gpu/drm/i915/display/intel_dp.c +0
-3@@ -1459,9 +1459,6 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,min (intel_dp_source_dsc_version_minor (intel_dp),intel_dp_sink_dsc_version_minor (intel_dp)); - vdsc_cfg->convert_rgb = intel_dp->dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP -DP_DSC_SUPPORT ] & -DP_DSC_RGB ; - line_buf_depth =drm_dp_dsc_sink_line_buf_depth (intel_dp->dsc_dpcd);if (!line_buf_depth) { drm_dbg_kms(&i915->drm,drivers/gpu/drm/i915/display/intel_vdsc.c +41
-3@@ -460,14 +460,47 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) vdsc_cfg->pic_width = pipe_config->hw.adjusted_mode.crtc_hdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); - -/* Gen 11 does not support YCbCr */ +/* +* According to DSC 1.2 specs if colorspace is YCbCr then convert_rgb is 0 +* else 1 +*/ + vdsc_cfg->convert_rgb = !(pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR420 || + pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR444 ); + +if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR420 ) + vdsc_cfg->native_420 = true; +/* We do not support YcBCr422 as of now */ + vdsc_cfg->native_422 = false; +/* Gen 11 does not support YCbCr422 */ vdsc_cfg->simple_422 = false;/* Gen 11 does not support VBR */ vdsc_cfg->vbr_enable = false;/* Gen 11 only supports integral values of bpp */ vdsc_cfg->bits_per_pixel = compressed_bpp <<4 ; +/* +* According to DSC 1.2 specs if native_420 is set: +* -We need to double the current bpp. +* -second_line_bpg_offset is 12 in general and equal to 2*(slice_height-1) if slice +* height < 8. +* -second_line_offset_adj is 512 as shown by emperical values to yeild best chroma +* preservation in second line. +* -nsl_bpg_offset is calculated as second_line_offset/slice_height -1 then rounded +* up to 16 fractional bits, we left shift second line offset by 11 to preserve 11 +* fractional bits. +*/ +if (vdsc_cfg->native_420) { + vdsc_cfg->bits_per_pixel <<=1 ; +if (vdsc_cfg->slice_height >=8 ) + vdsc_cfg->second_line_bpg_offset =12 ; +else + vdsc_cfg->second_line_bpg_offset = +2 * (vdsc_cfg->slice_height -1 ); + vdsc_cfg->second_line_offset_adj =512 ; + vdsc_cfg->nsl_bpg_offset =DIV_ROUND_UP (vdsc_cfg->second_line_bpg_offset <<11 , + vdsc_cfg->slice_height -1 ); + } + vdsc_cfg->bits_per_component = pipe_config->pipe_bpp /3 ;for (i =0 ; i <DSC_NUM_BUF_RANGES -1 ; i++) {@@ -594,8 +627,13 @@ static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state)DSC_VER_MIN_SHIFT | vdsc_cfg->bits_per_component <<DSC_BPC_SHIFT | vdsc_cfg->line_buf_depth <<DSC_LINE_BUF_DEPTH_SHIFT ; -if (vdsc_cfg->dsc_version_minor ==2 ) +if (vdsc_cfg->dsc_version_minor ==2 ) { pps_val |=DSC_ALT_ICH_SEL ; +if (vdsc_cfg->native_420) + pps_val |=DSC_NATIVE_420_ENABLE ; +if (vdsc_cfg->native_422) + pps_val |=DSC_NATIVE_422_ENABLE ; + }if (vdsc_cfg->block_pred_enable) pps_val |=DSC_BLOCK_PREDICTION ;if (vdsc_cfg->convert_rgb)
drivers/gpu/drm/i915/display/intel_vdsc.c static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state) · line 952
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +6
-0@@ -906,6 +944,36 @@ static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state) pps_val); } +if (DISPLAY_VER (dev_priv) >=14 ) { +/* Populate PICTURE_PARAMETER_SET_17 registers */ + pps_val =0 ; + pps_val |=DSC_SL_BPG_OFFSET (vdsc_cfg->second_line_bpg_offset); +drm_dbg_kms (&dev_priv->drm,"PPS17 = 0x%08x\n" , pps_val); +if (is_pipe_dsc (crtc, cpu_transcoder)) {
This is always true for DISPLAY_VER() >= 14.
Quoted 27 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +24
-0+intel_de_write (dev_priv, +MTL_DSC0_PICTURE_PARAMETER_SET_17 (pipe), + pps_val); +if (crtc_state->dsc.dsc_split) +intel_de_write (dev_priv, +MTL_DSC1_PICTURE_PARAMETER_SET_17 (pipe), + pps_val); + } + +/* Populate PICTURE_PARAMETER_SET_18 registers */ + pps_val =0 ; + pps_val |=DSC_NSL_BPG_OFFSET (vdsc_cfg->nsl_bpg_offset) | +DSC_SL_OFFSET_ADJ (vdsc_cfg->second_line_offset_adj); +drm_dbg_kms (&dev_priv->drm,"PPS18 = 0x%08x\n" , pps_val); +if (is_pipe_dsc (crtc, cpu_transcoder)) { +intel_de_write (dev_priv, +MTL_DSC0_PICTURE_PARAMETER_SET_18 (pipe), + pps_val); +if (crtc_state->dsc.dsc_split) +intel_de_write (dev_priv, +MTL_DSC1_PICTURE_PARAMETER_SET_18 (pipe), + pps_val); + } + }/* Populate the RC_BUF_THRESH registers */ memset (rc_buf_thresh_dword,0 ,sizeof (rc_buf_thresh_dword));for (i =0 ; i <DSC_NUM_BUF_RANGES -1 ; i++) {
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
PATCH v6 6/9 drm/i915/vdsc: Check slice design requirement
In reply to Suraj KandpalAdd function to check if slice design requirements are being met as defined in the below link section Slice Design Requirement
https://gfxspecs.intel.com/Predator/Home/Index/49259
--- drivers/gpu/drm/i915/display/intel_vdsc.c | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/gpu/drm/i915/display/intel_vdsc.c +32 -0
@@ -447,6 +447,29 @@ calculate_rc_params(struct rc_parameters *rc, } } +static int intel_dsc_check_slice_design_req (struct intel_crtc_state *pipe_config, +struct drm_dsc_config *vdsc_cfg) +{ +if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_RGB || + pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR444 ) { +if (vdsc_cfg->slice_height >4095 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <15000 ) +return -EINVAL ; + }else if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR420 ) { +if (!(vdsc_cfg->slice_width %2 )) +return -EINVAL ; +if (!(vdsc_cfg->slice_height %2 )) +return -EINVAL ; +if (vdsc_cfg->slice_height >4094 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <30000 ) +return -EINVAL ; + } + +return 0 ; +} +int intel_dsc_compute_params (struct intel_crtc_state *pipe_config) {struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);
@@ -455,11 +478,20 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)u16 compressed_bpp = pipe_config->dsc.compressed_bpp;const struct rc_parameters *rc_params;struct rc_parameters *rc =NULL ; +int err;u8 i =0 ; vdsc_cfg->pic_width = pipe_config->hw.adjusted_mode.crtc_hdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); + + err =intel_dsc_check_slice_design_req (pipe_config, vdsc_cfg); + +if (err) { +drm_dbg_kms (&dev_priv->drm,"Slice design requirements not met\n" ); +return err; + } +/* * According to DSC 1.2 specs if colorspace is YCbCr then convert_rgb is 0 * else 1
Signature · 1 line
2.25.1
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v6 6/9] drm/i915/vdsc: Check slice design requirement
Quoted 5 lines · Suraj Kandpal
Add function to check if slice design requirements are being met as defined in the below link section Slice Design Requirement
Just add this:
Bspec: 49259
and no URLs.
Quoted 10 lines
Signed-off-by Suraj Kandpal <[email protected]>--- drivers/gpu/drm/i915/display/intel_vdsc.c | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+)drivers/gpu/drm/i915/display/intel_vdsc.c +0
-0
drivers/gpu/drm/i915/display/intel_vdsc.c calculate_rc_params(struct rc_parameters *rc, · line 451
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +2
-0@@ -447,6 +447,29 @@ calculate_rc_params(struct rc_parameters *rc, } } +static int intel_dsc_check_slice_design_req (struct intel_crtc_state *pipe_config, +struct drm_dsc_config *vdsc_cfg)
Bikeshedding, I think "check" is generally a poor verb in a function name.
intel_dsc_slice_dimensions_valid() or something like that?
Quoted 45 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +30
-0+{ +if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_RGB || + pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR444 ) { +if (vdsc_cfg->slice_height >4095 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <15000 ) +return -EINVAL ; + }else if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR420 ) { +if (!(vdsc_cfg->slice_width %2 )) +return -EINVAL ; +if (!(vdsc_cfg->slice_height %2 )) +return -EINVAL ; +if (vdsc_cfg->slice_height >4094 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <30000 ) +return -EINVAL ; + } + +return 0 ; +} +int intel_dsc_compute_params (struct intel_crtc_state *pipe_config) {struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);@@ -455,11 +478,20 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)u16 compressed_bpp = pipe_config->dsc.compressed_bpp;const struct rc_parameters *rc_params;struct rc_parameters *rc =NULL ; +int err;u8 i =0 ; vdsc_cfg->pic_width = pipe_config->hw.adjusted_mode.crtc_hdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); + + err =intel_dsc_check_slice_design_req (pipe_config, vdsc_cfg); + +if (err) { +drm_dbg_kms (&dev_priv->drm,"Slice design requirements not met\n" ); +return err; + } +/* * According to DSC 1.2 specs if colorspace is YCbCr then convert_rgb is 0 * else 1
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] [PATCH v6 6/9] drm/i915/vdsc: Check slice design requirement
Quoted 14 lines · Suraj Kandpal
Quoted 5 lines
Add function to check if slice design requirements are being met as defined in the below link section Slice Design Requirement
Just add this:
Bspec: 49259
and no URLs.
Ohkay got it
Quoted 15 lines
Quoted 15 lines
Signed-off-by Suraj Kandpal <[email protected]>--- drivers/gpu/drm/i915/display/intel_vdsc.c | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+)drivers/gpu/drm/i915/display/intel_vdsc.c +0
-0@@ -447,6 +447,29 @@ calculate_rc_params(struct rc_parameters *rc, } }
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_vdsc.c calculate_rc_params(struct rc_parameters *rc, · line 451
Quoted 2 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +2
-0+static int intel_dsc_check_slice_design_req (struct intel_crtc_state *pipe_config, +struct drm_dsc_config *vdsc_cfg)Bikeshedding, I think "check" is generally a poor verb in a function name.
intel_dsc_slice_dimensions_valid()or something like that?
Sure then ill go with intel_dsc_validate_slice_design
Regards,
Suraj Kandpal
Quoted 52 lines
drivers/gpu/drm/i915/display/intel_vdsc.c calculate_rc_params(struct rc_parameters *rc,
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +8
-0+{ +if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_RGB || + pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR444 ) { +if (vdsc_cfg->slice_height >4095 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <15000 ) +return -EINVAL ; + } else if (pipe_config->output_format ==
INTEL_OUTPUT_FORMAT_YCBCR420) {drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state
Quoted 16 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +13
-0+if (!(vdsc_cfg->slice_width %2 )) +return -EINVAL ; +if (!(vdsc_cfg->slice_height %2 )) +return -EINVAL ; +if (vdsc_cfg->slice_height >4094 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <30000 ) +return -EINVAL ; + } + +return 0 ; +} +int intel_dsc_compute_params (struct intel_crtc_state *pipe_config) {struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);@@ -455,11 +478,20 @@ int intel_dsc_compute_params(struct intel_crtc_state
*pipe_config)Quoted 4 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +1
-0u16 compressed_bpp = pipe_config->dsc.compressed_bpp;const struct rc_parameters *rc_params;struct rc_parameters *rc =NULL ; +int err;drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +5
-0u8 i =0 ; vdsc_cfg->pic_width = pipe_config->hw.adjusted_mode.crtc_hdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); + + err =intel_dsc_check_slice_design_req (pipe_config, vdsc_cfg); + +if (err) { + drm_dbg_kms(&dev_priv->drm, "Slice design requirements notmet\n");
drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) · line 497
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +3
-0+return err; + } +/* * According to DSC 1.2 specs if colorspace is YCbCr then convert_rgb is 0 * else 1 --
Jani Nikula, Intel Open Source Graphics Center
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v6 6/9] drm/i915/vdsc: Check slice design requirement
Quoted 32 lines · Suraj
Quoted 14 lines · Suraj Kandpal
Quoted 5 lines
Add function to check if slice design requirements are being met as defined in the below link section Slice Design Requirement
Just add this:
Bspec: 49259
and no URLs.
Ohkay got it
Quoted 15 lines
Quoted 15 lines
Signed-off-by Suraj Kandpal <[email protected]>--- drivers/gpu/drm/i915/display/intel_vdsc.c | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+)drivers/gpu/drm/i915/display/intel_vdsc.c +0
-0@@ -447,6 +447,29 @@ calculate_rc_params(struct rc_parameters *rc, } }
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_vdsc.c calculate_rc_params(struct rc_parameters *rc, · line 451
Quoted 2 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +2
-0+static int intel_dsc_check_slice_design_req (struct intel_crtc_state *pipe_config, +struct drm_dsc_config *vdsc_cfg)Bikeshedding, I think "check" is generally a poor verb in a function name.
intel_dsc_slice_dimensions_valid()or something like that?Sure then ill go with
intel_dsc_validate_slice_design
I'm often considering function names from the caller perspective. Say it out loud, wonder what it sounds like the function is doing, and what it returns.
intel_dsc_slice_dimensions_valid() is a predicate function that returns true or false. Either the slice dimensions are valid or not.
Also, "slice design" is incomprehensible to anyone who hasn't read the bspec. I had to look it up before I understood what this was about. And it's just the dimensions that are being checked.
BR,
Jani.
Quoted 55 lines
Regards,
Suraj KandpalQuoted 52 lines
drivers/gpu/drm/i915/display/intel_vdsc.c calculate_rc_params(struct rc_parameters *rc,
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +8
-0+{ +if (pipe_config->output_format ==INTEL_OUTPUT_FORMAT_RGB || + pipe_config->output_format ==INTEL_OUTPUT_FORMAT_YCBCR444 ) { +if (vdsc_cfg->slice_height >4095 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <15000 ) +return -EINVAL ; + } else if (pipe_config->output_format ==
INTEL_OUTPUT_FORMAT_YCBCR420) {drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state
Quoted 16 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +13
-0+if (!(vdsc_cfg->slice_width %2 )) +return -EINVAL ; +if (!(vdsc_cfg->slice_height %2 )) +return -EINVAL ; +if (vdsc_cfg->slice_height >4094 ) +return -EINVAL ; +if (vdsc_cfg->slice_height * vdsc_cfg->slice_width <30000 ) +return -EINVAL ; + } + +return 0 ; +} +int intel_dsc_compute_params (struct intel_crtc_state *pipe_config) {struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);@@ -455,11 +478,20 @@ int intel_dsc_compute_params(struct intel_crtc_state
*pipe_config)Quoted 4 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +1
-0u16 compressed_bpp = pipe_config->dsc.compressed_bpp;const struct rc_parameters *rc_params;struct rc_parameters *rc =NULL ; +int err;drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +5
-0u8 i =0 ; vdsc_cfg->pic_width = pipe_config->hw.adjusted_mode.crtc_hdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); + + err =intel_dsc_check_slice_design_req (pipe_config, vdsc_cfg); + +if (err) { + drm_dbg_kms(&dev_priv->drm, "Slice design requirements notmet\n");
drivers/gpu/drm/i915/display/intel_vdsc.c int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) · line 497
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +3
-0+return err; + } +/* * According to DSC 1.2 specs if colorspace is YCbCr then convert_rgb is 0 * else 1 --
Jani Nikula, Intel Open Source Graphics Center
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
PATCH v6 7/9 drm/i915/dsc: Add debugfs entry to validate DSC YCbCr420
In reply to Suraj KandpalFrom: Swati Sharma <[email protected]>
DSC_YCBCR420_Sink_Support entry is added to i915_dsc_fec_support_show to depict if sink supports DSC YCbCr420.
Also, new debugfs entry is created to enforce YCbCr420 output format. This is required because of our driver policy.
If a mode is supported in both RGB and YCbCr420 output formats by the sink, our policy is to try RGB first and fall back to YCbCr420, if mode cannot be shown using RGB. So, to test YCbCr420, we need a debugfs entry (force_dsc_ycbcr420) to force thisoutput format; so that YCbCr420 code gets executed.
--- .../drm/i915/display/intel_display_debugfs.c | 85 +++++++++++++++++++ .../drm/i915/display/intel_display_types.h | 1 + 2 files changed, 86 insertions(+)
drivers/gpu/drm/i915/display/intel_display_debugfs.c +85 -0
@@ -1772,6 +1772,9 @@ static int i915_dsc_fec_support_show(struct seq_file *m, void *data) str_yes_no(drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd)));seq_printf (m,"Force_DSC_Enable: %s\n" ,str_yes_no (intel_dp->force_dsc_en)); +seq_printf (m,"DSC_YCBCR420_Sink_Support: %s\n" , +str_yes_no (drm_dp_dsc_sink_supports_format (intel_dp->dsc_dpcd, + DP_DSC_YCbCr420_Native)));if (!intel_dp_is_edp (intel_dp))seq_printf (m,"FEC_Sink_Support: %s\n" ,str_yes_no (drm_dp_sink_supports_fec (intel_dp->fec_capable)));
@@ -1895,6 +1898,85 @@ static const struct file_operations i915_dsc_bpc_fops = { .write = i915_dsc_bpc_write }; +static int i915_dsc_ycbcr420_show (struct seq_file *m,void *data) +{ +struct drm_connector *connector = m->private; +struct drm_device *dev = connector->dev; +struct drm_crtc *crtc; +struct intel_dp *intel_dp; +struct intel_crtc_state *crtc_state; +struct intel_encoder *encoder =intel_attached_encoder (to_intel_connector (connector)); +int ret; + +if (!encoder) +return -ENODEV ; + + ret =drm_modeset_lock_single_interruptible (&dev->mode_config.connection_mutex); +if (ret) +return ret; + + crtc = connector->state->crtc; +if (connector->status != connector_status_connected || !crtc) { + ret = -ENODEV ; + goto out; + } + + intel_dp =intel_attached_dp (to_intel_connector (connector)); + crtc_state =to_intel_crtc_state (crtc->state); +seq_printf (m,"Force_DSC_YCBCR420_Enable: %s\n" , +str_yes_no (intel_dp->force_dsc_ycbcr420_en)); + +out:drm_modeset_unlock (&dev->mode_config.connection_mutex); + +return ret; +} + +static ssize_t i915_dsc_ycbcr420_write (struct file *file, +const char __user *ubuf, +size_t len,loff_t *offp) +{ +struct drm_connector *connector = + ((struct seq_file *)file->private_data)->private; +struct intel_encoder *encoder =intel_attached_encoder (to_intel_connector (connector)); +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct intel_dp *intel_dp =enc_to_intel_dp (encoder); +bool dsc_ycbcr420_enable = false; +int ret; + +if (len ==0 ) +return 0 ; + +drm_dbg (&i915->drm, +"Copied %zu bytes from user to force YCBCR420 for DSC\n" , len); + + ret =kstrtobool_from_user (ubuf, len, &dsc_ycbcr420_enable); +if (ret <0 ) +return ret; + +drm_dbg (&i915->drm,"Got %s for DSC YCBCR420 Enable\n" , + (dsc_ycbcr420_enable) ?"true" :"false" ); + intel_dp->force_dsc_ycbcr420_en = dsc_ycbcr420_enable; + + *offp += len; + +return len; +} + +static int i915_dsc_ycbcr420_open (struct inode *inode, +struct file *file) +{ +return single_open (file, i915_dsc_ycbcr420_show, inode->i_private); +} + +static const struct file_operations i915_dsc_ycbcr420_fops = { + .owner =THIS_MODULE , + .open = i915_dsc_ycbcr420_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = i915_dsc_ycbcr420_write +}; +/* * Returns the Current CRTC's bpc. * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
@@ -1966,6 +2048,9 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector)debugfs_create_file ("i915_dsc_bpc" ,0644 , root, connector, &i915_dsc_bpc_fops); + +debugfs_create_file ("i915_dsc_ycbcr420" ,0644 , root, + connector, &i915_dsc_ycbcr420_fops); } if (connector->connector_type == DRM_MODE_CONNECTOR_DSI ||
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
@@ -1737,6 +1737,7 @@ struct intel_dp {/* Display stream compression testing */ bool force_dsc_en; +bool force_dsc_ycbcr420_en;int force_dsc_bpc;bool hobl_failed;
Signature · 1 line
2.25.1
PATCH v6 8/9 drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from debugfs
In reply to Suraj KandpalFrom: Swati Sharma <[email protected]>
If force_dsc_ycbcr420_en is set through debugfs allow DSC iff output_format is INTEL_OUTPUT_FORMAT_YCBCR420.
--- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +4 -0
@@ -1528,6 +1528,10 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,if (!intel_dp_dsc_supports_format (intel_dp, pipe_config->output_format))return -EINVAL ; +if (intel_dp->force_dsc_ycbcr420_en && + pipe_config->output_format !=INTEL_OUTPUT_FORMAT_YCBCR420 ) +return -EINVAL ; +if (compute_pipe_bpp) pipe_bpp =intel_dp_dsc_compute_bpp (intel_dp, conn_state->max_requested_bpc);else
Signature · 1 line
2.25.1
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH v6 8/9] drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from debugfs
Quoted 4 lines · Suraj Kandpal
From: Swati Sharma <[email protected]>
If
force_dsc_ycbcr420_enis set through debugfs allow DSC iffoutput_formatisINTEL_OUTPUT_FORMAT_YCBCR420.
Squash this with the previous patch.
Quoted 11 lines
Signed-off-by Swati Sharma <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/i915/display/intel_dp.c +0
-0
drivers/gpu/drm/i915/display/intel_dp.c int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 1533
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-0@@ -1528,6 +1528,10 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,if (!intel_dp_dsc_supports_format (intel_dp, pipe_config->output_format))return -EINVAL ; +if (intel_dp->force_dsc_ycbcr420_en && + pipe_config->output_format !=INTEL_OUTPUT_FORMAT_YCBCR420 ) +return -EINVAL ;
It would be more generally useful, and perhaps even cleaner to implement, to force the output format, as in *any* output format, instead of having a specific force_dsc_ycbcr420_en.
BR,
Jani.
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp.c +1
-0+if (compute_pipe_bpp) pipe_bpp =intel_dp_dsc_compute_bpp (intel_dp, conn_state->max_requested_bpc);else
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] [PATCH v6 8/9] drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from debugfs
Hi Jani,
Thanks for the review.
Have floated https://patchwork.freedesktop.org/patch/521301/
addressing your review comments.
Corresponding IGT https://patchwork.freedesktop.org/series/113253/
Quoted 39 lines · Jani Nikula
Quoted 4 lines · Suraj Kandpal
From: Swati Sharma <[email protected]>
If
force_dsc_ycbcr420_enis set through debugfs allow DSC iffoutput_formatisINTEL_OUTPUT_FORMAT_YCBCR420.Squash this with the previous patch.
Quoted 11 lines
Signed-off-by Swati Sharma <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/i915/display/intel_dp.c +0
-0drivers/gpu/drm/i915/display/intel_dp.c int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 1533
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-0@@ -1528,6 +1528,10 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,if (!intel_dp_dsc_supports_format (intel_dp, pipe_config->output_format))return -EINVAL ; +if (intel_dp->force_dsc_ycbcr420_en && + pipe_config->output_format !=INTEL_OUTPUT_FORMAT_YCBCR420 ) +return -EINVAL ;It would be more generally useful, and perhaps even cleaner to implement, to force the output format, as in *any* output format, instead of having a specific
force_dsc_ycbcr420_en.BR,
Jani.Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp.c +1
-0+if (compute_pipe_bpp) pipe_bpp =intel_dp_dsc_compute_bpp (intel_dp, conn_state->max_requested_bpc);else
Signature · 1 line
~Swati Sharma
PATCH v6 9/9 drm/i915: Code styling fixes
In reply to Suraj KandpalFrom: Swati Sharma <[email protected]>
Removed extra newlines and did few styling fixes.
--- drivers/gpu/drm/i915/display/intel_display_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display_debugfs.c +3 -3
@@ -1440,7 +1440,6 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,return len; } -static ssize_t pri_wm_latency_write (struct file *file,const char __user *ubuf,size_t len,loff_t *offp) {
@@ -1790,13 +1789,13 @@ static ssize_t i915_dsc_fec_support_write(struct file *file,const char __user *ubuf, size_t len, loff_t *offp) { - bool dsc_enable = false; -int ret; struct drm_connector *connector = ((struct seq_file *)file->private_data)->private;struct intel_encoder *encoder =intel_attached_encoder (to_intel_connector (connector));struct drm_i915_private *i915 =to_i915 (encoder->base.dev);struct intel_dp *intel_dp =enc_to_intel_dp (encoder); +bool dsc_enable = false; +int ret;if (len ==0 )return 0 ;
@@ -1813,6 +1812,7 @@ static ssize_t i915_dsc_fec_support_write(struct file *file, intel_dp->force_dsc_en = dsc_enable; *offp += len; +return len; }
Signature · 1 line
2.25.1
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Enable YCbCr420 for VDSC
In reply to Suraj Kandpal== Series Details ==
== Series Details ==
Series: Enable YCbCr420 for VDSC
URL : https://patchwork.freedesktop.org/series/112653/
State : warning
== Summary ==
Error: dim checkpatch failed85568f88bfda drm/dp_helper: Add helper to check if the sink supports given format with DSC 27809b830b41 drm/i915/dp: Check if DSC supports the given output_format e8489066645a drm/i915: Adding the new registers for DSCd3bd463de8e6 drm/i915: Enable YCbCr420 for VDSC
-:189: CHECK:MACRO_ARG_REUSE: Macro argument reuse '_row' - possible side-effects? #189: FILE: drivers/gpu/drm/i915/display/intel_qp_tables.c:447:
+#define PARAM_TABLE(_minmax, _bpc, _row, _col, _is_420) do { \
+ if (bpc == (_bpc)) { \
+ if (_is_420) \
+ return rc_range_##_minmax##qp420_##_bpc##bpc[_row][_col]; \
+ else \
+ return rc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \
+ } \
} while (0)
-:189: CHECK:MACRO_ARG_REUSE: Macro argument reuse '_col' - possible side-effects? #189: FILE: drivers/gpu/drm/i915/display/intel_qp_tables.c:447:
+#define PARAM_TABLE(_minmax, _bpc, _row, _col, _is_420) do { \
+ if (bpc == (_bpc)) { \
+ if (_is_420) \
+ return rc_range_##_minmax##qp420_##_bpc##bpc[_row][_col]; \
+ else \
+ return rc_range_##_minmax##qp444_##_bpc##bpc[_row][_col]; \
+ } \
} while (0)
total: 0 errors, 0 warnings, 2 checks, 228 lines checked80c563b9d7ed drm/i915: Fill in native_420 fielda91b0a3a0007 drm/i915/vdsc: Check slice design requirementd87c707ecc91 drm/i915/dsc: Add debugfs entry to validate DSC YCbCr420 0c5d3e56ee18 drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from debugfs bff82d7524b7 drm/i915: Code styling fixes
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for Enable YCbCr420 for VDSC
In reply to Suraj Kandpal== Series Details ==
== Series Details ==
Series: Enable YCbCr420 for VDSC
URL : https://patchwork.freedesktop.org/series/112653/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12571 -> Patchwork_112653v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_112653v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_112653v1, please notify your bug team 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_112653v1/index.html
Participating hosts (39 -> 39)
------------------------------
Additional (2): fi-bsw-kefka bat-atsm-1
Missing (2): bat-dg2-oem1 fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_112653v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gem_contexts:
- fi-bsw-kefka: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-bsw-kefka/igt@i915_selftest@live@gem_contexts.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_module_load@load:
- {bat-atsm-1}: NOTRUN -> [INCOMPLETE][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/bat-atsm-1/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_112653v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- fi-rkl-11600: NOTRUN -> [SKIP][3] ([i915#7828])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-rkl-11600/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: NOTRUN -> [FAIL][4] ([i915#6298])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
* igt@prime_vgem@basic-fence-flip:
- fi-bsw-kefka: NOTRUN -> [SKIP][5] ([fdo#109271]) +25 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-bsw-kefka/igt@[email protected]
* igt@runner@aborted:
- fi-bsw-kefka: NOTRUN -> [FAIL][6] ([fdo#109271] / [i915#4312])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-bsw-kefka/igt@[email protected]
#### Possible fixes ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-rkl-11600: [INCOMPLETE][7] ([i915#4817]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12571/fi-rkl-11600/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/fi-rkl-11600/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
Build changes
-------------
* Linux: CI_DRM_12571 -> Patchwork_112653v1
CI-20190529: 20190529
CI_DRM_12571: a88eac130876610470adb06548944e27982acfb4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7115: c162d70b00c6f4cf6a0ba1ca7a7e2ad8f7190646 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_112653v1: a88eac130876610470adb06548944e27982acfb4 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
bd58a900479b drm/i915: Code styling fixes321b4ab9874f drm/i915/dsc: Allow DSC only with YCbCr420 format when forced from debugfs 02eda18b683c drm/i915/dsc: Add debugfs entry to validate DSC YCbCr420 90397aa284e2 drm/i915/vdsc: Check slice design requirementa1fa6e6ade1f drm/i915: Fill in native_420 field9fb82a112946 drm/i915: Enable YCbCr420 for VDSC873e0df9f570 drm/i915: Adding the new registers for DSC077ebdf634e2 drm/i915/dp: Check if DSC supports the given output_format 0d5026bea07e drm/dp_helper: Add helper to check if the sink supports given format with DSC
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_112653v1/index.html