drm/i915/dsi: enable DSC
Subsystems (3)
PATCH v4 1/15 drm/i915/bios: pass devdata to parse_ddi_port
In reply to Jani NikulaAllow accessing the parent structure later on. Drop const for allowing future modification as well.
--- drivers/gpu/drm/i915/display/intel_bios.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +4 -3
@@ -1554,9 +1554,10 @@ static enum port dvo_port_to_port(u8 dvo_port) }static void parse_ddi_port (struct drm_i915_private *dev_priv, -const struct child_device_config *child, +struct display_device_data *devdata,u8 bdb_version) { +const struct child_device_config *child = &devdata->child;struct ddi_vbt_port_info *info;bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;enum port port;
@@ -1708,7 +1709,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,static void parse_ddi_ports (struct drm_i915_private *dev_priv,u8 bdb_version) { -const struct display_device_data *devdata; +struct display_device_data *devdata;if (!HAS_DDI (dev_priv) && !IS_CHERRYVIEW (dev_priv))return ;
@@ -1717,7 +1718,7 @@ static void parse_ddi_ports(struct drm_i915_private *dev_priv, u8 bdb_version)return ;list_for_each_entry (devdata, &dev_priv->vbt.display_devices, node) -parse_ddi_port (dev_priv, &devdata->child, bdb_version); +parse_ddi_port (dev_priv, devdata, bdb_version); } static void
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
v4 cover drm/i915/dsi: enable DSC
v4 of https://patchwork.freedesktop.org/series/69540/
Added patches 7 and 14 (by Vandita) to improve state checking. We may still need to improve the checks for horizontal timings due to potential round-trip errors, but we're progressing. Otherwise mostly unchanged from v3.
BR,
Jani.
Jani Nikula (14):
drm/i915/bios: pass devdata to parse_ddi_port drm/i915/bios: parse compression parameters block drm/i915/bios: add support for querying DSC details for encoder drm/i915/dsc: move DP specific compute params to intel_dp.c drm/i915/dsc: move slice height calculation to encoder drm/i915/dsc: add support for computing and writing PPS for DSI
encoders
drm/i915/dsc: add basic hardware state readout support drm/i915/dsi: set pipe_bpp on ICL configure config drm/i915/dsi: abstract afe_clk calculation drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate() drm/i915/dsi: take compression into account in afe_clk() drm/i915/dsi: use compressed pixel format with DSC drm/i915/dsi: account for DSC in horizontal timings drm/i915/dsi: add support for DSC
Vandita Kulkarni (1):
drm/i915/dsi: Fix state mismatch warns for horizontal timings with DSC
drivers/gpu/drm/i915/display/icl_dsi.c | 198 ++++++++++++++---- drivers/gpu/drm/i915/display/intel_bios.c | 167 ++++++++++++++- drivers/gpu/drm/i915/display/intel_bios.h | 5 + drivers/gpu/drm/i915/display/intel_ddi.c | 2 + drivers/gpu/drm/i915/display/intel_display.c | 4 + drivers/gpu/drm/i915/display/intel_dp.c | 59 +++++- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 2 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 120 +++++------ drivers/gpu/drm/i915/display/intel_vdsc.h | 2 + 9 files changed, 451 insertions(+), 108 deletions(-)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 2/15 drm/i915/bios: parse compression parameters block
Check for child devices that specify compression, and store the device specific compression parameters in the display device data struct for later use. Warn if compression is requested but not available.
Use fairly rigid checks for compression data for starters. These can be made more dynamic later.
Log about DSC presence in DDI port parse, though this is not universal across platforms or port types (DSI).
v2: amended debug logging
Bspec: 29885
--- drivers/gpu/drm/i915/display/intel_bios.c | 61 ++++++++++++++++++- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 2 +- 2 files changed, 60 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +59 -2
@@ -61,6 +61,7 @@/* Wrapper for VBT child device config */ struct display_device_data {struct child_device_config child; +struct dsc_compression_parameters_entry *dsc;struct list_head node; };
@@ -1366,6 +1367,57 @@ parse_mipi_sequence(struct drm_i915_private *dev_priv,memset (dev_priv->vbt.dsi.sequence,0 ,sizeof (dev_priv->vbt.dsi.sequence)); } +static void +parse_compression_parameters (struct drm_i915_private *i915, +const struct bdb_header *bdb) +{ +const struct bdb_compression_parameters *params; +struct display_device_data *devdata; +const struct child_device_config *child; +u16 block_size; +int index; + +if (bdb->version <198 ) +return ; + + params =find_section (bdb,BDB_COMPRESSION_PARAMETERS ); +if (params) { +/* Sanity checks */ +if (params->entry_size !=sizeof (params->data[0 ])) { +DRM_DEBUG_KMS ("VBT: unsupported compression param entry size\n" ); +return ; + } + + block_size =get_blocksize (params); +if (block_size <sizeof (*params)) { +DRM_DEBUG_KMS ("VBT: expected 16 compression param entries\n" ); +return ; + } + } + +list_for_each_entry (devdata, &i915->vbt.display_devices, node) { + child = &devdata->child; + +if (!child->compression_enable) +continue ; + +if (!params) { +DRM_DEBUG_KMS ("VBT: compression params not available\n" ); +continue ; + } + +if (child->compression_method_cps) { +DRM_DEBUG_KMS ("VBT: CPS compression not supported\n" ); +continue ; + } + + index = child->compression_structure_index; + + devdata->dsc =kmemdup (¶ms->data[index], +sizeof (*devdata->dsc),GFP_KERNEL ); + } +} +static u8 translate_iboost (u8 val) {static const u8 mapping[] = {1 ,3 ,7 };/* See VBT spec */
@@ -1598,10 +1650,11 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,if (bdb_version >=209 ) info->supports_tbt = child->tbt; -DRM_DEBUG_KMS ("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d\n" , +DRM_DEBUG_KMS ("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d DSC:%d\n" ,port_name (port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,HAS_LSPCON (dev_priv) && child->lspcon, - info->supports_typec_usb, info->supports_tbt); + info->supports_typec_usb, info->supports_tbt, + devdata->dsc !=NULL );if (is_edp && is_dvi) DRM_DEBUG_KMS("Internal DP port %c is TMDS compatible\n",
@@ -2037,6 +2090,9 @@ void intel_bios_init(struct drm_i915_private *dev_priv)parse_mipi_config (dev_priv, bdb);parse_mipi_sequence (dev_priv, bdb); +/* Depends on child device list */ +parse_compression_parameters (dev_priv, bdb); +/* Further processing on pre-parsed data */ parse_sdvo_device_mapping (dev_priv, bdb->version);parse_ddi_ports (dev_priv, bdb->version);
@@ -2060,6 +2116,7 @@ void intel_bios_driver_remove(struct drm_i915_private *dev_priv)list_for_each_entry_safe (devdata, n, &dev_priv->vbt.display_devices, node) {list_del (&devdata->node); +kfree (devdata->dsc);kfree (devdata); }
drivers/gpu/drm/i915/display/intel_vbt_defs.h +1 -1
@@ -369,7 +369,7 @@ struct child_device_config {u16 dtd_buf_ptr;/* 161 */ u8 edidless_efp:1; /* 161 */ u8 compression_enable:1; /* 198 */ - u8 compression_method:1; /* 198 */ + u8 compression_method_cps:1; /* 198 */ u8 ganged_edp:1; /* 202 */ u8 reserved0:4; u8 compression_structure_index:4; /* 198 */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 3/15 drm/i915/bios: add support for querying DSC details for encoder
In reply to Jani NikulaAdd function for retrieving the DSC data for an encoder.
Initially, this is DSI specific, as DP does not use VBT settings for DSC at all. It's also not very pretty.
In the future we might have a pointer from encoder to the child device, which would make the child device list query here so much more sensible.
v3:
- use crtc_state instead of pipe_config
- return true by default from intel_bios_get_dsc_params()
- expand the comment about rc_buffer_block_size and rc_buffer_size
v2:
- make more robust, debug log errors better
Bspec: 29885
--- drivers/gpu/drm/i915/display/intel_bios.c | 99 +++++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_bios.h | 5 ++ 2 files changed, 104 insertions(+)
drivers/gpu/drm/i915/display/intel_bios.c +99 -0
@@ -29,6 +29,7 @@#include <drm/i915_drm.h> #include "display/intel_display.h" +#include "display/intel_display_types.h" #include "display/intel_gmbus.h" #include "i915_drv.h"
@@ -2394,6 +2395,104 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,return false; } +static void fill_dsc (struct intel_crtc_state *crtc_state, +struct dsc_compression_parameters_entry *dsc, +int dsc_max_bpc) +{ +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +int bpc =8 ; + + vdsc_cfg->dsc_version_major = dsc->version_major; + vdsc_cfg->dsc_version_minor = dsc->version_minor; + +if (dsc->support_12bpc && dsc_max_bpc >=12 ) + bpc =12 ; +else if (dsc->support_10bpc && dsc_max_bpc >=10 ) + bpc =10 ; +else if (dsc->support_8bpc && dsc_max_bpc >=8 ) + bpc =8 ; +else +DRM_DEBUG_KMS ("VBT: Unsupported BPC %d for DCS\n" , + dsc_max_bpc); + + crtc_state->pipe_bpp = bpc *3 ; + + crtc_state->dsc.compressed_bpp =min (crtc_state->pipe_bpp, +VBT_DSC_MAX_BPP (dsc->max_bpp)); + +/* +* FIXME: This is ugly, and slice count should take DSC engine +* throughput etc. into account. +* +* Also, per spec DSI supports 1, 2, 3 or 4 horizontal slices. +*/ +if (dsc->slices_per_line &BIT (2 )) { + crtc_state->dsc.slice_count =4 ; + }else if (dsc->slices_per_line &BIT (1 )) { + crtc_state->dsc.slice_count =2 ; + }else { +/* FIXME */ +if (!(dsc->slices_per_line &BIT (0 ))) +DRM_DEBUG_KMS ("VBT: Unsupported DSC slice count for DSI\n" ); + + crtc_state->dsc.slice_count =1 ; + } + +if (crtc_state->hw.adjusted_mode.crtc_hdisplay % + crtc_state->dsc.slice_count !=0 ) +DRM_DEBUG_KMS ("VBT: DSC hdisplay %d not divisible by slice count %d\n" , + crtc_state->hw.adjusted_mode.crtc_hdisplay, + crtc_state->dsc.slice_count); + +/* +* FIXME: Use VBT rc_buffer_block_size and rc_buffer_size for the +* implementation specific physical rate buffer size. Currently we use +* the required rate buffer model size calculated in +* drm_dsc_compute_rc_parameters() according to VESA DSC Annex E. +* +* The VBT rc_buffer_block_size and rc_buffer_size definitions +* correspond to DP 1.4 DPCD offsets 0x62 and 0x63. The DP DSC +* implementation should also use the DPCD (or perhaps VBT for eDP) +* provided value for the buffer size. +*/ + +/* FIXME: DSI spec says bpc + 1 for this one */ + vdsc_cfg->line_buf_depth =VBT_DSC_LINE_BUFFER_DEPTH (dsc->line_buffer_depth); + + vdsc_cfg->block_pred_enable = dsc->block_prediction_enable; + + vdsc_cfg->slice_height = dsc->slice_height; +} + +/* FIXME: initially DSI specific */ +bool intel_bios_get_dsc_params (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state, +int dsc_max_bpc) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +const struct display_device_data *devdata; +const struct child_device_config *child; + +list_for_each_entry (devdata, &i915->vbt.display_devices, node) { + child = &devdata->child; + +if (!(child->device_type &DEVICE_TYPE_MIPI_OUTPUT )) +continue ; + +if (child->dvo_port -DVO_PORT_MIPIA == encoder->port) { +if (!devdata->dsc) +return false; + +if (crtc_state) +fill_dsc (crtc_state, devdata->dsc, dsc_max_bpc); + +return true; + } + } + +return false; +} +/** * intel_bios_is_port_hpd_inverted - is HPD inverted for %port * @i915: i915 device instance
drivers/gpu/drm/i915/display/intel_bios.h +5 -0
@@ -35,6 +35,8 @@#include <drm/i915_drm.h> struct drm_i915_private ; +struct intel_crtc_state ; +struct intel_encoder ;enum port ;enum intel_backlight_type {
@@ -242,5 +244,8 @@ bool intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,bool intel_bios_is_lspcon_present (const struct drm_i915_private *i915,enum port port);enum aux_ch intel_bios_port_aux_ch (struct drm_i915_private *dev_priv,enum port port); +bool intel_bios_get_dsc_params (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state, +int dsc_max_bpc);#endif /* _INTEL_BIOS_H_ */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 4/15 drm/i915/dsc: move DP specific compute params to intel_dp.c
In reply to Jani NikulaTurns out future DSI specific parameters aren't workable with the approach of having the encoder specific functions in intel_vdsc.c. Make intel_dsc_compute_params() a helper that does the encoder independent parts, and have encoder code call it. Move intel_dsc_dp_compute_params() to intel_dp.c as intel_dp_dsc_compute_params().
No functional changes.
v2: Rename pipe_config to crtc_state while at it.
--- drivers/gpu/drm/i915/display/intel_dp.c | 47 +++++++++++++++++++++- drivers/gpu/drm/i915/display/intel_vdsc.c | 48 +---------------------- 2 files changed, 47 insertions(+), 48 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +46 -1
@@ -2046,6 +2046,51 @@ static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 dsc_max_bpc)return 0 ; } +#define DSC_SUPPORTED_VERSION_MIN 1 + +static int intel_dp_dsc_compute_params (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +u8 line_buf_depth; +int ret; + + ret =intel_dsc_compute_params (encoder, crtc_state); +if (ret) +return ret; + + vdsc_cfg->dsc_version_major = + (intel_dp->dsc_dpcd[DP_DSC_REV -DP_DSC_SUPPORT ] & +DP_DSC_MAJOR_MASK ) >>DP_DSC_MAJOR_SHIFT ; + vdsc_cfg->dsc_version_minor = +min (DSC_SUPPORTED_VERSION_MIN , + (intel_dp->dsc_dpcd[DP_DSC_REV -DP_DSC_SUPPORT ] & +DP_DSC_MINOR_MASK ) >>DP_DSC_MINOR_SHIFT ); + + 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_DEBUG_KMS ("DSC Sink Line Buffer Depth invalid\n" ); +return -EINVAL ; + } + +if (vdsc_cfg->dsc_version_minor ==2 ) + vdsc_cfg->line_buf_depth = (line_buf_depth ==DSC_1_2_MAX_LINEBUF_DEPTH_BITS ) ? +DSC_1_2_MAX_LINEBUF_DEPTH_VAL : line_buf_depth; +else + vdsc_cfg->line_buf_depth = (line_buf_depth >DSC_1_1_MAX_LINEBUF_DEPTH_BITS ) ? +DSC_1_1_MAX_LINEBUF_DEPTH_BITS : line_buf_depth; + + vdsc_cfg->block_pred_enable = + intel_dp->dsc_dpcd[DP_DSC_BLK_PREDICTION_SUPPORT -DP_DSC_SUPPORT ] & +DP_DSC_BLK_PREDICTION_IS_SUPPORTED ; + +return drm_dsc_compute_rc_parameters (vdsc_cfg); +} + static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state,
@@ -2132,7 +2177,7 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, } } - ret =intel_dsc_compute_params (&dig_port->base, pipe_config); + ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);if (ret <0 ) { DRM_DEBUG_KMS("Cannot compute valid DSC parameters for Input Bpp = %d " "Compressed BPP = %d\n",
drivers/gpu/drm/i915/display/intel_vdsc.c +1 -47
72 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 6/15 drm/i915/dsc: add support for computing and writing PPS for DSI encoders
In reply to Jani NikulaAdd DSI specific computation and transmission to display of PPS.
With hopes that this approach will work for both DP and DSI encoders.
--- drivers/gpu/drm/i915/display/intel_vdsc.c | 25 ++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_vdsc.c +24 -1
@@ -10,6 +10,7 @@#include "i915_drv.h" #include "intel_display_types.h" +#include "intel_dsi.h" #include "intel_vdsc.h" enum ROW_INDEX_BPP {
@@ -844,6 +845,25 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } +static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) +{ +const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); +struct mipi_dsi_device *dsi; +struct drm_dsc_picture_parameter_set pps; +enum port port; + +drm_dsc_pps_payload_pack (&pps, vdsc_cfg); + +for_each_dsi_port (port, intel_dsi->ports) { + dsi = intel_dsi->dsi_hosts[port]->device; + +mipi_dsi_picture_parameter_set (dsi, &pps); +mipi_dsi_compression_mode (dsi, true); + } +} +static void intel_dsc_dp_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {
@@ -882,7 +902,10 @@ void intel_dsc_enable(struct intel_encoder *encoder,intel_dsc_pps_configure (encoder, crtc_state); -intel_dsc_dp_pps_write (encoder, crtc_state); +if (encoder->type ==INTEL_OUTPUT_DSI ) +intel_dsc_dsi_pps_write (encoder, crtc_state); +else +intel_dsc_dp_pps_write (encoder, crtc_state);if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) { dss_ctl1_reg =DSS_CTL1 ;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 5/15 drm/i915/dsc: move slice height calculation to encoder
In reply to Jani NikulaTurns out this isn't compatible with DSI, where we use the value from VBT. No functional changes.
--- drivers/gpu/drm/i915/display/intel_dp.c | 12 ++++++++++++ drivers/gpu/drm/i915/display/intel_vdsc.c | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +12 -0
@@ -2060,6 +2060,18 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,if (ret)return ret; +/* +* Slice Height of 8 works for all currently available panels. So start +* with that if pic_height is an integral multiple of 8. Eventually add +* logic to try multiple slice heights. +*/ +if (vdsc_cfg->pic_height %8 ==0 ) + vdsc_cfg->slice_height =8 ; +else if (vdsc_cfg->pic_height %4 ==0 ) + vdsc_cfg->slice_height =4 ; +else + vdsc_cfg->slice_height =2 ; + vdsc_cfg->dsc_version_major = (intel_dp->dsc_dpcd[DP_DSC_REV -DP_DSC_SUPPORT ] &DP_DSC_MAJOR_MASK ) >>DP_DSC_MAJOR_SHIFT ;
drivers/gpu/drm/i915/display/intel_vdsc.c +0 -11
@@ -345,17 +345,6 @@ int intel_dsc_compute_params(struct intel_encoder *encoder, vdsc_cfg->pic_height = pipe_config->hw.adjusted_mode.crtc_vdisplay; vdsc_cfg->slice_width =DIV_ROUND_UP (vdsc_cfg->pic_width, pipe_config->dsc.slice_count); -/* -* Slice Height of 8 works for all currently available panels. So start -* with that if pic_height is an integral multiple of 8. -* Eventually add logic to try multiple slice heights. -*/ -if (vdsc_cfg->pic_height %8 ==0 ) - vdsc_cfg->slice_height =8 ; -else if (vdsc_cfg->pic_height %4 ==0 ) - vdsc_cfg->slice_height =4 ; -else - vdsc_cfg->slice_height =2 ;/* Gen 11 does not support YCbCr */ vdsc_cfg->simple_422 = false;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 9/15 drm/i915/dsi: abstract afe_clk calculation
In reply to Jani NikulaWe'll make more use of it in the future.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +13 -5
@@ -301,18 +301,26 @@ static void configure_dual_link_mode(struct intel_encoder *encoder,I915_WRITE (DSS_CTL1 , dss_ctl1); } +/* aka DSI 8X clock */ +static int afe_clk (struct intel_encoder *encoder) +{ +struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); +int bpp; + + bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format); + +return DIV_ROUND_CLOSEST (intel_dsi->pclk * bpp, intel_dsi->lane_count); +} +static void gen11_dsi_program_esc_clk_div (struct intel_encoder *encoder) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port; -u32 bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format); -u32 afe_clk_khz;/* 8X Clock */ +int afe_clk_khz;u32 esc_clk_div_m; - afe_clk_khz =DIV_ROUND_CLOSEST (intel_dsi->pclk * bpp, - intel_dsi->lane_count); - + afe_clk_khz =afe_clk (encoder); esc_clk_div_m =DIV_ROUND_UP (afe_clk_khz,DSI_MAX_ESC_CLK );for_each_dsi_port (port, intel_dsi->ports) {
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 10/15 drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate()
In reply to Jani NikulaWe'll be expanding afe_clk() to take DSC into account. Switch to using it where DSC matters. Which is really everywhere that intel_dsi_bitrate() is currently used in ICL DSI code.
The functional difference is that we round the result closest instead of down.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +4 -4
@@ -539,7 +539,7 @@ static void gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder)* leave all fields at HW default values. */ if (IS_GEN (dev_priv,11 )) { -if (intel_dsi_bitrate (intel_dsi) <=800000 ) { +if (afe_clk (encoder) <=800000 ) {for_each_dsi_port (port, intel_dsi->ports) { tmp =I915_READ (DPHY_TA_TIMING_PARAM (port)); tmp &= ~TA_SURE_MASK ;
@@ -649,7 +649,7 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder, tmp |=EOTP_DISABLED ;/* enable link calibration if freq > 1.5Gbps */ -if (intel_dsi_bitrate (intel_dsi) >=1500 *1000 ) { +if (afe_clk (encoder) >=1500 *1000 ) { tmp &= ~LINK_CALIBRATION_MASK ; tmp |=CALIBRATION_ENABLED_INITIAL_ONLY ; }
@@ -930,7 +930,7 @@ static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder)* TIME_NS = (BYTE_CLK_COUNT * 8 * 10^6)/ Bitrate * ESCAPE_CLK_COUNT = TIME_NS/ESC_CLK_NS */ - divisor =intel_dsi_tlpx_ns (intel_dsi) *intel_dsi_bitrate (intel_dsi) *1000 ; + divisor =intel_dsi_tlpx_ns (intel_dsi) *afe_clk (encoder) *1000 ; mul =8 *1000000 ; hs_tx_timeout =DIV_ROUND_UP (intel_dsi->hs_tx_timeout * mul, divisor);
@@ -1300,7 +1300,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, pipe_config->pipe_bpp =18 ; pipe_config->clock_set = true; - pipe_config->port_clock =intel_dsi_bitrate (intel_dsi) /5 ; + pipe_config->port_clock =afe_clk (encoder) /5 ;return 0 ; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 11/15 drm/i915/dsi: take compression into account in afe_clk()
In reply to Jani NikulaPass crtc_state to afe_clk() to be able to take compression into account in the computation. Once we enable compression, that is.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +24 -16
@@ -302,17 +302,22 @@ static void configure_dual_link_mode(struct intel_encoder *encoder, }/* aka DSI 8X clock */ -static int afe_clk (struct intel_encoder *encoder) +static int afe_clk (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) {struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);int bpp; - bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format); +if (crtc_state->dsc.compression_enable) + bpp = crtc_state->dsc.compressed_bpp; +else + bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format);return DIV_ROUND_CLOSEST (intel_dsi->pclk * bpp, intel_dsi->lane_count); } -static void gen11_dsi_program_esc_clk_div (struct intel_encoder *encoder) +static void gen11_dsi_program_esc_clk_div (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);
@@ -320,7 +325,7 @@ static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder)int afe_clk_khz;u32 esc_clk_div_m; - afe_clk_khz =afe_clk (encoder); + afe_clk_khz =afe_clk (encoder, crtc_state); esc_clk_div_m =DIV_ROUND_UP (afe_clk_khz,DSI_MAX_ESC_CLK );for_each_dsi_port (port, intel_dsi->ports) {
@@ -498,7 +503,9 @@ static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) } } -static void gen11_dsi_setup_dphy_timings (struct intel_encoder *encoder) +static void +gen11_dsi_setup_dphy_timings (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);
@@ -539,7 +546,7 @@ static void gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder)* leave all fields at HW default values. */ if (IS_GEN (dev_priv,11 )) { -if (afe_clk (encoder) <=800000 ) { +if (afe_clk (encoder, crtc_state) <=800000 ) {for_each_dsi_port (port, intel_dsi->ports) { tmp =I915_READ (DPHY_TA_TIMING_PARAM (port)); tmp &= ~TA_SURE_MASK ;
@@ -649,7 +656,7 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder, tmp |=EOTP_DISABLED ;/* enable link calibration if freq > 1.5Gbps */ -if (afe_clk (encoder) >=1500 *1000 ) { +if (afe_clk (encoder, pipe_config) >=1500 *1000 ) { tmp &= ~LINK_CALIBRATION_MASK ; tmp |=CALIBRATION_ENABLED_INITIAL_ONLY ; }
@@ -915,7 +922,8 @@ static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) } } -static void gen11_dsi_setup_timeouts (struct intel_encoder *encoder) +static void gen11_dsi_setup_timeouts (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);
@@ -930,7 +938,7 @@ static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder)* TIME_NS = (BYTE_CLK_COUNT * 8 * 10^6)/ Bitrate * ESCAPE_CLK_COUNT = TIME_NS/ESC_CLK_NS */ - divisor =intel_dsi_tlpx_ns (intel_dsi) *afe_clk (encoder) *1000 ; + divisor =intel_dsi_tlpx_ns (intel_dsi) *afe_clk (encoder, crtc_state) *1000 ; mul =8 *1000000 ; hs_tx_timeout =DIV_ROUND_UP (intel_dsi->hs_tx_timeout * mul, divisor);
@@ -966,7 +974,7 @@ static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder)static void gen11_dsi_enable_port_and_phy (struct intel_encoder *encoder, -const struct intel_crtc_state *pipe_config) +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);
@@ -983,13 +991,13 @@ gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,gen11_dsi_enable_ddi_buffer (encoder);/* setup D-PHY timings */ -gen11_dsi_setup_dphy_timings (encoder); +gen11_dsi_setup_dphy_timings (encoder, crtc_state);/* step 4h: setup DSI protocol timeouts */ -gen11_dsi_setup_timeouts (encoder); +gen11_dsi_setup_timeouts (encoder, crtc_state);/* Step (4h, 4i, 4j, 4k): Configure transcoder */ -gen11_dsi_configure_transcoder (encoder, pipe_config); +gen11_dsi_configure_transcoder (encoder, crtc_state);/* Step 4l: Gate DDI clocks */ if (IS_GEN (dev_priv,11 ))
@@ -1036,14 +1044,14 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) }static void gen11_dsi_pre_pll_enable (struct intel_encoder *encoder, -const struct intel_crtc_state *pipe_config, +const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state) {/* step2: enable IO power */ gen11_dsi_enable_io_power (encoder);/* step3: enable DSI PLL */ -gen11_dsi_program_esc_clk_div (encoder); +gen11_dsi_program_esc_clk_div (encoder, crtc_state); } static void gen11_dsi_pre_enable(struct intel_encoder *encoder,
@@ -1300,7 +1308,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, pipe_config->pipe_bpp =18 ; pipe_config->clock_set = true; - pipe_config->port_clock =afe_clk (encoder) /5 ; + pipe_config->port_clock =afe_clk (encoder, pipe_config) /5 ;return 0 ; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 7/15 drm/i915/dsc: add basic hardware state readout support
In reply to Jani NikulaAdd basic hardware state readout for DSC, and check the most relevant details in the state checker.
As a side effect, this should also get the power domains for the enabled DSC on takeover, and subsequently disable DSC if it's not needed.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.c | 4 +++ drivers/gpu/drm/i915/display/intel_vdsc.c | 36 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_vdsc.h | 2 ++ 4 files changed, 44 insertions(+)
drivers/gpu/drm/i915/display/intel_ddi.c +2 -0
@@ -4291,6 +4291,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,if (WARN_ON (transcoder_is_dsi (cpu_transcoder)))return ; +intel_dsc_get_config (encoder, pipe_config); + temp =I915_READ (TRANS_DDI_FUNC_CTL (cpu_transcoder));if (temp &TRANS_DDI_PHSYNC ) flags |=DRM_MODE_FLAG_PHSYNC ;
drivers/gpu/drm/i915/display/intel_display.c +4 -0
@@ -13316,6 +13316,10 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_I (sync_mode_slaves_mask);PIPE_CONF_CHECK_I (master_transcoder); +PIPE_CONF_CHECK_I (dsc.compression_enable); +PIPE_CONF_CHECK_I (dsc.dsc_split); +PIPE_CONF_CHECK_I (dsc.compressed_bpp); +#undef PIPE_CONF_CHECK_X#undef PIPE_CONF_CHECK_I#undef PIPE_CONF_CHECK_BOOL
drivers/gpu/drm/i915/display/intel_vdsc.c +36 -0
@@ -845,6 +845,42 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } +void intel_dsc_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; +enum pipe pipe = crtc->pipe; +u32 dss_ctl1, dss_ctl2, val; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) { + dss_ctl1 =I915_READ (DSS_CTL1 ); + dss_ctl2 =I915_READ (DSS_CTL2 ); + }else { + dss_ctl1 =I915_READ (ICL_PIPE_DSS_CTL1 (pipe)); + dss_ctl2 =I915_READ (ICL_PIPE_DSS_CTL2 (pipe)); + } + + crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; +if (!crtc_state->dsc.compression_enable) +return ; + + crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && + (dss_ctl1 &JOINER_ENABLE ); + +/* FIXME: add more state readout as needed */ + +/* PPS1 */ +if (cpu_transcoder ==TRANSCODER_EDP ) + val =I915_READ (DSCA_PICTURE_PARAMETER_SET_1 ); +else + val =I915_READ (ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); + vdsc_cfg->bits_per_pixel = val; + crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; +} +static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {
drivers/gpu/drm/i915/display/intel_vdsc.h +2 -0
@@ -14,6 +14,8 @@ void intel_dsc_enable(struct intel_encoder *encoder,void intel_dsc_disable (const struct intel_crtc_state *crtc_state);int intel_dsc_compute_params (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); +void intel_dsc_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state);enum intel_display_power_domain intel_dsc_power_domain (const struct intel_crtc_state *crtc_state);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 8/15 drm/i915/dsi: set pipe_bpp on ICL configure config
In reply to Jani NikulaThe ICL DSI pipe_bpp currently comes fromcompute_baseline_pipe_bpp(). Fix it.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/display/icl_dsi.c +5 -0
@@ -1286,6 +1286,11 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,else pipe_config->cpu_transcoder =TRANSCODER_DSI_0 ; +if (intel_dsi->pixel_format ==MIPI_DSI_FMT_RGB888 ) + pipe_config->pipe_bpp =24 ; +else + pipe_config->pipe_bpp =18 ; + pipe_config->clock_set = true; pipe_config->port_clock =intel_dsi_bitrate (intel_dsi) /5 ;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 12/15 drm/i915/dsi: use compressed pixel format with DSC
In reply to Jani NikulaWhen compression is enabled, configure the DSI transcoder to use compressed format.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +20 -16
@@ -682,22 +682,26 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,/* select pixel format */ tmp &= ~PIX_FMT_MASK ; -switch (intel_dsi->pixel_format) { -default : -MISSING_CASE (intel_dsi->pixel_format); -/* fallthrough */ -case MIPI_DSI_FMT_RGB565 : - tmp |=PIX_FMT_RGB565 ; -break ; -case MIPI_DSI_FMT_RGB666_PACKED : - tmp |=PIX_FMT_RGB666_PACKED ; -break ; -case MIPI_DSI_FMT_RGB666 : - tmp |=PIX_FMT_RGB666_LOOSE ; -break ; -case MIPI_DSI_FMT_RGB888 : - tmp |=PIX_FMT_RGB888 ; -break ; +if (pipe_config->dsc.compression_enable) { + tmp |=PIX_FMT_COMPRESSED ; + }else { +switch (intel_dsi->pixel_format) { +default : +MISSING_CASE (intel_dsi->pixel_format); +/* fallthrough */ +case MIPI_DSI_FMT_RGB565 : + tmp |=PIX_FMT_RGB565 ; +break ; +case MIPI_DSI_FMT_RGB666_PACKED : + tmp |=PIX_FMT_RGB666_PACKED ; +break ; +case MIPI_DSI_FMT_RGB666 : + tmp |=PIX_FMT_RGB666_LOOSE ; +break ; +case MIPI_DSI_FMT_RGB888 : + tmp |=PIX_FMT_RGB888 ; +break ; + } }if (INTEL_GEN (dev_priv) >=12 ) {
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 14/15 drm/i915/dsi: Fix state mismatch warns for horizontal timings with DSC
In reply to Jani NikulaFrom: Vandita Kulkarni <[email protected]>
When DSC is enabled consider the compression ratio that was used during horizontal timing calculations.
This may still lead to warns due to rounding errors in the round-trip.
v2 by Jani:
- rebase on top of the more generic dsc state readout
--- drivers/gpu/drm/i915/display/icl_dsi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/i915/display/icl_dsi.c +12 -0
@@ -1255,6 +1255,18 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder,struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +if (pipe_config->dsc.compressed_bpp) { +int div = pipe_config->dsc.compressed_bpp; +int mul =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format); + + adjusted_mode->crtc_htotal = +DIV_ROUND_UP (adjusted_mode->crtc_htotal * mul, div); + adjusted_mode->crtc_hsync_start = +DIV_ROUND_UP (adjusted_mode->crtc_hsync_start * mul, div); + adjusted_mode->crtc_hsync_end = +DIV_ROUND_UP (adjusted_mode->crtc_hsync_end * mul, div); + } +if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *=2 ;if (intel_dsi->dual_link ==DSI_DUAL_LINK_FRONT_BACK )
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 13/15 drm/i915/dsi: account for DSC in horizontal timings
In reply to Jani NikulaWhen DSC is enabled, we need to adjust the horizontal timings to account for the compressed (and therefore reduced) link speed.
The compressed frequency ratio simplifies down to the ratio between compressed and non-compressed bpp.
Bspec: 49263
--- drivers/gpu/drm/i915/display/icl_dsi.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +19 -5
@@ -785,12 +785,12 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,static void gen11_dsi_set_transcoder_timings (struct intel_encoder *encoder, -const struct intel_crtc_state *pipe_config) +const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);const struct drm_display_mode *adjusted_mode = - &pipe_config->hw.adjusted_mode; + &crtc_state->hw.adjusted_mode;enum port port;enum transcoder dsi_trans;/* horizontal timings */
@@ -798,11 +798,25 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder,u16 hback_porch;/* vertical timings */ u16 vtotal, vactive, vsync_start, vsync_end, vsync_shift; +int mul =1 , div =1 ; + +/* +* Adjust horizontal timings (htotal, hsync_start, hsync_end) to account +* for slower link speed if DSC is enabled. +* +* The compression frequency ratio is the ratio between compressed and +* non-compressed link speeds, and simplifies down to the ratio between +* compressed and non-compressed bpp. +*/ +if (crtc_state->dsc.compression_enable) { + mul = crtc_state->dsc.compressed_bpp; + div =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format); + } hactive = adjusted_mode->crtc_hdisplay; - htotal = adjusted_mode->crtc_htotal; - hsync_start = adjusted_mode->crtc_hsync_start; - hsync_end = adjusted_mode->crtc_hsync_end; + htotal =DIV_ROUND_UP (adjusted_mode->crtc_htotal * mul, div); + hsync_start =DIV_ROUND_UP (adjusted_mode->crtc_hsync_start * mul, div); + hsync_end =DIV_ROUND_UP (adjusted_mode->crtc_hsync_end * mul, div); hsync_size = hsync_end - hsync_start; hback_porch = (adjusted_mode->crtc_htotal - adjusted_mode->crtc_hsync_end);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 15/15 drm/i915/dsi: add support for DSC
In reply to Jani NikulaEnable DSC for DSI, if specified in VBT.
This still lacks DSC aware get config implementation, and therefore state checker will fail. Also mode valid is not there yet.
v5:
- add dsc get config call
v4:
- convert_rgb = true (Vandita)
- ignore max cdclock check (Vandita)
- rename pipe_config to crtc_state
v3:
- take compressed bpp into account
v2:
- Nuke conn_state->max_requested_bpc, it's not used on DSI
Bspec: 49263
--- drivers/gpu/drm/i915/display/icl_dsi.c | 69 ++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +66 -3
@@ -34,6 +34,7 @@#include "intel_ddi.h" #include "intel_dsi.h" #include "intel_panel.h" +#include "intel_vdsc.h" static inline int header_credits_available (struct drm_i915_private *dev_priv,enum transcoder dsi_trans)
@@ -1087,6 +1088,8 @@ static void gen11_dsi_pre_enable(struct intel_encoder *encoder,/* step5: program and powerup panel */ gen11_dsi_powerup_panel (encoder); +intel_dsc_enable (encoder, pipe_config); +/* step6c: configure transcoder timings */ gen11_dsi_set_transcoder_timings (encoder, pipe_config);
@@ -1248,6 +1251,13 @@ static void gen11_dsi_disable(struct intel_encoder *encoder,gen11_dsi_disable_io_power (encoder); } +static enum drm_mode_status gen11_dsi_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) +{ +/* FIXME: DSC? */ +return intel_dsi_mode_valid (connector, mode); +} +static void gen11_dsi_get_timings (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config) {
@@ -1294,6 +1304,8 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); +intel_dsc_get_config (encoder, pipe_config); +/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =cnl_calc_wrpll_link (dev_priv, &pipe_config->dpll_hw_state);
@@ -1307,6 +1319,48 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, pipe_config->pipe_bpp =bdw_get_pipemisc_bpp (crtc); } +static int gen11_dsi_dsc_compute_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +int dsc_max_bpc =INTEL_GEN (dev_priv) >=12 ?12 :10 ; +bool use_dsc; +int ret; + + use_dsc =intel_bios_get_dsc_params (encoder, crtc_state, dsc_max_bpc); +if (!use_dsc) +return 0 ; + +if (crtc_state->pipe_bpp <8 *3 ) +return -EINVAL ; + +/* FIXME: split only when necessary */ +if (crtc_state->dsc.slice_count >1 ) + crtc_state->dsc.dsc_split = true; + + vdsc_cfg->convert_rgb = true; + + ret =intel_dsc_compute_params (encoder, crtc_state); +if (ret) +return ret; + +/* DSI specific sanity checks on the common code */ +WARN_ON (vdsc_cfg->vbr_enable); +WARN_ON (vdsc_cfg->simple_422); +WARN_ON (vdsc_cfg->pic_width % vdsc_cfg->slice_width); +WARN_ON (vdsc_cfg->slice_height <8 ); +WARN_ON (vdsc_cfg->pic_height % vdsc_cfg->slice_height); + + ret =drm_dsc_compute_rc_parameters (vdsc_cfg); +if (ret) +return ret; + + crtc_state->dsc.compression_enable = true; + +return 0 ; +} +static int gen11_dsi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state)
@@ -1338,6 +1392,10 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, pipe_config->pipe_bpp =18 ; pipe_config->clock_set = true; + +if (gen11_dsi_dsc_compute_config (encoder, pipe_config)) +DRM_DEBUG_KMS ("Attempting to use DSC failed\n" ); + pipe_config->port_clock =afe_clk (encoder, pipe_config) /5 ;return 0 ;
@@ -1346,8 +1404,13 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,static void gen11_dsi_get_power_domains (struct intel_encoder *encoder,struct intel_crtc_state *crtc_state) { -get_dsi_io_power_domains (to_i915 (encoder->base.dev), -enc_to_intel_dsi (&encoder->base)); +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +get_dsi_io_power_domains (i915,enc_to_intel_dsi (&encoder->base)); + +if (crtc_state->dsc.compression_enable) +intel_display_power_get (i915, +intel_dsc_power_domain (crtc_state)); } static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder,
@@ -1417,7 +1480,7 @@ static const struct drm_connector_funcs gen11_dsi_connector_funcs = {static const struct drm_connector_helper_funcs gen11_dsi_connector_helper_funcs = { .get_modes = intel_dsi_get_modes, - .mode_valid = intel_dsi_mode_valid, + .mode_valid = gen11_dsi_mode_valid, .atomic_check = intel_digital_connector_atomic_check, };
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: enable DSC (rev6)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915/dsi: enable DSC (rev6)
URL : https://patchwork.freedesktop.org/series/69540/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip a23b05a241fc drm/i915/bios: pass devdata to parse_ddi_port a0590902b587 drm/i915/bios: parse compression parameters block -:107: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "devdata->dsc" #107: FILE: drivers/gpu/drm/i915/display/intel_bios.c:1657: + devdata->dsc != NULL);
total: 0 errors, 0 warnings, 1 checks, 101 lines checked5e0e7428b343 drm/i915/bios: add support for querying DSC details for encoder 6f03be6f86c6 drm/i915/dsc: move DP specific compute params to intel_dp.c 2609e4e50bf2 drm/i915/dsc: move slice height calculation to encoder 2cfb9e182fb0 drm/i915/dsc: add support for computing and writing PPS for DSI encoders 9d4ed96330e0 drm/i915/dsc: add basic hardware state readout support b0563267830c drm/i915/dsi: set pipe_bpp on ICL configure config 26caeb29b90e drm/i915/dsi: abstract afe_clk calculation4395ce411630 drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate() 770a03614ae1 drm/i915/dsi: take compression into account in afe_clk() 3665acb6aef6 drm/i915/dsi: use compressed pixel format with DSC a7b9e220bef4 drm/i915/dsi: account for DSC in horizontal timings ee911caff1df drm/i915/dsi: Fix state mismatch warns for horizontal timings with DSC c1d68732ce8a drm/i915/dsi: add support for DSC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/dsi: enable DSC (rev6)
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915/dsi: enable DSC (rev6)
URL : https://patchwork.freedesktop.org/series/69540/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7521 -> Patchwork_15657
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15657 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15657, 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_15657/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15657:
### IGT changes ###
#### Possible regressions ####
* igt@kms_chamelium@dp-crc-fast:
- fi-icl-u2: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-icl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-icl-u2/igt@[email protected]
* igt@kms_flip@basic-flip-vs-dpms:
- fi-icl-u3: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-icl-u3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-icl-u3/igt@[email protected]
* igt@kms_force_connector_basic@force-connector-state:
- fi-kbl-guc: NOTRUN -> [DMESG-WARN][5]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-kbl-guc/igt@[email protected]
* igt@runner@aborted:
- fi-whl-u: NOTRUN -> [FAIL][6]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-whl-u/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-kbl-guc/igt@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_7521 and Patchwork_15657:
### New IGT tests (22) ###
* igt@amdgpu/amd_basic@cs-compute:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.03] s
* igt@amdgpu/amd_basic@cs-gfx:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.04] s
* igt@amdgpu/amd_basic@cs-multi-fence:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.00] s
* igt@amdgpu/amd_basic@cs-sdma:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.02] s
* igt@amdgpu/amd_basic@memory-alloc:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.00] s
* igt@amdgpu/amd_basic@query-info:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0] s
* igt@amdgpu/amd_basic@semaphore:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.00] s
* igt@amdgpu/amd_basic@userptr:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 0.00] s
* igt@amdgpu/amd_cs_nop@fork-compute0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.50] s
* igt@amdgpu/amd_cs_nop@fork-gfx0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.54] s
* igt@amdgpu/amd_cs_nop@nop-compute0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.48] s
* igt@amdgpu/amd_cs_nop@nop-gfx0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.48] s
* igt@amdgpu/amd_cs_nop@sync-compute0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.48] s
* igt@amdgpu/amd_cs_nop@sync-fork-compute0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.52] s
* igt@amdgpu/amd_cs_nop@sync-fork-gfx0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.50] s
* igt@amdgpu/amd_cs_nop@sync-gfx0:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 21.48] s
* igt@amdgpu/amd_prime@amd-to-i915:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 2.45] s
* igt@amdgpu/amd_prime@i915-to-amd:
- Statuses : 1 pass(s) 17 skip(s)
- Exec time: [0.0, 5.50] s
* igt@gem_exec_fence@nb-await-default:
- Statuses : 21 pass(s) 2 skip(s)
- Exec time: [0.0, 0.08] s
* igt@i915_module_load@reload:
- Statuses : 18 pass(s)
- Exec time: [1.18, 7.58] s
* igt@i915_module_load@reload-no-display:
- Statuses : 18 pass(s)
- Exec time: [1.33, 6.63] s
* igt@i915_module_load@reload-with-fault-injection:
- Statuses : 18 pass(s)
- Exec time: [4.78, 94.14] s
Known issues
------------
Here are the changes found in Patchwork_15657 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_gem_contexts:
- fi-byt-n2820: [PASS][8] -> [DMESG-FAIL][9] ([i915#722])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
#### Possible fixes ####
* igt@gem_ctx_create@basic-files:
- {fi-tgl-guc}: [INCOMPLETE][10] ([fdo#111735]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-tgl-guc/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-tgl-guc/igt@[email protected]
* igt@gem_exec_suspend@basic-s4-devices:
- fi-icl-guc: [INCOMPLETE][12] ([i915#140] / [i915#184]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-icl-guc/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-icl-guc/igt@[email protected]
#### Warnings ####
* igt@runner@aborted:
- fi-cml-s: [FAIL][14] ([fdo#111764] / [i915#577]) -> [FAIL][15] ([fdo#111461] / [i915#577])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7521/fi-cml-s/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/fi-cml-s/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#111461]: https://bugs.freedesktop.org/show_bug.cgi?id=111461
[fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
[fdo#111764]: https://bugs.freedesktop.org/show_bug.cgi?id=111764
[i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
[i915#184]: https://gitlab.freedesktop.org/drm/intel/issues/184
[i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
[i915#577]: https://gitlab.freedesktop.org/drm/intel/issues/577
[i915#707]: https://gitlab.freedesktop.org/drm/intel/issues/707
[i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
Participating hosts (50 -> 46)
------------------------------
Additional (2): fi-kbl-7560u fi-kbl-guc
Missing (6): fi-ilk-m540 fi-bsw-cyan fi-ctg-p8600 fi-ivb-3770 fi-byt-clapper fi-snb-2600
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7521 -> Patchwork_15657
CI-20190529: 20190529
CI_DRM_7521: 9203f67985ebf27211aa1eabb77093302248c9fc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5341: 5fe683cdebde2d77d16ffc42c9fdf29a9f95bb82 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15657: c1d68732ce8ade90d738625a2a8f6f82990baeb5 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
c1d68732ce8a drm/i915/dsi: add support for DSCee911caff1df drm/i915/dsi: Fix state mismatch warns for horizontal timings with DSC a7b9e220bef4 drm/i915/dsi: account for DSC in horizontal timings 3665acb6aef6 drm/i915/dsi: use compressed pixel format with DSC 770a03614ae1 drm/i915/dsi: take compression into account in afe_clk() 4395ce411630 drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate() 26caeb29b90e drm/i915/dsi: abstract afe_clk calculationb0563267830c drm/i915/dsi: set pipe_bpp on ICL configure config 9d4ed96330e0 drm/i915/dsc: add basic hardware state readout support 2cfb9e182fb0 drm/i915/dsc: add support for computing and writing PPS for DSI encoders 2609e4e50bf2 drm/i915/dsc: move slice height calculation to encoder 6f03be6f86c6 drm/i915/dsc: move DP specific compute params to intel_dp.c 5e0e7428b343 drm/i915/bios: add support for querying DSC details for encoder a0590902b587 drm/i915/bios: parse compression parameters block a23b05a241fc drm/i915/bios: pass devdata to parse_ddi_port
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15657/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v4 07/15] drm/i915/dsc: add basic hardware state readout support
In reply to Jani NikulaQuoted 5 lines · Jani Nikula
Add basic hardware state readout for DSC, and check the most relevant details in the state checker.
As a side effect, this should also get the power domains for the enabled DSC on takeover, and subsequently disable DSC if it's not needed.
This was hasty...
Need to check for source DSC support and DSC power domain power before readout. Duh.
BR,
Jani.
Quoted 98 lines
Cc Manasi Navare <[email protected]>Cc Vandita Kulkarni <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/display/intel_ddi.c | 2 ++ drivers/gpu/drm/i915/display/intel_display.c | 4 +++ drivers/gpu/drm/i915/display/intel_vdsc.c | 36 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_vdsc.h | 2 ++ 4 files changed, 44 insertions(+)drivers/gpu/drm/i915/display/intel_ddi.c +2
-0@@ -4291,6 +4291,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder,if (WARN_ON (transcoder_is_dsi (cpu_transcoder)))return ; +intel_dsc_get_config (encoder, pipe_config); + temp =I915_READ (TRANS_DDI_FUNC_CTL (cpu_transcoder));if (temp &TRANS_DDI_PHSYNC ) flags |=DRM_MODE_FLAG_PHSYNC ;drivers/gpu/drm/i915/display/intel_display.c +4
-0@@ -13316,6 +13316,10 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_I (sync_mode_slaves_mask);PIPE_CONF_CHECK_I (master_transcoder); +PIPE_CONF_CHECK_I (dsc.compression_enable); +PIPE_CONF_CHECK_I (dsc.dsc_split); +PIPE_CONF_CHECK_I (dsc.compressed_bpp); +#undef PIPE_CONF_CHECK_X#undef PIPE_CONF_CHECK_I#undef PIPE_CONF_CHECK_BOOLdrivers/gpu/drm/i915/display/intel_vdsc.c +36
-0@@ -845,6 +845,42 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } +void intel_dsc_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; +enum pipe pipe = crtc->pipe; +u32 dss_ctl1, dss_ctl2, val; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) { + dss_ctl1 =I915_READ (DSS_CTL1 ); + dss_ctl2 =I915_READ (DSS_CTL2 ); + }else { + dss_ctl1 =I915_READ (ICL_PIPE_DSS_CTL1 (pipe)); + dss_ctl2 =I915_READ (ICL_PIPE_DSS_CTL2 (pipe)); + } + + crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; +if (!crtc_state->dsc.compression_enable) +return ; + + crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && + (dss_ctl1 &JOINER_ENABLE ); + +/* FIXME: add more state readout as needed */ + +/* PPS1 */ +if (cpu_transcoder ==TRANSCODER_EDP ) + val =I915_READ (DSCA_PICTURE_PARAMETER_SET_1 ); +else + val =I915_READ (ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); + vdsc_cfg->bits_per_pixel = val; + crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; +} +static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {drivers/gpu/drm/i915/display/intel_vdsc.h +2
-0@@ -14,6 +14,8 @@ void intel_dsc_enable(struct intel_encoder *encoder,void intel_dsc_disable (const struct intel_crtc_state *crtc_state);int intel_dsc_compute_params (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); +void intel_dsc_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state);enum intel_display_power_domain intel_dsc_power_domain (const struct intel_crtc_state *crtc_state);
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx