VSC SDP rework
Subsystems (3)
v2 cover VSC SDP rework
Current VSC SDP configuration code is broken:
1. Driver configured header and data is not used at all
2. Colorimetry data is not added into VSC SDP if PSR1 is used
This patch set fixes these problems and makes VSC SDP configuration a bit more simpler by unifying PSR and non-PSR cases.
v2: s/-colorimetry/without colorimetry/
Jouni Högander (7):
drm/i915/display: Remove intel_crtc_state->psr_vsc drm/i915/display: Move colorimetry_support from intel_psr to intel_dp drm/i915/display: Unify VSC SPD preparation drm/i915/display: Fix vsc_sdp computation drm/i915/display: Ignore only psr specific part of vsc sdp drm/i915/display: Read PSR configuration before VSC SDP drm/i915/display: Take care of VSC select field in video dip ctl
register
drivers/gpu/drm/i915/display/intel_ddi.c | 4 +- drivers/gpu/drm/i915/display/intel_display.c | 9 +- .../drm/i915/display/intel_display_types.h | 4 +- drivers/gpu/drm/i915/display/intel_dp.c | 97 ++++++------------- drivers/gpu/drm/i915/display/intel_dp.h | 7 -- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +- drivers/gpu/drm/i915/display/intel_psr.c | 11 +-- 7 files changed, 44 insertions(+), 96 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/7 drm/i915/display: Remove intel_crtc_state->psr_vsc
There is no really need to have separate vsc for psr usage. Use intel_crtc_state->infoframes.vsc instead.
--- drivers/gpu/drm/i915/display/intel_display_types.h | 1 - drivers/gpu/drm/i915/display/intel_psr.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +0 -1
@@ -1218,7 +1218,6 @@ struct intel_crtc_state {bool wm_level_disabled;u32 dc3co_exitline;u16 su_y_granularity; -struct drm_dp_vsc_sdp psr_vsc;/* * Frequence the dpll for the port should run at. Differs from the
drivers/gpu/drm/i915/display/intel_psr.c +2 -2
@@ -1380,7 +1380,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp, crtc_state->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC );intel_dp_compute_psr_vsc_sdp (intel_dp, crtc_state, conn_state, - &crtc_state->psr_vsc); + &crtc_state->infoframes.vsc); } void intel_psr_get_config(struct intel_encoder *encoder,
@@ -1652,7 +1652,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,drm_dbg_kms (&dev_priv->drm,"Enabling PSR%s\n" , intel_dp->psr.psr2_enabled ?"2" :"1" ); -intel_write_dp_vsc_sdp (encoder, crtc_state, &crtc_state->psr_vsc); +intel_write_dp_vsc_sdp (encoder, crtc_state, &crtc_state->infoframes.vsc);intel_snps_phy_update_psr_power_state (dev_priv, phy, true);intel_psr_enable_sink (intel_dp);intel_psr_enable_source (intel_dp, crtc_state);
Signature · 1 line
2.34.1
PATCH v2 2/7 drm/i915/display: Move colorimetry_support from intel_psr to intel_dp
In reply to Jouni HöganderColorimetry support is not really a PSR specific thing. Move it to intel_dp struct and use it also when preparing vsc sdp for non-PSR case.
--- drivers/gpu/drm/i915/display/intel_display_types.h | 3 ++- drivers/gpu/drm/i915/display/intel_dp.c | 10 +++++++--- drivers/gpu/drm/i915/display/intel_psr.c | 5 +---- 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +2 -1
@@ -1701,7 +1701,6 @@ struct intel_psr {unsigned int busy_frontbuffer_bits;bool sink_psr2_support;bool link_standby; -bool colorimetry_support;bool psr2_enabled;bool psr2_sel_fetch_enabled;bool psr2_sel_fetch_cff_enabled;
@@ -1832,6 +1831,8 @@ struct intel_dp {/* When we last wrote the OUI for eDP */ unsigned long last_oui_write; + +bool colorimetry_support; };enum lspcon_vendor {
drivers/gpu/drm/i915/display/intel_dp.c +7 -3
@@ -2622,7 +2622,8 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,if (crtc_state->has_psr)return ; -if (!intel_dp_needs_vsc_sdp (crtc_state, conn_state)) +if (!intel_dp->colorimetry_support || + !intel_dp_needs_vsc_sdp (crtc_state, conn_state))return ; crtc_state->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC );
@@ -2639,7 +2640,7 @@ void intel_dp_compute_psr_vsc_sdp(struct intel_dp *intel_dp, vsc->sdp_type =DP_SDP_VSC ;if (crtc_state->has_psr2) { -if (intel_dp->psr.colorimetry_support && +if (intel_dp->colorimetry_support &&intel_dp_needs_vsc_sdp (crtc_state, conn_state)) {/* [PSR2, +Colorimetry] */ intel_dp_compute_vsc_colorimetry(crtc_state, conn_state,
@@ -2654,7 +2655,7 @@ void intel_dp_compute_psr_vsc_sdp(struct intel_dp *intel_dp, vsc->length =0xe ; } }else if (crtc_state->has_panel_replay) { -if (intel_dp->psr.colorimetry_support && +if (intel_dp->colorimetry_support &&intel_dp_needs_vsc_sdp (crtc_state, conn_state)) {/* [Panel Replay with colorimetry info] */ intel_dp_compute_vsc_colorimetry(crtc_state, conn_state,
@@ -6543,6 +6544,9 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, "HDCP init failed, skipping.\n"); } + intel_dp->colorimetry_support = +intel_dp_get_colorimetry_status (intel_dp); + intel_dp->frl.is_trained = false; intel_dp->frl.trained_rate_gbps =0 ;
drivers/gpu/drm/i915/display/intel_psr.c +1 -4
@@ -560,11 +560,8 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)if (intel_dp->psr_dpcd[0 ])_psr_init_dpcd (intel_dp); -if (intel_dp->psr.sink_psr2_support) { - intel_dp->psr.colorimetry_support = -intel_dp_get_colorimetry_status (intel_dp); +if (intel_dp->psr.sink_psr2_support)intel_dp_get_su_granularity (intel_dp); - } }static void hsw_psr_setup_aux (struct intel_dp *intel_dp)
Signature · 1 line
2.34.1
PATCH v2 3/7 drm/i915/display: Unify VSC SPD preparation
In reply to Jouni HöganderThere is no specific reason to prepare VSC SDP for PSR case somehow differently. Unify PSR and non-PSR preparation.
--- drivers/gpu/drm/i915/display/intel_dp.c | 43 ++++-------------------- drivers/gpu/drm/i915/display/intel_dp.h | 7 ---- drivers/gpu/drm/i915/display/intel_psr.c | 6 ---- 3 files changed, 6 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +6 -37
@@ -2616,28 +2616,17 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_dp_vsc_sdp *vsc = &crtc_state->infoframes.vsc; + struct drm_dp_vsc_sdp *vsc; -/* When a crtc state has PSR, VSC SDP will be handled by PSR routine */ -if (crtc_state->has_psr) +if ((!intel_dp->colorimetry_support || + !intel_dp_needs_vsc_sdp (crtc_state, conn_state)) && + !crtc_state->has_psr)return ; -if (!intel_dp->colorimetry_support || - !intel_dp_needs_vsc_sdp (crtc_state, conn_state)) -return ; + vsc = &crtc_state->infoframes.vsc; crtc_state->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC ); vsc->sdp_type =DP_SDP_VSC ; -intel_dp_compute_vsc_colorimetry (crtc_state, conn_state, - &crtc_state->infoframes.vsc); -} - -void intel_dp_compute_psr_vsc_sdp (struct intel_dp *intel_dp, -const struct intel_crtc_state *crtc_state, -const struct drm_connector_state *conn_state, -struct drm_dp_vsc_sdp *vsc) -{ - vsc->sdp_type =DP_SDP_VSC ;if (crtc_state->has_psr2) { if (intel_dp->colorimetry_support &&
@@ -4289,24 +4278,6 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder, dig_port->write_infoframe (encoder, crtc_state, type, &sdp, len); } -void intel_write_dp_vsc_sdp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -const struct drm_dp_vsc_sdp *vsc) -{ -struct intel_digital_port *dig_port =enc_to_dig_port (encoder); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct dp_sdp sdp = {}; -ssize_t len; - - len =intel_dp_vsc_sdp_pack (vsc, &sdp,sizeof (sdp)); - -if (drm_WARN_ON (&dev_priv->drm, len <0 )) -return ; - - dig_port->write_infoframe (encoder, crtc_state,DP_SDP_VSC , - &sdp, len); -} - void intel_dp_set_infoframes(struct intel_encoder *encoder, bool enable, const struct intel_crtc_state *crtc_state,
@@ -4333,9 +4304,7 @@ void intel_dp_set_infoframes(struct intel_encoder *encoder,if (!enable)return ; -/* When PSR is enabled, VSC SDP is handled by PSR routine */ -if (!crtc_state->has_psr) -intel_write_dp_sdp (encoder, crtc_state,DP_SDP_VSC ); +intel_write_dp_sdp (encoder, crtc_state,DP_SDP_VSC );intel_write_dp_sdp (encoder, crtc_state,HDMI_PACKET_TYPE_GAMUT_METADATA ); }
drivers/gpu/drm/i915/display/intel_dp.h +0 -7
@@ -109,13 +109,6 @@ int intel_dp_max_data_rate(int max_link_rate, int max_lanes);bool intel_dp_can_bigjoiner (struct intel_dp *intel_dp);bool intel_dp_needs_vsc_sdp (const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state); -void intel_dp_compute_psr_vsc_sdp (struct intel_dp *intel_dp, -const struct intel_crtc_state *crtc_state, -const struct drm_connector_state *conn_state, -struct drm_dp_vsc_sdp *vsc); -void intel_write_dp_vsc_sdp (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state, -const struct drm_dp_vsc_sdp *vsc);void intel_dp_set_infoframes (struct intel_encoder *encoder,bool enable,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state);
drivers/gpu/drm/i915/display/intel_psr.c +0 -6
@@ -1374,10 +1374,6 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,return ; crtc_state->has_psr2 =intel_psr2_config_valid (intel_dp, crtc_state); - - crtc_state->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC ); -intel_dp_compute_psr_vsc_sdp (intel_dp, crtc_state, conn_state, - &crtc_state->infoframes.vsc); } void intel_psr_get_config(struct intel_encoder *encoder,
@@ -1621,7 +1617,6 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp);struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp);enum phy phy =intel_port_to_phy (dev_priv, dig_port->base.port); -struct intel_encoder *encoder = &dig_port->base;u32 val;drm_WARN_ON (&dev_priv->drm, intel_dp->psr.enabled);
@@ -1649,7 +1644,6 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,drm_dbg_kms (&dev_priv->drm,"Enabling PSR%s\n" , intel_dp->psr.psr2_enabled ?"2" :"1" ); -intel_write_dp_vsc_sdp (encoder, crtc_state, &crtc_state->infoframes.vsc);intel_snps_phy_update_psr_power_state (dev_priv, phy, true);intel_psr_enable_sink (intel_dp);intel_psr_enable_source (intel_dp, crtc_state);
Signature · 1 line
2.34.1
PATCH v2 4/7 drm/i915/display: Fix vsc_sdp computation
In reply to Jouni HöganderCurrently colorimetry data is not added for psr1 or non-psr case. Fix this by adding it as needed.
--- drivers/gpu/drm/i915/display/intel_dp.c | 48 ++++++++++--------------- 1 file changed, 19 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +19 -29
@@ -2628,36 +2628,26 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp, crtc_state->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC ); vsc->sdp_type =DP_SDP_VSC ; -if (crtc_state->has_psr2) { -if (intel_dp->colorimetry_support && -intel_dp_needs_vsc_sdp (crtc_state, conn_state)) { -/* [PSR2, +Colorimetry] */ -intel_dp_compute_vsc_colorimetry (crtc_state, conn_state, - vsc); - }else { -/* -* [PSR2, -Colorimetry] -* Prepare VSC Header for SU as per eDP 1.4 spec, Table 6-11 -* 3D stereo + PSR/PSR2 + Y-coordinate. -*/ - vsc->revision =0x4 ; - vsc->length =0xe ; - } +/* Needs colorimetry */ +if (intel_dp_needs_vsc_sdp (crtc_state, conn_state)) { +intel_dp_compute_vsc_colorimetry (crtc_state, conn_state, + vsc); + }else if (crtc_state->has_psr2) { +/* +* [PSR2 without colorimetry] +* Prepare VSC Header for SU as per eDP 1.4 spec, Table 6-11 +* 3D stereo + PSR/PSR2 + Y-coordinate. +*/ + vsc->revision =0x4 ; + vsc->length =0xe ; }else if (crtc_state->has_panel_replay) { -if (intel_dp->colorimetry_support && -intel_dp_needs_vsc_sdp (crtc_state, conn_state)) { -/* [Panel Replay with colorimetry info] */ -intel_dp_compute_vsc_colorimetry (crtc_state, conn_state, - vsc); - }else { -/* -* [Panel Replay without colorimetry info] -* Prepare VSC Header for SU as per DP 2.0 spec, Table 2-223 -* VSC SDP supporting 3D stereo + Panel Replay. -*/ - vsc->revision =0x6 ; - vsc->length =0x10 ; - } +/* +* [Panel Replay without colorimetry info] +* Prepare VSC Header for SU as per DP 2.0 spec, Table 2-223 +* VSC SDP supporting 3D stereo + Panel Replay. +*/ + vsc->revision =0x6 ; + vsc->length =0x10 ; }else {/* * [PSR1]
Signature · 1 line
2.34.1
PATCH v2 5/7 drm/i915/display: Ignore only psr specific part of vsc sdp
In reply to Jouni HöganderPipe config check is currently ignoring vsc sdp changes completely if psr is enabled. We want to ignore only PSR part of it as there might be changes in colorimetry data. Also read back vsc_sdp when psr is used.
--- drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- drivers/gpu/drm/i915/display/intel_dp.c | 4 ---- 2 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +6 -3
@@ -4764,7 +4764,11 @@ static bool intel_compare_dp_vsc_sdp(const struct drm_dp_vsc_sdp *a, const struct drm_dp_vsc_sdp *b) { - return memcmp(a, b, sizeof(*a)) == 0; + return a->pixelformat == b->pixelformat && + a->colorimetry == b->colorimetry && + a->bpc == b->bpc && + a->dynamic_range == b->dynamic_range && + a->content_type == b->content_type; } static bool
@@ -5045,8 +5049,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, } while (0)#define PIPE_CONF_CHECK_DP_VSC_SDP (name) do { \ - if (!current_config->has_psr && !pipe_config->has_psr && \ - !intel_compare_dp_vsc_sdp(¤t_config->infoframes.name, \ + if (!intel_compare_dp_vsc_sdp(¤t_config->infoframes.name, \ &pipe_config->infoframes.name)) { \ pipe_config_dp_vsc_sdp_mismatch(dev_priv, fastset, __stringify(name), \ ¤t_config->infoframes.name, \
drivers/gpu/drm/i915/display/intel_dp.c +0 -4
@@ -4425,10 +4425,6 @@ static void intel_read_dp_vsc_sdp(struct intel_encoder *encoder,struct dp_sdp sdp = {};int ret; -/* When PSR is enabled, VSC SDP is handled by PSR routine */ -if (crtc_state->has_psr) -return ; -if ((crtc_state->infoframes.enable &intel_hdmi_infoframe_enable (type)) ==0 )return ;
Signature · 1 line
2.34.1
PATCH v2 6/7 drm/i915/display: Read PSR configuration before VSC SDP
In reply to Jouni HöganderVSC SDP sending is taken care by PSR HW and it's not enabled in VIDEO_DIP_CTL when PSR is enabled. Readback of VSC SDP is depending on VSC_SDP being set in intel_crtc_state->infoframes.enabled. In case of PSR setting this flag is taken care by PSR code -> read back PSR configuration before reading VSC SDP otherwise we get pipeconfig mismatch error.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +2 -2
@@ -3941,11 +3941,11 @@ static void intel_ddi_get_config(struct intel_encoder *encoder,if (DISPLAY_VER (dev_priv) >=8 )bdw_get_trans_port_sync_config (pipe_config); +intel_psr_get_config (encoder, pipe_config); +intel_read_dp_sdp (encoder, pipe_config,HDMI_PACKET_TYPE_GAMUT_METADATA );intel_read_dp_sdp (encoder, pipe_config,DP_SDP_VSC ); -intel_psr_get_config (encoder, pipe_config); -intel_audio_codec_get_config (encoder, pipe_config); }
Signature · 1 line
2.34.1
PATCH v2 7/7 drm/i915/display: Take care of VSC select field in video dip ctl register
In reply to Jouni HöganderWe need to configure VSC Select field in video dip ctl if we want to have e.g. colorimetry date in our VSC SDP.
--- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +5 -3
@@ -523,10 +523,12 @@ void hsw_write_infoframe(struct intel_encoder *encoder, 0);/* Wa_14013475917 */ -if (IS_DISPLAY_VER (dev_priv,13 ,14 ) && crtc_state->has_psr && type ==DP_SDP_VSC ) -return ; +if (!(IS_DISPLAY_VER (dev_priv,13 ,14 ) && crtc_state->has_psr && type ==DP_SDP_VSC )) + val |=hsw_infoframe_enable (type); + +if (type ==DP_SDP_VSC ) + val |=VSC_DIP_HW_DATA_SW_HEA ; - val |=hsw_infoframe_enable (type);intel_de_write (dev_priv, ctl_reg, val);intel_de_posting_read (dev_priv, ctl_reg); }
Signature · 1 line
2.34.1
Hello,
These are now pushed to drm-intel-next. There are BAT and IGT results available in patchwork:
https://patchwork.freedesktop.org/series/127803/
Due to problems with our CI result mails were not sent and not all checks were run on version 2. I checked IGT failures and they are not related to my patches. Also IGT was passing on version 1. Rest of the checks were run on version 2. Changes I made in version 2. were minor so I decided trust on results over version 1. and merge this set.
Thank you Rodrigo, Mika and Shawn for your help with reviewing and testing my patches.
BR,
Jouni Högander
Quoted 31 lines · Jouni Högander
Current VSC SDP configuration code is broken:
1. Driver configured header and data is not used at all
2. Colorimetry data is not added into VSC SDP if PSR1 is usedThis patch set fixes these problems and makes VSC SDP configuration a bit more simpler by unifying PSR and non-PSR cases.
v2: s/-colorimetry/without colorimetry/
Jouni Högander (7):
drm/i915/display: Removeintel_crtc_state->psr_vscdrm/i915/display: Movecolorimetry_supportfromintel_psrtointel_dp
drm/i915/display: Unify VSC SPD preparation drm/i915/display: Fixvsc_sdpcomputation drm/i915/display: Ignore only psr specific part of vsc sdp drm/i915/display: Read PSR configuration before VSC SDP drm/i915/display: Take care of VSC select field in video dip ctl registerdrivers/gpu/drm/i915/display/intel_ddi.c | 4 +- drivers/gpu/drm/i915/display/intel_display.c | 9 +- .../drm/i915/display/intel_display_types.h | 4 +- drivers/gpu/drm/i915/display/intel_dp.c | 97 ++++++----------- --
drivers/gpu/drm/i915/display/intel_dp.h | 7 -- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +- drivers/gpu/drm/i915/display/intel_psr.c | 11 +--7 files changed, 44 insertions(+), 96 deletions(-)