drm/i915: Bigjoiner preparations.
PATCH 1/10 drm/i915/dp: Fix dsc bpp calculations.
In reply to Maarten LankhorstThere was a integer wraparound when mode_clock became too high, and we didn't correct for the FEC overhead factor when dividing, also the calculations would break at HBR3.
As a result our calculated bpp was way too high, and the link width bpp limitation never came into effect.
Print out the resulting bpp calcululations as a sanity check, just in case we ever have to debug it later on again.
--- drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++------- drivers/gpu/drm/i915/display/intel_dp.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +9 -7
@@ -4323,10 +4323,10 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)DP_DPRX_ESI_LEN ; } -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay) +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay) { -u16 bits_per_pixel, max_bpp_small_joiner_ram; +u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;/*
@@ -4335,13 +4335,14 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,* FECOverhead = 2.4%, for SST -> TimeSlotsPerMTP is 1, * for MST -> TimeSlotsPerMTP has to be calculated */ - bits_per_pixel = (link_clock * lane_count *8 * -DP_DSC_FEC_OVERHEAD_FACTOR ) / - mode_clock; + bits_per_pixel =div_u64 ((u64 )link_clock * lane_count *8 * +DP_DSC_FEC_OVERHEAD_FACTOR ,1000ULL * mode_clock); +DRM_DEBUG_KMS ("Max link bpp: %u\n" , bits_per_pixel);/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =DP_DSC_MAX_SMALL_JOINER_RAM_BUFFER / mode_hdisplay; +DRM_DEBUG_KMS ("Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);/* * Greatest allowed DSC BPP = MIN (output BPP from avaialble Link BW
@@ -4351,7 +4352,8 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { -DRM_DEBUG_KMS ("Unsupported BPP %d\n" , bits_per_pixel); +DRM_DEBUG_KMS ("Unsupported BPP %u, min %u\n" , + bits_per_pixel, valid_dsc_bpp[0 ]);return 0 ; }
drivers/gpu/drm/i915/display/intel_dp.h +2 -2
@@ -102,8 +102,8 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_source_supports_hbr3 (struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,u8 *link_status); -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay); +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay);u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp,int mode_clock,int mode_hdisplay);
Signature · 1 line
2.20.1
cover drm/i915: Bigjoiner preparations.
Some of the patches that support the big joiner configuration, without actually enabling anything bigjoiner specific yet.
Big Joiner requires us to enable an additional pipe, which drives the same port. The master pipe drives the left half of the display, the slave the right half.
This is handled by splitting crtc_state into a uapi and hw state. The uapi state is the state from drm, while the hw state contains the actual state of the hardware.
Maarten Lankhorst (10):
drm/i915/dp: Fix dsc bpp calculations.
drm/i915: Prepare to split crtc state in uapi and hw state drm/i915: Handle a few more cases for hw/sw split drm/i915: Complete sw/hw split
drm/i915: Kill off is_planar_yuv_format
drm/i915: Get rid of crtc_state->fb_changed
drm/i915: Remove begin/finish_crtc_commit.
drm/i915: Do not add all planes when checking scalers on glk+ drm/i915: Add debugfs entries for reading out DPCD DSC and FEC. drm/i915: Move FEC enable timeout wait to enable_ddi_dp
drivers/gpu/drm/i915/display/icl_dsi.c | 18 +- drivers/gpu/drm/i915/display/intel_atomic.c | 66 +- drivers/gpu/drm/i915/display/intel_atomic.h | 2 + .../gpu/drm/i915/display/intel_atomic_plane.c | 8 +- drivers/gpu/drm/i915/display/intel_audio.c | 12 +- drivers/gpu/drm/i915/display/intel_bw.c | 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 8 +- drivers/gpu/drm/i915/display/intel_color.c | 150 ++-- drivers/gpu/drm/i915/display/intel_crt.c | 24 +- drivers/gpu/drm/i915/display/intel_ddi.c | 39 +- drivers/gpu/drm/i915/display/intel_display.c | 724 +++++++++--------- drivers/gpu/drm/i915/display/intel_display.h | 4 +- .../drm/i915/display/intel_display_types.h | 31 +- drivers/gpu/drm/i915/display/intel_dp.c | 58 +- drivers/gpu/drm/i915/display/intel_dp.h | 4 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 8 +- drivers/gpu/drm/i915/display/intel_dpio_phy.c | 14 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 20 +- drivers/gpu/drm/i915/display/intel_dvo.c | 14 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 62 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 12 +- drivers/gpu/drm/i915/display/intel_panel.c | 14 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 14 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 22 +- drivers/gpu/drm/i915/display/intel_sprite.c | 44 +- drivers/gpu/drm/i915/display/intel_sprite.h | 1 - drivers/gpu/drm/i915/display/intel_tv.c | 8 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 12 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 20 +- drivers/gpu/drm/i915/i915_debugfs.c | 16 +- drivers/gpu/drm/i915/intel_pm.c | 192 +++-- 34 files changed, 858 insertions(+), 779 deletions(-)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/10 drm/i915: Prepare to split crtc state in uapi and hw state
We want to split drm_crtc_state into the user visible state and actual hardware state. To prepare for this, we need some ground rules what should be in each state:
In uapi we use:
- crtc, *_changed flags, event, commit, state, mode_blob, (plane/connector/encoder)_mask.
In hw state we use what's displayed in hardware:
- enable, active, (adjusted) mode, color property blobs.
clear_intel_crtc_state and hw readout need to be updated for these rules, which will allow us to enable 2 joined pipes.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 18 +- drivers/gpu/drm/i915/display/intel_atomic.c | 16 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_audio.c | 12 +- drivers/gpu/drm/i915/display/intel_bw.c | 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 8 +- drivers/gpu/drm/i915/display/intel_color.c | 150 ++--- drivers/gpu/drm/i915/display/intel_crt.c | 24 +- drivers/gpu/drm/i915/display/intel_ddi.c | 30 +- drivers/gpu/drm/i915/display/intel_display.c | 531 +++++++++--------- .../drm/i915/display/intel_display_types.h | 28 +- drivers/gpu/drm/i915/display/intel_dp.c | 42 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dpio_phy.c | 14 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 20 +- drivers/gpu/drm/i915/display/intel_dvo.c | 14 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 62 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 12 +- drivers/gpu/drm/i915/display/intel_panel.c | 14 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 10 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 22 +- drivers/gpu/drm/i915/display/intel_sprite.c | 25 +- drivers/gpu/drm/i915/display/intel_tv.c | 8 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 12 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 20 +- drivers/gpu/drm/i915/i915_debugfs.c | 14 +- drivers/gpu/drm/i915/intel_pm.c | 180 +++--- 30 files changed, 675 insertions(+), 639 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +9 -9
@@ -276,7 +276,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder,if (intel_dsi->dual_link ==DSI_DUAL_LINK_FRONT_BACK ) {const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;u32 dss_ctl2;u16 hactive = adjusted_mode->crtc_hdisplay;u16 dl_buffer_depth;
@@ -625,7 +625,7 @@ gen11_dsi_configure_transcoder(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); -struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->uapi.crtc);enum pipe pipe = intel_crtc->pipe;u32 tmp;enum port port;
@@ -768,7 +768,7 @@ gen11_dsi_set_transcoder_timings(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);const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;enum port port;enum transcoder dsi_trans;/* horizontal timings */
@@ -1216,7 +1216,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, {struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *=2 ;
@@ -1242,16 +1242,16 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);/* 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); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk;if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *=2 ; + pipe_config->hw.adjusted_mode.crtc_clock *=2 ;gen11_dsi_get_timings (encoder, pipe_config); pipe_config->output_types |=BIT (INTEL_OUTPUT_DSI );
@@ -1265,11 +1265,11 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, base);struct intel_connector *intel_connector = intel_dsi->attached_connector; -struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; pipe_config->output_format =INTEL_OUTPUT_FORMAT_RGB ;intel_fixed_panel_mode (fixed_mode, adjusted_mode);
drivers/gpu/drm/i915/display/intel_atomic.c +10 -6
@@ -186,13 +186,14 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector)struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc) { +const struct intel_crtc_state *old_crtc_state =to_intel_crtc_state (crtc->state);struct intel_crtc_state *crtc_state; - crtc_state =kmemdup (crtc->state,sizeof (*crtc_state),GFP_KERNEL ); + crtc_state =kmemdup (old_crtc_state,sizeof (*crtc_state),GFP_KERNEL );if (!crtc_state)return NULL ; -__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->base); +__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->uapi); crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false;
@@ -205,7 +206,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->fb_bits =0 ; crtc_state->update_planes =0 ; -return &crtc_state->base; +return &crtc_state->uapi; }/**
@@ -220,7 +221,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { -drm_atomic_helper_crtc_destroy_state (crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + +__drm_atomic_helper_crtc_destroy_state (&crtc_state->uapi); +kfree (crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state,
@@ -316,7 +320,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,struct intel_plane_state *plane_state =NULL ;struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; -struct drm_atomic_state *drm_state = crtc_state->base.state; +struct drm_atomic_state *drm_state = crtc_state->uapi.state;struct intel_atomic_state *intel_state =to_intel_atomic_state (drm_state);int num_scalers_need;int i;
@@ -384,7 +388,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,* but since this plane is unchanged just do the * minimum required validation. */ - crtc_state->base.planes_changed = true; + crtc_state->uapi.planes_changed = true; } intel_plane =to_intel_plane (plane);
drivers/gpu/drm/i915/display/intel_atomic_plane.c +3 -3
@@ -270,7 +270,7 @@ void intel_update_plane(struct intel_plane *plane,const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);trace_intel_update_plane (&plane->base, crtc); plane->update_plane (plane, crtc_state, plane_state);
@@ -280,7 +280,7 @@ void intel_update_slave(struct intel_plane *plane,const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);trace_intel_update_plane (&plane->base, crtc); plane->update_slave (plane, crtc_state, plane_state);
@@ -289,7 +289,7 @@ void intel_update_slave(struct intel_plane *plane,void intel_disable_plane (struct intel_plane *plane,const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);trace_intel_disable_plane (&plane->base, crtc); plane->disable_plane (plane, crtc_state);
drivers/gpu/drm/i915/display/intel_audio.c +6 -6
@@ -233,7 +233,7 @@ static const struct hdmi_aud_ncts hdmi_aud_ncts_36bpp[] = {static u32 audio_config_hdmi_pixel_clock (const struct intel_crtc_state *crtc_state) {const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;int i;for (i =0 ; i <ARRAY_SIZE (hdmi_audio_clock); i++) {
@@ -554,7 +554,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder, const struct drm_connector_state *old_conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;enum port port = encoder->port;u32 tmp, eldv;
@@ -600,7 +600,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_connector *connector = conn_state->connector;enum pipe pipe = crtc->pipe;enum port port = encoder->port;
@@ -689,10 +689,10 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct i915_audio_component *acomp = dev_priv->audio_component; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_connector *connector = conn_state->connector;const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;enum port port = encoder->port;enum pipe pipe = crtc->pipe;
@@ -750,7 +750,7 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct i915_audio_component *acomp = dev_priv->audio_component; -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum port port = encoder->port;enum pipe pipe = crtc->pipe;
drivers/gpu/drm/i915/display/intel_bw.c +2 -2
@@ -264,7 +264,7 @@ static unsigned int intel_bw_crtc_num_active_planes(const struct intel_crtc_statstatic unsigned int intel_bw_crtc_data_rate (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);unsigned int data_rate =0 ;enum plane_id plane_id;
@@ -285,7 +285,7 @@ static unsigned int intel_bw_crtc_data_rate(const struct intel_crtc_state *crtc_void intel_bw_crtc_update (struct intel_bw_state *bw_state,const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); bw_state->data_rate[crtc->pipe] =intel_bw_crtc_data_rate (crtc_state);
drivers/gpu/drm/i915/display/intel_cdclk.c +4 -4
@@ -2217,10 +2217,10 @@ static int intel_pixel_rate_to_cdclk(struct drm_i915_private *dev_priv,int intel_crtc_compute_min_cdclk (const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv = -to_i915 (crtc_state->base.crtc->dev); +to_i915 (crtc_state->uapi.crtc->dev);int min_cdclk; -if (!crtc_state->base.enable) +if (!crtc_state->hw.enable)return 0 ; min_cdclk =intel_pixel_rate_to_cdclk (dev_priv, crtc_state->pixel_rate);
@@ -2339,7 +2339,7 @@ static u8 cnl_compute_min_voltage_level(struct intel_atomic_state *state) sizeof(state->min_voltage_level));for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc_state->base.enable) +if (crtc_state->hw.enable) state->min_voltage_level[i] = crtc_state->min_voltage_level;else
@@ -2425,7 +2425,7 @@ static int skl_dpll0_vco(struct intel_atomic_state *state) vco = dev_priv->skl_preferred_vco_freq;for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) { -if (!crtc_state->base.enable) +if (!crtc_state->hw.enable)continue ;if (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP ))
drivers/gpu/drm/i915/display/intel_color.c +75 -75
424 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_crt.c +12 -12
@@ -132,9 +132,9 @@ static void intel_crt_get_config(struct intel_encoder *encoder, { pipe_config->output_types |=BIT (INTEL_OUTPUT_ANALOG ); - pipe_config->base.adjusted_mode.flags |=intel_crt_get_flags (encoder); + pipe_config->hw.adjusted_mode.flags |=intel_crt_get_flags (encoder); - pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; + pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; } static void hsw_crt_get_config(struct intel_encoder *encoder,
@@ -144,13 +144,13 @@ static void hsw_crt_get_config(struct intel_encoder *encoder,intel_ddi_get_config (encoder, pipe_config); - pipe_config->base.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC | + pipe_config->hw.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_NHSYNC |DRM_MODE_FLAG_PVSYNC |DRM_MODE_FLAG_NVSYNC ); - pipe_config->base.adjusted_mode.flags |=intel_crt_get_flags (encoder); + pipe_config->hw.adjusted_mode.flags |=intel_crt_get_flags (encoder); - pipe_config->base.adjusted_mode.crtc_clock =lpt_get_iclkip (dev_priv); + pipe_config->hw.adjusted_mode.crtc_clock =lpt_get_iclkip (dev_priv); }/* Note: The caller is required to filter out dpms modes not supported by the
@@ -161,8 +161,8 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crt *crt =intel_encoder_to_crt (encoder); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;u32 adpa;if (INTEL_GEN (dev_priv) >=5 )
@@ -271,7 +271,7 @@ static void hsw_pre_enable_crt(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;WARN_ON (!crtc_state->has_pch_encoder);
@@ -288,7 +288,7 @@ static void hsw_enable_crt(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;WARN_ON (!crtc_state->has_pch_encoder);
@@ -358,7 +358,7 @@ static int intel_crt_compute_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
@@ -373,7 +373,7 @@ static int pch_crt_compute_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
@@ -390,7 +390,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
drivers/gpu/drm/i915/display/intel_ddi.c +15 -15
@@ -1479,7 +1479,7 @@ static void ddi_dotclock_get(struct intel_crtc_state *pipe_config)if (pipe_config->pixel_multiplier) dotclock /= pipe_config->pixel_multiplier; - pipe_config->base.adjusted_mode.crtc_clock = dotclock; + pipe_config->hw.adjusted_mode.crtc_clock = dotclock; } static void icl_ddi_clock_get(struct intel_encoder *encoder,
@@ -1694,7 +1694,7 @@ static void intel_ddi_clock_get(struct intel_encoder *encoder,void intel_ddi_set_pipe_settings (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;u32 temp;
@@ -1748,7 +1748,7 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)void intel_ddi_set_vc_payload_alloc (const struct intel_crtc_state *crtc_state,bool state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;u32 temp;
@@ -1763,7 +1763,7 @@ void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,void intel_ddi_enable_transcoder_func (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct intel_encoder *encoder =intel_ddi_get_crtc_encoder (crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum pipe pipe = crtc->pipe;
@@ -1795,9 +1795,9 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)BUG (); } -if (crtc_state->base.adjusted_mode.flags &DRM_MODE_FLAG_PVSYNC ) +if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_PVSYNC ) temp |=TRANS_DDI_PVSYNC ; -if (crtc_state->base.adjusted_mode.flags &DRM_MODE_FLAG_PHSYNC ) +if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_PHSYNC ) temp |=TRANS_DDI_PHSYNC ;if (cpu_transcoder ==TRANSCODER_EDP ) {
@@ -1850,7 +1850,7 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)void intel_ddi_disable_transcoder_func (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;i915_reg_t reg =TRANS_DDI_FUNC_CTL (cpu_transcoder);
@@ -2145,7 +2145,7 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,void intel_ddi_enable_pipe_clock (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_encoder *encoder =intel_ddi_get_crtc_encoder (crtc);enum port port = encoder->port;
@@ -2163,7 +2163,7 @@ void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state)void intel_ddi_disable_pipe_clock (const struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;if (cpu_transcoder !=TRANSCODER_EDP ) {
@@ -3273,7 +3273,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum pipe pipe = crtc->pipe;
@@ -3694,7 +3694,7 @@ intel_ddi_update_prepare(struct intel_atomic_state *state,WARN_ON (crtc && crtc->active);intel_tc_port_get_link (enc_to_dig_port (&encoder->base), required_lanes); -if (crtc_state && crtc_state->base.active) +if (crtc_state && crtc_state->hw.active)intel_update_active_dpll (state, crtc, encoder); }
@@ -3824,7 +3824,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->uapi.crtc);enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;u32 temp, flags =0 ;
@@ -3842,7 +3842,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,else flags |=DRM_MODE_FLAG_NVSYNC ; - pipe_config->base.adjusted_mode.flags |= flags; + pipe_config->hw.adjusted_mode.flags |= flags;switch (temp &TRANS_DDI_BPC_MASK ) {case TRANS_DDI_BPC_6 :
@@ -3971,7 +3971,7 @@ static int intel_ddi_compute_config(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = encoder->port;int ret;
@@ -4102,7 +4102,7 @@ static int intel_hdmi_reset_link(struct intel_encoder *encoder,WARN_ON (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )); -if (!crtc_state->base.active) +if (!crtc_state->hw.active)return 0 ; if (!crtc_state->hdmi_high_tmds_clock_ratio &&
drivers/gpu/drm/i915/display/intel_display.c +270 -261
1,604 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display_types.h +26 -2
@@ -742,7 +742,31 @@ enum intel_output_format { };struct intel_crtc_state { -struct drm_crtc_state base; +union { +/* +* uapi (drm) state. This is the software state shown to userspace. +* In particular, the following members are used for bookkeeping: +* - crtc +* - state +* - *_changed +* - event +* - commit +* - mode_blob +*/ +struct drm_crtc_state uapi; + +/* +* actual hardware state, the state we program to the hardware. +* The following members are used to verify the hardware state: +* - enable +* - active +* - mode / adjusted_mode +* - color property blobs. +* +* During initial hw readout, they need to be copied to uapi. +*/ +struct drm_crtc_state hw; + };/** * quirks - bitfield with hw state readout quirks
@@ -1084,7 +1108,7 @@ struct cxsr_latency {#define to_intel_atomic_state (x) container_of(x, struct intel_atomic_state, base)#define to_intel_crtc (x) container_of(x, struct intel_crtc, base) -#define to_intel_crtc_state (x) container_of(x, struct intel_crtc_state, base) +#define to_intel_crtc_state (x) container_of(x, struct intel_crtc_state, uapi)#define to_intel_connector (x) container_of(x, struct intel_connector, base)#define to_intel_encoder (x) container_of(x, struct intel_encoder, base)#define to_intel_framebuffer (x) container_of(x, struct intel_framebuffer, base)
drivers/gpu/drm/i915/display/intel_dp.c +21 -21
153 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dp_mst.c +3 -3
@@ -42,13 +42,13 @@ static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,struct drm_connector_state *conn_state, struct link_config_limits *limits) { - struct drm_atomic_state *state = crtc_state->base.state; + struct drm_atomic_state *state = crtc_state->uapi.state;struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_dp *intel_dp = &intel_mst->primary->dp;struct intel_connector *connector =to_intel_connector (conn_state->connector);const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;void *port = connector->port;bool constant_n =drm_dp_has_quirk (&intel_dp->desc,DP_DPCD_QUIRK_CONSTANT_N );
@@ -99,7 +99,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (conn_state);const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;void *port = connector->port;struct link_config_limits limits;int ret;
drivers/gpu/drm/i915/display/intel_dpio_phy.c +7 -7
@@ -739,7 +739,7 @@ void chv_data_lane_soft_reset(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum dpio_channel ch =vlv_dport_to_channel (enc_to_dig_port (&encoder->base)); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;u32 val;
@@ -783,7 +783,7 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel ch =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe; unsigned int lane_mask =
@@ -864,7 +864,7 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct intel_digital_port *dport =dp_to_dig_port (intel_dp);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel ch =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;int data, i, stagger;
@@ -953,7 +953,7 @@ void chv_phy_post_pll_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -enum pipe pipe =to_intel_crtc (old_crtc_state->base.crtc)->pipe; +enum pipe pipe =to_intel_crtc (old_crtc_state->uapi.crtc)->pipe;u32 val;vlv_dpio_get (dev_priv);
@@ -1016,7 +1016,7 @@ void vlv_phy_pre_pll_enable(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;
@@ -1046,7 +1046,7 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct intel_digital_port *dport =dp_to_dig_port (intel_dp);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;u32 val;
@@ -1075,7 +1075,7 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +10 -10
@@ -136,7 +136,7 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,*/ void intel_prepare_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;
@@ -163,7 +163,7 @@ void intel_prepare_shared_dpll(const struct intel_crtc_state *crtc_state)*/ void intel_enable_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;unsigned int crtc_mask =drm_crtc_mask (&crtc->base);
@@ -208,7 +208,7 @@ void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state)*/ void intel_disable_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;unsigned int crtc_mask =drm_crtc_mask (&crtc->base);
@@ -825,7 +825,7 @@ hsw_ddi_hdmi_get_dpll(struct intel_atomic_state *state,static struct intel_shared_dpll *hsw_ddi_dp_get_dpll (struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);struct intel_shared_dpll *pll;enum intel_dpll_id pll_id;int clock = crtc_state->port_clock;
@@ -1734,7 +1734,7 @@ static bool bxt_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state, struct bxt_clk_div *clk_div) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct dpll best_clock;/* Calculate HDMI div */
@@ -2257,7 +2257,7 @@ static bool cnl_ddi_calculate_wrpll(struct intel_crtc_state *crtc_state, struct skl_wrpll_params *wrpll_params) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);u32 afe_clock = crtc_state->port_clock *5 ;u32 ref_clock;u32 dco_min =7998000 ;
@@ -2523,7 +2523,7 @@ static const struct skl_wrpll_params icl_tbt_pll_19_2MHz_values = {static bool icl_calc_dp_combo_pll (struct intel_crtc_state *crtc_state,struct skl_wrpll_params *pll_params) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);const struct icl_combo_pll_params *params = dev_priv->cdclk.hw.ref ==24000 ? icl_dp_combo_pll_24MHz_values :
@@ -2545,7 +2545,7 @@ static bool icl_calc_dp_combo_pll(struct intel_crtc_state *crtc_state,static bool icl_calc_tbt_pll (struct intel_crtc_state *crtc_state,struct skl_wrpll_params *pll_params) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev); *pll_params = dev_priv->cdclk.hw.ref ==24000 ? icl_tbt_pll_24MHz_values : icl_tbt_pll_19_2MHz_values;
@@ -2556,7 +2556,7 @@ static bool icl_calc_dpll_state(struct intel_crtc_state *crtc_state,struct intel_encoder *encoder, struct intel_dpll_hw_state *pll_state) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);u32 cfgcr0, cfgcr1;struct skl_wrpll_params pll_params = {0 };bool ret;
@@ -2682,7 +2682,7 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc,static bool icl_calc_mg_pll_state (struct intel_crtc_state *crtc_state,struct intel_dpll_hw_state *pll_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);int refclk_khz = dev_priv->cdclk.hw.ref;int clock = crtc_state->port_clock;u32 dco_khz, m1div, m2div_int, m2div_rem, m2div_frac;
drivers/gpu/drm/i915/display/intel_dvo.c +7 -7
@@ -178,9 +178,9 @@ static void intel_dvo_get_config(struct intel_encoder *encoder,else flags |=DRM_MODE_FLAG_NVSYNC ; - pipe_config->base.adjusted_mode.flags |= flags; + pipe_config->hw.adjusted_mode.flags |= flags; - pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; + pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; } static void intel_disable_dvo(struct intel_encoder *encoder,
@@ -207,8 +207,8 @@ static void intel_enable_dvo(struct intel_encoder *encoder,u32 temp =I915_READ (dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->base.mode, - &pipe_config->base.adjusted_mode); + &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode);I915_WRITE (dvo_reg, temp |DVO_ENABLE );I915_READ (dvo_reg);
@@ -253,7 +253,7 @@ static int intel_dvo_compute_config(struct intel_encoder *encoder,struct intel_dvo *intel_dvo =enc_to_dvo (encoder);const struct drm_display_mode *fixed_mode = intel_dvo->attached_connector->panel.fixed_mode; -struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; +struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;/* * If we have timings from the BIOS for the panel, put them in
@@ -277,8 +277,8 @@ static void intel_dvo_pre_enable(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); -const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;struct intel_dvo *intel_dvo =enc_to_dvo (encoder);int pipe = crtc->pipe;u32 dvo_val;
drivers/gpu/drm/i915/display/intel_fbc.c +1 -1
@@ -667,7 +667,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, cache->vma =NULL ; cache->flags =0 ; - cache->crtc.mode_flags = crtc_state->base.adjusted_mode.flags; + cache->crtc.mode_flags = crtc_state->hw.adjusted_mode.flags;if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate;
drivers/gpu/drm/i915/display/intel_hdmi.c +31 -31
154 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_lspcon.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_lvds.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_panel.c +7 -7
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_pipe_crc.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_psr.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_sdvo.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_sprite.c +13 -12
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_tv.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_vdsc.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/vlv_dsi.c +10 -10
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/intel_pm.c +89 -91
180 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Part of the diff is not shown here. View the raw message.
PATCH 3/10 drm/i915: Handle a few more cases for hw/sw split
In reply to Maarten LankhorstWe are still looking at drm_crtc_state in a few places, convert those to use intel_crtc_state instead. Look at uapi/hw where appropriate.
--- drivers/gpu/drm/i915/display/intel_display.c | 22 ++++++++++---------- drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +11 -11
@@ -11754,10 +11754,10 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,bool mode_changed =needs_modeset (pipe_config);if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv) && - mode_changed && !crtc_state->active) + mode_changed && !pipe_config->hw.active) pipe_config->update_wm_post = true; -if (mode_changed && crtc_state->enable && +if (mode_changed && pipe_config->hw.enable && dev_priv->display.crtc_compute_clock && !WARN_ON (pipe_config->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock(intel_crtc,
@@ -11771,10 +11771,10 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,* when C8 planes are getting enabled/disabled. */ if (c8_planes_changed (pipe_config)) - crtc_state->color_mgmt_changed = true; + pipe_config->uapi.color_mgmt_changed = true;if (mode_changed || pipe_config->update_pipe || - crtc_state->color_mgmt_changed) { + pipe_config->uapi.color_mgmt_changed) { ret =intel_color_check (pipe_config);if (ret)return ret;
@@ -16051,8 +16051,8 @@ static int intel_initial_commit(struct drm_device *dev) {struct drm_atomic_state *state =NULL ;struct drm_modeset_acquire_ctx ctx; -struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *crtc_state;int ret =0 ; state =drm_atomic_state_alloc (dev);
@@ -16064,15 +16064,15 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; -drm_for_each_crtc (crtc, dev) { - crtc_state =drm_atomic_get_crtc_state (state, crtc); +for_each_intel_crtc (dev, crtc) { + crtc_state =intel_atomic_get_crtc_state (state, crtc);if (IS_ERR (crtc_state)) { ret =PTR_ERR (crtc_state); goto out; } -if (crtc_state->active) { - ret =drm_atomic_add_affected_planes (state, crtc); +if (crtc_state->hw.active) { + ret =drm_atomic_add_affected_planes (state, &crtc->base);if (ret) goto out;
@@ -16082,7 +16082,7 @@ static int intel_initial_commit(struct drm_device *dev)* having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->uapi.color_mgmt_changed = true; } }
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -1
@@ -179,7 +179,7 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,if (!crtc_state || !drm_atomic_crtc_needs_modeset (crtc_state) || - crtc_state->enable) +to_intel_crtc_state (crtc_state)->hw.enable)return 0 ; }
drivers/gpu/drm/i915/display/intel_psr.c +2 -2
@@ -1025,9 +1025,9 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) intel_crtc_state =to_intel_crtc_state (crtc_state); -if (crtc_state->active && intel_crtc_state->has_psr) { +if (intel_crtc_state->hw.active && intel_crtc_state->has_psr) {/* Mark mode as changed to trigger a pipe->update() */ - crtc_state->mode_changed = true; + intel_crtc_state->uapi.mode_changed = true;break ; } }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/10 drm/i915: Complete sw/hw split
In reply to Maarten LankhorstNow that we separated everything into uapi and hw, it's time to make the split definitive. Remove the union and make a copy of the hw state on modeset and fastset.
Color blobs are copied in crtc atomic_check(), right before color management is checked.
--- drivers/gpu/drm/i915/display/intel_atomic.c | 44 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_atomic.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 39 +++++++++++++--- .../drm/i915/display/intel_display_types.h | 8 ++-- 4 files changed, 85 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic.c +44 -0
@@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->uapi); +/* copy color blobs */ +if (crtc_state->hw.degamma_lut) +drm_property_blob_get (crtc_state->hw.degamma_lut); +if (crtc_state->hw.ctm) +drm_property_blob_get (crtc_state->hw.ctm); +if (crtc_state->hw.gamma_lut) +drm_property_blob_get (crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false;
@@ -209,6 +217,41 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)return &crtc_state->uapi; } +static void intel_crtc_put_color_blobs (struct intel_crtc_state *crtc_state) +{ +drm_property_blob_put (crtc_state->hw.degamma_lut); +drm_property_blob_put (crtc_state->hw.gamma_lut); +drm_property_blob_put (crtc_state->hw.ctm); +} + +void intel_crtc_free_hw_state (struct intel_crtc_state *crtc_state) +{ +intel_crtc_put_color_blobs (crtc_state); +} + +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state) +{ +intel_crtc_put_color_blobs (crtc_state); + +if (crtc_state->uapi.degamma_lut) + crtc_state->hw.degamma_lut = +drm_property_blob_get (crtc_state->uapi.degamma_lut); +else + crtc_state->hw.degamma_lut =NULL ; + +if (crtc_state->uapi.gamma_lut) + crtc_state->hw.gamma_lut = +drm_property_blob_get (crtc_state->uapi.gamma_lut); +else + crtc_state->hw.gamma_lut =NULL ; + +if (crtc_state->uapi.ctm) + crtc_state->hw.ctm = +drm_property_blob_get (crtc_state->uapi.ctm); +else + crtc_state->hw.ctm =NULL ; +} +/** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc
@@ -224,6 +267,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc,struct intel_crtc_state *crtc_state =to_intel_crtc_state (state);__drm_atomic_helper_crtc_destroy_state (&crtc_state->uapi); +intel_crtc_free_hw_state (crtc_state);kfree (crtc_state); }
drivers/gpu/drm/i915/display/intel_atomic.h +2 -0
@@ -35,6 +35,8 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector);struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc);void intel_crtc_destroy_state (struct drm_crtc *crtc,struct drm_crtc_state *state); +void intel_crtc_free_hw_state (struct intel_crtc_state *crtc_state); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_clear (struct drm_atomic_state *state);
drivers/gpu/drm/i915/display/intel_display.c +34 -5
@@ -114,6 +114,7 @@ static const u64 cursor_format_modifiers[] = {DRM_FORMAT_MOD_INVALID }; +static void copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state);static void i9xx_crtc_clock_get (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config); static void ironlake_pch_clock_get(struct intel_crtc *crtc,
@@ -7067,6 +7068,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc, crtc->enabled = false; crtc->state->connector_mask =0 ; crtc->state->encoder_mask =0 ; +copy_uapi_to_hw_state (to_intel_crtc_state (crtc->state));for_each_encoder_on_crtc (crtc->dev, crtc, encoder) encoder->base.crtc =NULL ;
@@ -11775,6 +11777,9 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,if (mode_changed || pipe_config->update_pipe || pipe_config->uapi.color_mgmt_changed) { +/* Copy color blobs to hw state */ +intel_crtc_copy_color_blobs (pipe_config); + ret =intel_color_check (pipe_config);if (ret)return ret;
@@ -12214,6 +12219,22 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state)return ret; } +static void copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state) +{ + crtc_state->hw.enable = crtc_state->uapi.enable; + crtc_state->hw.active = crtc_state->uapi.active; + crtc_state->hw.mode = crtc_state->uapi.mode; + crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; +} + +static void copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +{ + crtc_state->uapi.enable = crtc_state->hw.enable; + crtc_state->uapi.active = crtc_state->hw.active; + crtc_state->uapi.mode = crtc_state->hw.mode; + crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode; +} +static int clear_intel_crtc_state (struct intel_crtc_state *crtc_state) {
@@ -12230,6 +12251,7 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)* fixed, so that the crtc_state can be safely duplicated. For now, * only fields that are know to not cause problems are preserved. */ + saved_state->uapi = crtc_state->uapi; saved_state->scaler_state = crtc_state->scaler_state; saved_state->shared_dpll = crtc_state->shared_dpll; saved_state->dpll_hw_state = crtc_state->dpll_hw_state;
@@ -12240,11 +12262,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) saved_state->wm = crtc_state->wm; -/* Keep base drm_crtc_state intact, only clear our extended struct */ -BUILD_BUG_ON (offsetof(struct intel_crtc_state , uapi)); -BUILD_BUG_ON (offsetof(struct intel_crtc_state , hw)); -memcpy (&crtc_state->uapi +1 , &saved_state->uapi +1 , -sizeof (*crtc_state) -sizeof (crtc_state->uapi)); +intel_crtc_free_hw_state (crtc_state); +memcpy (crtc_state, saved_state,sizeof (*crtc_state)); +copy_uapi_to_hw_state (crtc_state);kfree (saved_state);return 0 ;
@@ -12384,6 +12404,9 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)DRM_DEBUG_KMS ("hw max bpp: %i, pipe bpp: %i, dithering: %i\n" , base_bpp, pipe_config->pipe_bpp, pipe_config->dither); +/* uapi wants a copy of the adjusted_mode for vblank bookkeeping */ + pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +return 0 ; }
@@ -13079,6 +13102,8 @@ verify_crtc_state(struct intel_crtc *crtc, state = old_crtc_state->uapi.state;__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->uapi); +intel_crtc_free_hw_state (old_crtc_state); + pipe_config = old_crtc_state;memset (pipe_config,0 ,sizeof (*pipe_config)); pipe_config->uapi.crtc = &crtc->base;
@@ -13620,6 +13645,7 @@ static int intel_atomic_check(struct drm_device *dev,if (!new_crtc_state->uapi.enable) { any_ms = true; +clear_intel_crtc_state (new_crtc_state);continue ; }
@@ -16652,6 +16678,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)to_intel_crtc_state (crtc->base.state);__drm_atomic_helper_crtc_destroy_state (&crtc_state->uapi); +intel_crtc_free_hw_state (crtc_state);memset (crtc_state,0 ,sizeof (*crtc_state));__drm_atomic_helper_crtc_reset (&crtc->base, &crtc_state->uapi);
@@ -16768,6 +16795,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc->base.mode.vdisplay = crtc_state->pipe_src_h;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); + crtc_state->hw.mode = crtc->base.mode;WARN_ON (drm_atomic_set_mode_for_crtc (crtc->base.state, &crtc->base.mode));/*
@@ -16813,6 +16841,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)intel_bw_crtc_update (bw_state, crtc_state); +copy_hw_to_uapi_state (crtc_state);intel_pipe_config_sanity_check (dev_priv, crtc_state); } }
drivers/gpu/drm/i915/display/intel_display_types.h +5 -3
@@ -742,7 +742,6 @@ enum intel_output_format { };struct intel_crtc_state { -union {/* * uapi (drm) state. This is the software state shown to userspace. * In particular, the following members are used for bookkeeping:
@@ -765,8 +764,11 @@ struct intel_crtc_state {* * During initial hw readout, they need to be copied to uapi. */ -struct drm_crtc_state hw; - }; +struct { +bool active, enable; +struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; +struct drm_display_mode mode, adjusted_mode; + } hw;/** * quirks - bitfield with hw state readout quirks
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/10 drm/i915: Kill off is_planar_yuv_format
In reply to Maarten LankhorstInstead of relying on the fourcc, use the drm fourcc helper drm_format_info_is_yuv_semiplanar().
--- .../gpu/drm/i915/display/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/display/intel_display.c | 10 +++++----- drivers/gpu/drm/i915/display/intel_display.h | 4 +++- drivers/gpu/drm/i915/display/intel_sprite.c | 19 +++---------------- drivers/gpu/drm/i915/display/intel_sprite.h | 1 - drivers/gpu/drm/i915/intel_pm.c | 12 +++++------- 6 files changed, 17 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic_plane.c +1 -1
@@ -164,7 +164,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->active_planes |=BIT (plane->id);if (new_plane_state->base.visible && -is_planar_yuv_format (new_plane_state->base.fb->format->format)) +drm_format_info_is_yuv_semiplanar (new_plane_state->base.fb->format)) new_crtc_state->nv12_planes |=BIT (plane->id); if (new_plane_state->base.visible &&
drivers/gpu/drm/i915/display/intel_display.c +5 -5
@@ -3529,7 +3529,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)* Handle the AUX surface first since * the main surface setup depends on it. */ -if (is_planar_yuv_format (fb->format->format)) { +if (drm_format_info_is_yuv_semiplanar (fb->format)) { ret =skl_check_nv12_aux_surface (plane_state);if (ret)return ret;
@@ -5447,7 +5447,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,return 0 ; } -if (format &&is_planar_yuv_format (format->format) && +if (format &&drm_format_info_is_yuv_semiplanar (format) && (src_h <SKL_MIN_YUV_420_SRC_H || src_w <SKL_MIN_YUV_420_SRC_W )) {DRM_DEBUG_KMS ("Planar YUV: src dimensions not met\n" );return -EINVAL ;
@@ -5524,7 +5524,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,/* Pre-gen11 and SDR planes always need a scaler for planar formats. */ if (!icl_is_hdr_plane (dev_priv, intel_plane->id) && - fb &&is_planar_yuv_format (fb->format->format)) + fb &&drm_format_info_is_yuv_semiplanar (fb->format)) need_scaler = true; ret = skl_update_scaler(crtc_state, force_detach,
@@ -14500,7 +14500,7 @@ intel_cleanup_plane_fb(struct drm_plane *plane,int skl_max_scale (const struct intel_crtc_state *crtc_state, -u32 pixel_format) +const struct drm_format_info *pixel_format) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);
@@ -14525,7 +14525,7 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,* or * cdclk/crtc_clock */ - mult =is_planar_yuv_format (pixel_format) ?2 :3 ; + mult =drm_format_info_is_yuv_semiplanar (pixel_format) ?2 :3 ; tmpclk1 = (1 <<16 ) * mult -1 ; tmpclk2 = (1 <<8 ) * ((max_dotclk <<8 ) / crtc_clock); max_scale =min (tmpclk1, tmpclk2);
drivers/gpu/drm/i915/display/intel_display.h +3 -1
@@ -34,6 +34,7 @@ struct drm_connector;struct drm_device ;struct drm_encoder ;struct drm_file ; +struct drm_format_info ;struct drm_framebuffer ;struct drm_i915_error_state_buf ;struct drm_i915_gem_object ;
@@ -521,7 +522,8 @@ void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc,u16 skl_scaler_calc_phase (int sub,int scale,bool chroma_center);int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state);int skl_max_scale (const struct intel_crtc_state *crtc_state, -u32 pixel_format); +const struct drm_format_info *format); +u32 glk_plane_color_ctl (const struct intel_crtc_state *crtc_state,const struct intel_plane_state *plane_state);u32 glk_plane_color_ctl_crtc (const struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/display/intel_sprite.c +3 -16
@@ -48,19 +48,6 @@#include "intel_psr.h" #include "intel_sprite.h" -bool is_planar_yuv_format (u32 pixelformat) -{ -switch (pixelformat) { -case DRM_FORMAT_NV12 : -case DRM_FORMAT_P010 : -case DRM_FORMAT_P012 : -case DRM_FORMAT_P016 : -return true; -default : -return false; - } -} -int intel_usecs_to_scanlines (const struct drm_display_mode *adjusted_mode,int usecs) {
@@ -382,7 +369,7 @@ skl_program_scaler(struct intel_plane *plane, 0, INT_MAX);/* TODO: handle sub-pixel coordinates */ -if (is_planar_yuv_format (plane_state->base.fb->format->format) && +if (drm_format_info_is_yuv_semiplanar (plane_state->base.fb->format) && !icl_is_hdr_plane (dev_priv, plane->id)) { y_hphase =skl_scaler_calc_phase (1 , hscale, false); y_vphase =skl_scaler_calc_phase (1 , vscale, false);
@@ -1791,7 +1778,7 @@ static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_sint src_w =drm_rect_width (&plane_state->base.src) >>16 ;/* Display WA #1106 */ -if (is_planar_yuv_format (fb->format->format) && src_w &3 && +if (drm_format_info_is_yuv_semiplanar (fb->format) && src_w &3 && (rotation ==DRM_MODE_ROTATE_270 || rotation == (DRM_MODE_REFLECT_X |DRM_MODE_ROTATE_90 ))) {DRM_DEBUG_KMS ("src width must be multiple of 4 for rotated planar YUV\n" );
@@ -1818,7 +1805,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,/* use scaler when colorkey is not required */ if (!plane_state->ckey.flags &&intel_fb_scalable (fb)) { min_scale =1 ; - max_scale =skl_max_scale (crtc_state, fb->format->format); + max_scale =skl_max_scale (crtc_state, fb->format); } ret = drm_atomic_helper_check_plane_state(&plane_state->base,
drivers/gpu/drm/i915/display/intel_sprite.h +0 -1
@@ -17,7 +17,6 @@ struct drm_i915_private;struct intel_crtc_state ;struct intel_plane_state ; -bool is_planar_yuv_format (u32 pixelformat);int intel_usecs_to_scanlines (const struct drm_display_mode *adjusted_mode,int usecs); struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_pm.c +5 -7
@@ -4003,7 +4003,7 @@ skl_ddb_get_hw_plane_state(struct drm_i915_private *dev_priv, val =I915_READ (PLANE_BUF_CFG (pipe, plane_id)); val2 =I915_READ (PLANE_NV12_BUF_CFG (pipe, plane_id)); -if (is_planar_yuv_format (fourcc)) +if (drm_format_info_is_yuv_semiplanar (drm_format_info (fourcc)))swap (val, val2);skl_ddb_entry_init_from_hw (dev_priv, ddb_y, val);
@@ -4197,7 +4197,6 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,u32 data_rate;u32 width =0 , height =0 ;struct drm_framebuffer *fb; -u32 format;uint_fixed_16_16_t down_scale_amount;u64 rate;
@@ -4205,11 +4204,10 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,return 0 ; fb = plane_state->base.fb; - format = fb->format->format;if (intel_plane->id ==PLANE_CURSOR )return 0 ; -if (plane ==1 && !is_planar_yuv_format (format)) +if (plane ==1 && !drm_format_info_is_yuv_semiplanar (fb->format))return 0 ;/*
@@ -4221,7 +4219,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state, height =drm_rect_height (&plane_state->base.src) >>16 ;/* UV plane does 1/2 pixel sub-sampling */ -if (plane ==1 &&is_planar_yuv_format (format)) { +if (plane ==1 &&drm_format_info_is_yuv_semiplanar (fb->format)) { width /=2 ; height /=2 ; }
@@ -4637,7 +4635,7 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state,u32 interm_pbpl;/* only planar format has two planes */ -if (color_plane ==1 && !is_planar_yuv_format (format->format)) { +if (color_plane ==1 && !drm_format_info_is_yuv_semiplanar (format)) {DRM_DEBUG_KMS ("Non planar format have single plane\n" );return -EINVAL ; }
@@ -4649,7 +4647,7 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state, wp->x_tiled = modifier ==I915_FORMAT_MOD_X_TILED ; wp->rc_surface = modifier ==I915_FORMAT_MOD_Y_TILED_CCS || modifier == I915_FORMAT_MOD_Yf_TILED_CCS; - wp->is_planar =is_planar_yuv_format (format->format); + wp->is_planar =drm_format_info_is_yuv_semiplanar (format); wp->width = width;if (color_plane ==1 && wp->is_planar)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/10 drm/i915: Get rid of crtc_state->fb_changed
In reply to Maarten LankhorstWe had this as an optimization to not do a plane update, but we killed it off because there are so many reasons we may have to do a plane update or fastset that it's best to just assume everything changed.
--- drivers/gpu/drm/i915/display/intel_atomic.c | 1 - drivers/gpu/drm/i915/display/intel_display.c | 10 +--------- drivers/gpu/drm/i915/display/intel_display_types.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic.c +0 -1
@@ -208,7 +208,6 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->disable_cxsr = false; crtc_state->update_wm_pre = false; crtc_state->update_wm_post = false; - crtc_state->fb_changed = false; crtc_state->fifo_changed = false; crtc_state->wm.need_postvbl_update = false; crtc_state->fb_bits =0 ;
drivers/gpu/drm/i915/display/intel_display.c +1 -9
@@ -11491,7 +11491,6 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_statbool was_crtc_enabled = old_crtc_state->hw.active;bool is_crtc_enabled = crtc_state->hw.active;bool turn_off, turn_on, visible, was_visible; -struct drm_framebuffer *fb = plane_state->base.fb;int ret;if (INTEL_GEN (dev_priv) >=9 && plane->id !=PLANE_CURSOR ) {
@@ -11525,18 +11524,11 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_statif (!was_visible && !visible)return 0 ; -if (fb != old_plane_state->base.fb) - crtc_state->fb_changed = true; - turn_off = was_visible && (!visible || mode_changed); turn_on = visible && (!was_visible || mode_changed); -DRM_DEBUG_ATOMIC ("[CRTC:%d:%s] has [PLANE:%d:%s] with fb %i\n" , +DRM_DEBUG_ATOMIC ("[CRTC:%d:%s] with [PLANE:%d:%s] visible %i -> %i, off %i, on %i, ms %i\n" , crtc->base.base.id, crtc->base.name, - plane->base.base.id, plane->base.name, - fb ? fb->base.id :-1 ); - -DRM_DEBUG_ATOMIC ("[PLANE:%d:%s] visible %i -> %i, off %i, on %i, ms %i\n" , plane->base.base.id, plane->base.name, was_visible, visible, turn_off, turn_on, mode_changed);
drivers/gpu/drm/i915/display/intel_display_types.h +0 -1
@@ -785,7 +785,6 @@ struct intel_crtc_state {bool update_pipe;/* can a fast modeset be performed? */ bool disable_cxsr;bool update_wm_pre, update_wm_post;/* watermarks are updated */ -bool fb_changed;/* fb on any of the planes is changed */ bool fifo_changed;/* FIFO split is changed */ /* Pipe source size (ie. panel fitter input size)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/10 drm/i915: Remove begin/finish_crtc_commit.
In reply to Maarten LankhorstThis can all be done from the intel_update_crtc function. Split out the pipe update into a separate function, just like is done for the planes.
--- drivers/gpu/drm/i915/display/intel_display.c | 124 ++++++++----------- 1 file changed, 52 insertions(+), 72 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +52 -72
@@ -136,8 +136,6 @@ static void vlv_prepare_pll(struct intel_crtc *crtc, const struct intel_crtc_state *pipe_config);static void chv_prepare_pll (struct intel_crtc *crtc,const struct intel_crtc_state *pipe_config); -static void intel_begin_crtc_commit (struct intel_atomic_state *,struct intel_crtc *); -static void intel_finish_crtc_commit (struct intel_atomic_state *,struct intel_crtc *);static void intel_crtc_init_scalers (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state);static void skylake_pfit_enable (const struct intel_crtc_state *crtc_state);
@@ -13725,13 +13723,54 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)return crtc->base.funcs->get_vblank_counter (&crtc->base); } +void intel_crtc_arm_fifo_underrun (struct intel_crtc *crtc, +struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); + +if (!IS_GEN (dev_priv,2 )) +intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, true); + +if (crtc_state->has_pch_encoder) { +enum pipe pch_transcoder = +intel_crtc_pch_transcoder (crtc); + +intel_set_pch_fifo_underrun_reporting (dev_priv, pch_transcoder, true); + } +} + +static void commit_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +bool modeset =needs_modeset (new_crtc_state); + +if (!modeset) { +if (new_crtc_state->uapi.color_mgmt_changed || + new_crtc_state->update_pipe) +intel_color_commit (new_crtc_state); + +if (new_crtc_state->update_pipe) +intel_update_pipe_config (old_crtc_state, new_crtc_state); +else if (INTEL_GEN (dev_priv) >=9 ) +skl_detach_scalers (new_crtc_state); + +if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) +bdw_set_pipemisc (new_crtc_state); + } + +if (dev_priv->display.atomic_update_watermarks) + dev_priv->display.atomic_update_watermarks (state, + new_crtc_state); +} +static void intel_update_crtc (struct intel_crtc *crtc,struct intel_atomic_state *state,struct intel_crtc_state *old_crtc_state,struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = state->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (state->base.dev);bool modeset =needs_modeset (new_crtc_state);struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state,
@@ -13755,14 +13794,21 @@ static void intel_update_crtc(struct intel_crtc *crtc,else if (new_plane_state)intel_fbc_enable (crtc, new_crtc_state, new_plane_state); -intel_begin_crtc_commit (state, crtc); +/* Perform vblank evasion around commit operation */ +intel_pipe_update_start (new_crtc_state); + +commit_pipe_config (state, old_crtc_state, new_crtc_state);if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc); -intel_finish_crtc_commit (state, crtc); +intel_pipe_update_end (new_crtc_state); + +if (new_crtc_state->update_pipe && !modeset && + old_crtc_state->hw.mode.private_flags &I915_MODE_FLAG_INHERITED ) +intel_crtc_arm_fifo_underrun (crtc, new_crtc_state); }static void intel_update_crtcs (struct intel_atomic_state *state)
@@ -14525,72 +14571,6 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,return max_scale; } -static void intel_begin_crtc_commit (struct intel_atomic_state *state, -struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -struct intel_crtc_state *old_crtc_state = -intel_atomic_get_old_crtc_state (state, crtc); -struct intel_crtc_state *new_crtc_state = -intel_atomic_get_new_crtc_state (state, crtc); -bool modeset =needs_modeset (new_crtc_state); - -/* Perform vblank evasion around commit operation */ -intel_pipe_update_start (new_crtc_state); - -if (modeset) - goto out; - -if (new_crtc_state->uapi.color_mgmt_changed || - new_crtc_state->update_pipe) -intel_color_commit (new_crtc_state); - -if (new_crtc_state->update_pipe) -intel_update_pipe_config (old_crtc_state, new_crtc_state); -else if (INTEL_GEN (dev_priv) >=9 ) -skl_detach_scalers (new_crtc_state); - -if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) -bdw_set_pipemisc (new_crtc_state); - -out: -if (dev_priv->display.atomic_update_watermarks) - dev_priv->display.atomic_update_watermarks (state, - new_crtc_state); -} - -void intel_crtc_arm_fifo_underrun (struct intel_crtc *crtc, -struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); - -if (!IS_GEN (dev_priv,2 )) -intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, true); - -if (crtc_state->has_pch_encoder) { -enum pipe pch_transcoder = -intel_crtc_pch_transcoder (crtc); - -intel_set_pch_fifo_underrun_reporting (dev_priv, pch_transcoder, true); - } -} - -static void intel_finish_crtc_commit (struct intel_atomic_state *state, -struct intel_crtc *crtc) -{ -struct intel_crtc_state *old_crtc_state = -intel_atomic_get_old_crtc_state (state, crtc); -struct intel_crtc_state *new_crtc_state = -intel_atomic_get_new_crtc_state (state, crtc); - -intel_pipe_update_end (new_crtc_state); - -if (new_crtc_state->update_pipe && - !needs_modeset (new_crtc_state) && - old_crtc_state->hw.mode.private_flags &I915_MODE_FLAG_INHERITED ) -intel_crtc_arm_fifo_underrun (crtc, new_crtc_state); -} -/** * intel_plane_destroy - destroy a plane * @plane: plane to destroy
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/10 drm/i915: Do not add all planes when checking scalers on glk+
In reply to Maarten LankhorstWe cannot switch between HQ and normal mode on GLK+, so only add planes on platforms where it makes sense.
We could probably restrict it even more to only add when scaler users toggles between 1 and 2, but lets just leave it for now.
--- drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/display/intel_atomic.c +5 -0
@@ -418,6 +418,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,*/ if (!plane) {struct drm_plane_state *state; + +/* No need to reprogram, we're not changing scaling mode */ +if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) +continue ; + plane =drm_plane_from_index (&dev_priv->drm, i); state =drm_atomic_get_plane_state (drm_state, plane);if (IS_ERR (state)) {
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/10 drm/i915: Add debugfs entries for reading out DPCD DSC and FEC.
In reply to Maarten LankhorstDump the DSC and FEC in i915_dpcd as well. This is useful when debugging the link caps.
--- drivers/gpu/drm/i915/i915_debugfs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +2 -0
@@ -4396,8 +4396,10 @@ struct dpcd_block {static const struct dpcd_block i915_dpcd_debug[] = { { .offset =DP_DPCD_REV , .size =DP_RECEIVER_CAP_SIZE }, + { .offset =DP_DSC_SUPPORT , .end =DP_DSC_BITS_PER_PIXEL_INC }, { .offset =DP_PSR_SUPPORT , .end =DP_PSR_CAPS }, { .offset =DP_DOWNSTREAM_PORT_0 , .size =16 }, + { .offset =DP_FEC_CAPABILITY }, { .offset =DP_LINK_BW_SET , .end =DP_EDP_CONFIGURATION_SET }, { .offset =DP_SINK_COUNT , .end =DP_ADJUST_REQUEST_LANE2_3 }, { .offset =DP_SET_POWER },
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/10 drm/i915: Move FEC enable timeout wait to enable_ddi_dp
In reply to Maarten LankhorstEven without bigjoiner I get a timeout when enabling FEC, the length of the timeout doesn't matter, still happens with 10s timeout.
It seems that DP-MST waits for ACT in enable_dp() so we could postpone it in normal bringup in a similar way, just to be sure.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +5 -4
@@ -3138,10 +3138,6 @@ static void intel_ddi_enable_fec(struct intel_encoder *encoder, val =I915_READ (DP_TP_CTL (port)); val |=DP_TP_CTL_FEC_ENABLE ;I915_WRITE (DP_TP_CTL (port), val); - -if (intel_de_wait_for_set (dev_priv,DP_TP_STATUS (port), -DP_TP_STATUS_FEC_ENABLE_LIVE ,1 )) -DRM_ERROR ("Timed out waiting for FEC Enable Status\n" ); } static void intel_ddi_disable_fec_state(struct intel_encoder *encoder,
@@ -3473,6 +3469,11 @@ static void intel_enable_ddi_dp(struct intel_encoder *encoder,if (port ==PORT_A &&INTEL_GEN (dev_priv) <9 )intel_dp_stop_link_train (intel_dp); +if (crtc_state->fec_enable && +intel_de_wait_for_set (dev_priv,DP_TP_STATUS (port), +DP_TP_STATUS_FEC_ENABLE_LIVE ,1 )) +DRM_ERROR ("Timed out waiting for FEC Enable Status\n" ); +intel_edp_backlight_on (crtc_state, conn_state);intel_psr_enable (intel_dp, crtc_state);intel_dp_ycbcr_420_enable (intel_dp, crtc_state);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915: Bigjoiner preparations.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Bigjoiner preparations.
URL : https://patchwork.freedesktop.org/series/65543/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip bb9674943922 drm/i915/dp: Fix dsc bpp calculations. 0e2d405f7bbf drm/i915: Prepare to split crtc state in uapi and hw state -:11: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #11: - crtc, *_changed flags, event, commit, state, mode_blob, (plane/connector/encoder)_mask.
-:1976: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #1976: FILE: drivers/gpu/drm/i915/display/intel_display.c:11171:
+ crtc_state->uapi.active = crtc_state->uapi.enable = true;
-:2646: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #2646: FILE: drivers/gpu/drm/i915/display/intel_display.c:16658:
+ crtc_state->hw.active = crtc_state->hw.enable =
-:3798: ERROR:CODE_INDENT: code indent should use tabs where possible #3798: FILE: drivers/gpu/drm/i915/display/intel_sprite.c:224:
+^I^I^I^I new_crtc_state->uapi.event);$
-:3798: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #3798: FILE: drivers/gpu/drm/i915/display/intel_sprite.c:224:
+ drm_crtc_arm_vblank_event(&crtc->base,
+ new_crtc_state->uapi.event);
total: 1 errors, 1 warnings, 3 checks, 4194 lines checked15321f86c2b3 drm/i915: Handle a few more cases for hw/sw split4c4ad0feadf2 drm/i915: Complete sw/hw split8bc9c0b2e0a0 drm/i915: Kill off is_planar_yuv_format782d5f4e19cc drm/i915: Get rid of crtc_state->fb_changed2c4f08fcf5ee drm/i915: Remove begin/finish_crtc_commit.bb6ec153c77c drm/i915: Do not add all planes when checking scalers on glk+c3e067461453 drm/i915: Add debugfs entries for reading out DPCD DSC and FEC.1f51e8536ef9 drm/i915: Move FEC enable timeout wait to enable_ddi_dp
-:6: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #6:
Even without bigjoiner I get a timeout when enabling FEC, the length of the timeout
total: 0 errors, 1 warnings, 0 checks, 21 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Bigjoiner preparations.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Bigjoiner preparations.
URL : https://patchwork.freedesktop.org/series/65543/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6755 -> Patchwork_14122
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_14122 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_14122, 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_14122/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_14122:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_suspend@basic-s3:
- fi-kbl-r: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-kbl-r/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-kbl-r/igt@[email protected]
- fi-whl-u: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-whl-u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-whl-u/igt@[email protected]
* igt@i915_selftest@live_execlists:
- fi-icl-u2: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u2/igt@i915_selftest@live_execlists.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u2/igt@i915_selftest@live_execlists.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_selftest@live_execlists:
- {fi-icl-dsi}: [PASS][7] -> [DMESG-FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-dsi/igt@i915_selftest@live_execlists.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-dsi/igt@i915_selftest@live_execlists.html
Known issues
------------
Here are the changes found in Patchwork_14122 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-skl-6770hq: [PASS][9] -> [INCOMPLETE][10] ([fdo#104108])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-skl-6770hq/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-skl-6770hq/igt@[email protected]
- fi-skl-6260u: [PASS][11] -> [INCOMPLETE][12] ([fdo#104108])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-skl-6260u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-skl-6260u/igt@[email protected]
- fi-kbl-7567u: [PASS][13] -> [INCOMPLETE][14] ([fdo#103665])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-kbl-7567u/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-kbl-7567u/igt@[email protected]
- fi-apl-guc: [PASS][15] -> [INCOMPLETE][16] ([fdo#103927] / [fdo#108743])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-apl-guc/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-apl-guc/igt@[email protected]
- fi-skl-6600u: [PASS][17] -> [INCOMPLETE][18] ([fdo#104108])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-skl-6600u/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-skl-6600u/igt@[email protected]
* igt@gem_tiled_pread_basic:
- fi-icl-u3: [PASS][19] -> [DMESG-WARN][20] ([fdo#107724])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u3/igt@gem_tiled_pread_basic.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u3/igt@gem_tiled_pread_basic.html
* igt@i915_module_load@reload:
- fi-blb-e6850: [PASS][21] -> [INCOMPLETE][22] ([fdo#107718])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-blb-e6850/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-blb-e6850/igt@[email protected]
#### Possible fixes ####
* igt@gem_linear_blits@basic:
- fi-icl-u3: [DMESG-WARN][23] ([fdo#107724]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u3/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u3/igt@[email protected]
* igt@kms_chamelium@hdmi-edid-read:
- {fi-icl-u4}: [FAIL][25] ([fdo#111045]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u4/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [FAIL][27] ([fdo#103167]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u2/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u2/igt@[email protected]
#### Warnings ####
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-icl-u2: [DMESG-WARN][29] ([fdo#102505] / [fdo#110390]) -> [FAIL][30] ([fdo#109483])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6755/fi-icl-u2/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/fi-icl-u2/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#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108743]: https://bugs.freedesktop.org/show_bug.cgi?id=108743
[fdo#109483]: https://bugs.freedesktop.org/show_bug.cgi?id=109483
[fdo#110390]: https://bugs.freedesktop.org/show_bug.cgi?id=110390
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
Participating hosts (57 -> 40)
------------------------------
Missing (17): fi-kbl-soraka fi-cml-u2 fi-ilk-m540 fi-bxt-dsi fi-hsw-4200u fi-skl-guc fi-glk-dsi fi-byt-squawks fi-bsw-cyan fi-cfl-guc fi-ctg-p8600 fi-kbl-x1275 fi-skl-iommu fi-icl-y fi-bdw-samus fi-byt-clapper fi-skl-6700k2
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6755 -> Patchwork_14122
CI-20190529: 20190529
CI_DRM_6755: 8ef0018b4afe55bff6f538b2125a72250a8bf67f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5146: 357dbe1869d88a2f08bcee4eebceff4ee9014424 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14122: 1f51e8536ef912cc9f94fe52522056a240b1e3ac @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
1f51e8536ef9 drm/i915: Move FEC enable timeout wait to enable_ddi_dp c3e067461453 drm/i915: Add debugfs entries for reading out DPCD DSC and FEC. bb6ec153c77c drm/i915: Do not add all planes when checking scalers on glk+ 2c4f08fcf5ee drm/i915: Remove begin/finish_crtc_commit. 782d5f4e19cc drm/i915: Get rid of crtc_state->fb_changed 8bc9c0b2e0a0 drm/i915: Kill off is_planar_yuv_format 4c4ad0feadf2 drm/i915: Complete sw/hw split15321f86c2b3 drm/i915: Handle a few more cases for hw/sw split 0e2d405f7bbf drm/i915: Prepare to split crtc state in uapi and hw state bb9674943922 drm/i915/dp: Fix dsc bpp calculations.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14122/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/10] drm/i915/dp: Fix dsc bpp calculations.
In reply to Maarten LankhorstQuoted 3 lines · Maarten Lankhorst
There was a integer wraparound when
mode_clockbecame too high, and we didn't correct for the FEC overhead factor when dividing, also the calculations would break at HBR3.
But the mode_clock is obtained from the adusted_mode->crtc_clock which is defined as an int in drm_mode_config struct, does that need to change also?
Quoted 21 lines
As a result our calculated bpp was way too high, and the link width bpp limitation never came into effect.
Print out the resulting bpp calcululations as a sanity check, just in case we ever have to debug it later on again.
Signed-off-by Maarten Lankhorst <[email protected]>Fixes d9218c8f6cf4 ("drm/i915/dp: Add helpers for Compressed BPP and Slice Count for DSC")Cc <[email protected]> # v5.0+Cc Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++------- drivers/gpu/drm/i915/display/intel_dp.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/display/intel_dp.c +0
-0
drivers/gpu/drm/i915/display/intel_dp.c intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) · line 4329
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-3@@ -4323,10 +4323,10 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)DP_DPRX_ESI_LEN ; } -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay) +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay) { -u16 bits_per_pixel, max_bpp_small_joiner_ram; +u32 bits_per_pixel, max_bpp_small_joiner_ram;
But bits_per_pixel is a 16 bit value for DSC PPS, why does this need to be u32?
drivers/gpu/drm/i915/display/intel_dp.c u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count, · line 4339
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-3int i;/* @@ -4335,13 +4335,14 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,* FECOverhead = 2.4%, for SST -> TimeSlotsPerMTP is 1, * for MST -> TimeSlotsPerMTP has to be calculated */ - bits_per_pixel = (link_clock * lane_count *8 * -DP_DSC_FEC_OVERHEAD_FACTOR ) / - mode_clock; + bits_per_pixel =div_u64 ((u64 )link_clock * lane_count *8 * +DP_DSC_FEC_OVERHEAD_FACTOR ,1000ULL * mode_clock);
Thanks for catching this, this had the 1000 in the denominator in my original patches :https://patchwork.freedesktop.org/series/47514/#rev3 And then the nex rev lost it somehow, so thanks for catching this
Manasi
Quoted 37 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-1+DRM_DEBUG_KMS ("Max link bpp: %u\n" , bits_per_pixel);/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =DP_DSC_MAX_SMALL_JOINER_RAM_BUFFER / mode_hdisplay; +DRM_DEBUG_KMS ("Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);/* * Greatest allowed DSC BPP = MIN (output BPP from avaialble Link BW @@ -4351,7 +4352,8 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { -DRM_DEBUG_KMS ("Unsupported BPP %d\n" , bits_per_pixel); +DRM_DEBUG_KMS ("Unsupported BPP %u, min %u\n" , + bits_per_pixel, valid_dsc_bpp[0 ]);return 0 ; }drivers/gpu/drm/i915/display/intel_dp.h +2
-2@@ -102,8 +102,8 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_source_supports_hbr3 (struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,u8 *link_status); -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay); +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay);u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp,int mode_clock,int mode_hdisplay);Signature · 1 line
2.20.1
Re: [PATCH 07/10] drm/i915: Remove begin/finish_crtc_commit.
In reply to Maarten LankhorstQuoted 118 lines · Maarten Lankhorst
This can all be done from the
intel_update_crtcfunction. Split out the
pipe update into a separate function, just like is done for the planes.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 124 ++++++++--------- -- 1 file changed, 52 insertions(+), 72 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-1@@ -136,8 +136,6 @@ static void vlv_prepare_pll(struct intel_crtc *crtc, const struct intel_crtc_state *pipe_config);static void chv_prepare_pll (struct intel_crtc *crtc,const struct intel_crtc_state *pipe_config); -static void intel_begin_crtc_commit(struct intel_atomic_state *,struct
intel_crtc*);
-static voidintel_finish_crtc_commit(struct intel_atomic_state *, struct intel_crtc *);
static void intel_crtc_init_scalers(structintel_crtc*crtc,
structintel_crtc_state*crtc_state);
static void skylake_pfit_enable(const structintel_crtc_state*crtc_state);drivers/gpu/drm/i915/display/intel_display.c +52
-4@@ -13725,13 +13723,54 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)return crtc->base.funcs->get_vblank_counter (&crtc->base); } +void intel_crtc_arm_fifo_underrun (struct intel_crtc *crtc, +struct intel_crtc_state *crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); + +if (!IS_GEN (dev_priv,2 )) +intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc- >pipe, true); + +if (crtc_state->has_pch_encoder) { +enum pipe pch_transcoder = +intel_crtc_pch_transcoder (crtc); + +intel_set_pch_fifo_underrun_reporting (dev_priv, pch_transcoder, true); + } +} + +static void commit_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) +{ +struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +bool modeset =needs_modeset (new_crtc_state); + +if (!modeset) { +if (new_crtc_state->uapi.color_mgmt_changed || + new_crtc_state->update_pipe) +intel_color_commit (new_crtc_state); + +if (new_crtc_state->update_pipe) +intel_update_pipe_config (old_crtc_state, new_crtc_state); +else if (INTEL_GEN (dev_priv) >=9 ) +skl_detach_scalers (new_crtc_state); + +if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) +bdw_set_pipemisc (new_crtc_state); + } + +if (dev_priv->display.atomic_update_watermarks) + dev_priv->display.atomic_update_watermarks (state, + new_crtc_sta te); +} +static void intel_update_crtc (struct intel_crtc *crtc,struct intel_atomic_state *state,struct intel_crtc_state *old_crtc_state,struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = state->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (state->base.dev);bool modeset =needs_modeset (new_crtc_state);struct intel_plane_state *new_plane_state = intel_atomic_get_new_plane_state(state,@@ -13755,14 +13794,21 @@ static void intel_update_crtc(structintel_crtc *crtc, else if (new_plane_state) intel_fbc_enable(crtc, new_crtc_state, new_plane_state); -intel_begin_crtc_commit (state ,crtc ); +/* Perform vblank evasion around commit operation */ +intel_pipe_update_start (new_crtc_state ); + +commit_pipe_config (state, old_crtc_state, new_crtc_state);if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc); -intel_finish_crtc_commit (state, crtc); +intel_pipe_update_end (new_crtc_state); + +if (new_crtc_state->update_pipe && !modeset && + old_crtc_state->hw.mode.private_flags &I915_MODE_FLAG_INHERITED ) +intel_crtc_arm_fifo_underrun (crtc, new_crtc_state);
Quoted 1 line
}
Could we just put this whole condition into somekind of wrapper function like "check_and_arm_fifo_underrun"? Not mandatory anyway.
Quoted 77 lines
static void
intel_update_crtcs(struct intel_atomic_state *state)drivers/gpu/drm/i915/display/intel_display.c +0
-32@@ -14525,72 +14571,6 @@ skl_max_scale(const struct intel_crtc_state *crtc_state, return max_scale; } -static void intel_begin_crtc_commit (struct intel_atomic_state *state, -struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -struct intel_crtc_state *old_crtc_state = -intel_atomic_get_old_crtc_state (state, crtc); -struct intel_crtc_state *new_crtc_state = -intel_atomic_get_new_crtc_state (state, crtc); -bool modeset =needs_modeset (new_crtc_state); - -/* Perform vblank evasion around commit operation */ -intel_pipe_update_start (new_crtc_state); - -if (modeset) - goto out; - -if (new_crtc_state->uapi.color_mgmt_changed || - new_crtc_state->update_pipe) -intel_color_commit (new_crtc_state); - -if (new_crtc_state->update_pipe) -intel_update_pipe_config (old_crtc_state, new_crtc_state); -else if (INTEL_GEN (dev_priv) >=9 ) -skl_detach_scalers (new_crtc_state); - -if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) -bdw_set_pipemisc (new_crtc_state); - -out: -if (dev_priv->display.atomic_update_watermarks) - dev_priv->display.atomic_update_watermarks (state, - new_crtc_state);
drivers/gpu/drm/i915/display/intel_display.c +0
-9-} - -void intel_crtc_arm_fifo_underrun (struct intel_crtc *crtc, -struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); - -if (!IS_GEN (dev_priv,2 )) - intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc-Quoted 1 line
pipe, true);
drivers/gpu/drm/i915/display/intel_display.c +0
-6- -if (crtc_state->has_pch_encoder) { -enum pipe pch_transcoder = -intel_crtc_pch_transcoder (crtc); - - intel_set_pch_fifo_underrun_reporting(dev_priv,
pch_transcoder, true);drivers/gpu/drm/i915/display/intel_display.c +0
-4- } -} - -static void intel_finish_crtc_commit(struct intel_atomic_state*state,
drivers/gpu/drm/i915/display/intel_display.c +0
-12- struct intel_crtc *crtc) -{ - struct intel_crtc_state *old_crtc_state = - intel_atomic_get_old_crtc_state(state, crtc); - struct intel_crtc_state *new_crtc_state = - intel_atomic_get_new_crtc_state(state, crtc); - - intel_pipe_update_end(new_crtc_state); - - if (new_crtc_state->update_pipe && - !needs_modeset(new_crtc_state) && - old_crtc_state->hw.mode.private_flags &
I915_MODE_FLAG_INHERITED)
drivers/gpu/drm/i915/display/intel_display.c skl_max_scale(const struct intel_crtc_state *crtc_state, · line 14576
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-3-intel_crtc_arm_fifo_underrun (crtc, new_crtc_state); -} -/** * intel_plane_destroy - destroy a plane * @plane: plane to destroy
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH 01/10] drm/i915/dp: Fix dsc bpp calculations.
In reply to Manasi NavareQuoted 32 lines · Manasi Navare
Quoted 3 lines · Maarten Lankhorst
There was a integer wraparound when
mode_clockbecame too high, and we didn't correct for the FEC overhead factor when dividing, also the calculations would break at HBR3.But the
mode_clockis obtained from theadusted_mode->crtc_clockwhich is defined as an int indrm_mode_configstruct, does that need to change also?Quoted 24 lines
As a result our calculated bpp was way too high, and the link width bpp limitation never came into effect.
Print out the resulting bpp calcululations as a sanity check, just in case we ever have to debug it later on again.
Signed-off-by Maarten Lankhorst <[email protected]>Fixes d9218c8f6cf4 ("drm/i915/dp: Add helpers for Compressed BPP and Slice Count for DSC")Cc <[email protected]> # v5.0+Cc Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++------- drivers/gpu/drm/i915/display/intel_dp.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/display/intel_dp.c +0
-0@@ -4323,10 +4323,10 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)DP_DPRX_ESI_LEN ; }
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp.c intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) · line 4329
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-3-u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay) +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay) { -u16 bits_per_pixel, max_bpp_small_joiner_ram; +u32 bits_per_pixel, max_bpp_small_joiner_ram;But
bits_per_pixelis a 16 bit value for DSC PPS, why does this need to be u32?
I would use int for *all* of the parameters and local vars. Don't try to save space or limit the range by unsigned or fixed size. Only use the fixed size types for when the size really matters, i.e. serialization and lots of data. IMO almost everything else is trouble in C.
BR,
Jani.
Quoted 60 lines
drivers/gpu/drm/i915/display/intel_dp.c u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count, · line 4339
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-3int i;/* @@ -4335,13 +4335,14 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,* FECOverhead = 2.4%, for SST -> TimeSlotsPerMTP is 1, * for MST -> TimeSlotsPerMTP has to be calculated */ - bits_per_pixel = (link_clock * lane_count *8 * -DP_DSC_FEC_OVERHEAD_FACTOR ) / - mode_clock; + bits_per_pixel =div_u64 ((u64 )link_clock * lane_count *8 * +DP_DSC_FEC_OVERHEAD_FACTOR ,1000ULL * mode_clock);Thanks for catching this, this had the 1000 in the denominator in my original patches :https://patchwork.freedesktop.org/series/47514/#rev3 And then the nex rev lost it somehow, so thanks for catching this
Manasi
Quoted 37 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-1+DRM_DEBUG_KMS ("Max link bpp: %u\n" , bits_per_pixel);/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =DP_DSC_MAX_SMALL_JOINER_RAM_BUFFER / mode_hdisplay; +DRM_DEBUG_KMS ("Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);/* * Greatest allowed DSC BPP = MIN (output BPP from avaialble Link BW @@ -4351,7 +4352,8 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { -DRM_DEBUG_KMS ("Unsupported BPP %d\n" , bits_per_pixel); +DRM_DEBUG_KMS ("Unsupported BPP %u, min %u\n" , + bits_per_pixel, valid_dsc_bpp[0 ]);return 0 ; }drivers/gpu/drm/i915/display/intel_dp.h +2
-2@@ -102,8 +102,8 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_source_supports_hbr3 (struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,u8 *link_status); -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay); +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay);u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp,int mode_clock,int mode_hdisplay);Signature · 1 line
2.20.1_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Jani Nikula
maintainerRe: [PATCH 09/10] drm/i915: Add debugfs entries for reading out DPCD DSC and FEC.
In reply to Maarten LankhorstQuoted 2 lines · Maarten Lankhorst
Dump the DSC and FEC in
i915_dpcdas well. This is useful when debugging the link caps.
I thought we were going to get rid of this particular debugfs file altogether ages ago. You can dump the DPCD using CONFIG_DRM_DP_AUX_CHARDEV=y and dd on /dev/drm_dp_auxN.
BR,
Jani.
Quoted 21 lines
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/i915/i915_debugfs.c +2
-0@@ -4396,8 +4396,10 @@ struct dpcd_block {static const struct dpcd_block i915_dpcd_debug[] = { { .offset =DP_DPCD_REV , .size =DP_RECEIVER_CAP_SIZE }, + { .offset =DP_DSC_SUPPORT , .end =DP_DSC_BITS_PER_PIXEL_INC }, { .offset =DP_PSR_SUPPORT , .end =DP_PSR_CAPS }, { .offset =DP_DOWNSTREAM_PORT_0 , .size =16 }, + { .offset =DP_FEC_CAPABILITY }, { .offset =DP_LINK_BW_SET , .end =DP_EDP_CONFIGURATION_SET }, { .offset =DP_SINK_COUNT , .end =DP_ADJUST_REQUEST_LANE2_3 }, { .offset =DP_SET_POWER },
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 01/10] drm/i915/dp: Fix dsc bpp calculations.
In reply to Jani NikulaOp 23-08-2019 om 12:17 schreef Jani Nikula:
Quoted 39 lines · Manasi Navare
Quoted 30 lines · Maarten Lankhorst
Quoted 3 lines
There was a integer wraparound when
mode_clockbecame too high, and we didn't correct for the FEC overhead factor when dividing, also the calculations would break at HBR3.But the
mode_clockis obtained from theadusted_mode->crtc_clockwhich is defined as an int indrm_mode_configstruct, does that need to change also?Quoted 23 lines
As a result our calculated bpp was way too high, and the link width bpp limitation never came into effect.
Print out the resulting bpp calcululations as a sanity check, just in case we ever have to debug it later on again.
Signed-off-by Maarten Lankhorst <[email protected]>Fixes d9218c8f6cf4 ("drm/i915/dp: Add helpers for Compressed BPP and Slice Count for DSC")Cc <[email protected]> # v5.0+Cc Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++------- drivers/gpu/drm/i915/display/intel_dp.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/display/intel_dp.c +0
-0@@ -4323,10 +4323,10 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)DP_DPRX_ESI_LEN ; }Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) · line 4329
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-3-u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay) +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay) { -u16 bits_per_pixel, max_bpp_small_joiner_ram; +u32 bits_per_pixel, max_bpp_small_joiner_ram;But
bits_per_pixelis a 16 bit value for DSC PPS, why does this need to be u32?
Quoted 4 lines
I would use int for *all* of the parameters and local vars. Don't try to save space or limit the range by unsigned or fixed size. Only use the fixed size types for when the size really matters, i.e. serialization and lots of data. IMO almost everything else is trouble in C.
Hmm, looking at the source drm_mode_modeinfo it's intended to be unsigned.
We will definitely need a 64-bits because 1000 * 1 Ghz clock overflows u32.
I will see if I can make this to work with mul_u32_u32 for the nominator and denominator.
Quoted 62 lines
BR,
Jani.Quoted 58 lines
drivers/gpu/drm/i915/display/intel_dp.c u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count, · line 4339
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-3int i;/* @@ -4335,13 +4335,14 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,* FECOverhead = 2.4%, for SST -> TimeSlotsPerMTP is 1, * for MST -> TimeSlotsPerMTP has to be calculated */ - bits_per_pixel = (link_clock * lane_count *8 * -DP_DSC_FEC_OVERHEAD_FACTOR ) / - mode_clock; + bits_per_pixel =div_u64 ((u64 )link_clock * lane_count *8 * +DP_DSC_FEC_OVERHEAD_FACTOR ,1000ULL * mode_clock);Thanks for catching this, this had the 1000 in the denominator in my original patches :https://patchwork.freedesktop.org/series/47514/#rev3 And then the nex rev lost it somehow, so thanks for catching this
Manasi
Quoted 37 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-1+DRM_DEBUG_KMS ("Max link bpp: %u\n" , bits_per_pixel);/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =DP_DSC_MAX_SMALL_JOINER_RAM_BUFFER / mode_hdisplay; +DRM_DEBUG_KMS ("Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);/* * Greatest allowed DSC BPP = MIN (output BPP from avaialble Link BW @@ -4351,7 +4352,8 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { -DRM_DEBUG_KMS ("Unsupported BPP %d\n" , bits_per_pixel); +DRM_DEBUG_KMS ("Unsupported BPP %u, min %u\n" , + bits_per_pixel, valid_dsc_bpp[0 ]);return 0 ; }drivers/gpu/drm/i915/display/intel_dp.h +2
-2@@ -102,8 +102,8 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_source_supports_hbr3 (struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,u8 *link_status); -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay); +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay);u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp,int mode_clock,int mode_hdisplay);Signature · 1 line
2.20.1_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 01/10] drm/i915/dp: Fix dsc bpp calculations.
Quoted 40 lines · Maarten Lankhorst
Op 23-08-2019 om 12:17 schreef Jani Nikula:
Quoted 39 lines · Manasi Navare
Quoted 38 lines · Maarten Lankhorst
Quoted 3 lines
There was a integer wraparound when
mode_clockbecame too high, and we didn't correct for the FEC overhead factor when dividing, also the calculations would break at HBR3.But the
mode_clockis obtained from theadusted_mode->crtc_clockwhich is defined as an int indrm_mode_configstruct, does that need to change also?Quoted 20 lines
As a result our calculated bpp was way too high, and the link width bpp limitation never came into effect.
Print out the resulting bpp calcululations as a sanity check, just in case we ever have to debug it later on again.
Signed-off-by Maarten Lankhorst <[email protected]>Fixes d9218c8f6cf4 ("drm/i915/dp: Add helpers for Compressed BPP and Slice Count for DSC")Cc <[email protected]> # v5.0+Cc Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++------- drivers/gpu/drm/i915/display/intel_dp.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/display/intel_dp.c +0
-0drivers/gpu/drm/i915/display/intel_dp.c intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) · line 4329
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-3@@ -4323,10 +4323,10 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)DP_DPRX_ESI_LEN ; } -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay) +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay) { -u16 bits_per_pixel, max_bpp_small_joiner_ram; +u32 bits_per_pixel, max_bpp_small_joiner_ram;But
bits_per_pixelis a 16 bit value for DSC PPS, why does this need to be u32?
Quoted 8 lines
Quoted 4 lines
I would use int for *all* of the parameters and local vars. Don't try to save space or limit the range by unsigned or fixed size. Only use the fixed size types for when the size really matters, i.e. serialization and lots of data. IMO almost everything else is trouble in C.
Hmm, looking at the source
drm_mode_modeinfoit's intended to be unsigned.We will definitely need a 64-bits because 1000 * 1 Ghz clock overflows u32.
Okay so for the denominator when you do 1000 * mode_Clock, thats when the mode_clock will overflow so you need it a u64?
But the bits_per_pixel i think can be int like Jani said correct? Since that is only a 16 bit value after the div but we can make it generic int.
Manasi
Quoted 68 lines
I will see if I can make this to work with
mul_u32_u32for the nominator and denominator.Quoted 62 lines
BR,
Jani.Quoted 58 lines
drivers/gpu/drm/i915/display/intel_dp.c u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count, · line 4339
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-3int i;/* @@ -4335,13 +4335,14 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,* FECOverhead = 2.4%, for SST -> TimeSlotsPerMTP is 1, * for MST -> TimeSlotsPerMTP has to be calculated */ - bits_per_pixel = (link_clock * lane_count *8 * -DP_DSC_FEC_OVERHEAD_FACTOR ) / - mode_clock; + bits_per_pixel =div_u64 ((u64 )link_clock * lane_count *8 * +DP_DSC_FEC_OVERHEAD_FACTOR ,1000ULL * mode_clock);Thanks for catching this, this had the 1000 in the denominator in my original patches :https://patchwork.freedesktop.org/series/47514/#rev3 And then the nex rev lost it somehow, so thanks for catching this
Manasi
Quoted 37 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-1+DRM_DEBUG_KMS ("Max link bpp: %u\n" , bits_per_pixel);/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =DP_DSC_MAX_SMALL_JOINER_RAM_BUFFER / mode_hdisplay; +DRM_DEBUG_KMS ("Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);/* * Greatest allowed DSC BPP = MIN (output BPP from avaialble Link BW @@ -4351,7 +4352,8 @@ u16 intel_dp_dsc_get_output_bpp(int link_clock, u8 lane_count,/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { -DRM_DEBUG_KMS ("Unsupported BPP %d\n" , bits_per_pixel); +DRM_DEBUG_KMS ("Unsupported BPP %u, min %u\n" , + bits_per_pixel, valid_dsc_bpp[0 ]);return 0 ; }drivers/gpu/drm/i915/display/intel_dp.h +2
-2@@ -102,8 +102,8 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_source_supports_hbr3 (struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,u8 *link_status); -u16 intel_dp_dsc_get_output_bpp (int link_clock,u8 lane_count, -int mode_clock,int mode_hdisplay); +u16 intel_dp_dsc_get_output_bpp (u32 link_clock,u8 lane_count, +u32 mode_clock,u32 mode_hdisplay);u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp,int mode_clock,int mode_hdisplay);Signature · 1 line
2.20.1_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/10] drm/i915: Do not add all planes when checking scalers on glk+
In reply to Maarten LankhorstQuoted 16 lines · Maarten Lankhorst
We cannot switch between HQ and normal mode on GLK+, so only add planes on platforms where it makes sense.
We could probably restrict it even more to only add when scaler users toggles between 1 and 2, but lets just leave it for now.
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/i915/display/intel_atomic.c +0
-0
drivers/gpu/drm/i915/display/intel_atomic.c int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, · line 425
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_atomic.c +5
-0@@ -418,6 +418,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,*/ if (!plane) {struct drm_plane_state *state; + +/* No need to reprogram, we're not changing scaling mode */ +if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) +continue ; +
This whole function is kinda nasty. Should probably rewrite the whole thing...
add_active_planes() {
for_each_plane_on_crtc() {
if (!active)
continue;
get_plane_state();
update_planes |= plane;
}
}update_scalers()
{
if (can_use_hq(old) != can_use_hq(new))
add_active_planes();
setup_scaler(crtc);
for_each_plane_in_state()
setup_scaler(plane);
}or something like that?
Still doing the setup_scaler() perhaps a bit needlessly sometimes but maybe it'd be good enough.
Also looks like the current code is missing the update_planes bitmask update?
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_atomic.c +0
-0plane =drm_plane_from_index (&dev_priv->drm, i); state =drm_atomic_get_plane_state (drm_state, plane);if (IS_ERR (state)) {Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx