HAX to make DSC work on the icelake test system
PATCH v6 1/11 HAX to make DSC work on the icelake test system
From: Maarten Lankhorst <[email protected]>
DSC is available on the display emulator, but not set in DPCD. Override the entries to allow bigjoiner testing.
--- drivers/gpu/drm/drm_dp_helper.c | 4 ++-- include/drm/drm_dp_helper.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
@@ -1434,7 +1434,7 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],if (slice_cap1 &DP_DSC_4_PER_DP_DSC_SINK )return 4 ;if (slice_cap1 &DP_DSC_2_PER_DP_DSC_SINK ) -return 2 ; +return 4 ;if (slice_cap1 &DP_DSC_1_PER_DP_DSC_SINK )return 1 ; }else {
@@ -1458,7 +1458,7 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],if (slice_cap1 &DP_DSC_4_PER_DP_DSC_SINK )return 4 ;if (slice_cap1 &DP_DSC_2_PER_DP_DSC_SINK ) -return 2 ; +return 4 ;if (slice_cap1 &DP_DSC_1_PER_DP_DSC_SINK )return 1 ; }
include/drm/drm_dp_helper.h +1 -0
@@ -1416,6 +1416,7 @@ int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpc[DP_DSC_RECEIVER_CAP_SIstatic inline bool drm_dp_sink_supports_dsc (const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE ]) { +return dsc_dpcd[DP_DSC_REV -DP_DSC_SUPPORT ];return dsc_dpcd[DP_DSC_SUPPORT -DP_DSC_SUPPORT ] &DP_DSC_DECOMPRESSION_IS_SUPPORTED ; }
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 2/11 drm/i915: Remove hw.mode
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from adjusted_mode as well, use that when available.
Some places that use hw.mode can be converted to use adjusted_mode as well.
v2:
* Manual rebase (Manasi)
* remove the use of pipe_mode defined in patch 3 (Manasi)
v3:
* Rebase on drm-tip (Manasi)
--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +15 -14
@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,
@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);
@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;
@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;
@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);
@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the
@@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {
drivers/gpu/drm/i915/display/intel_display_types.h +1 -1
@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/**
drivers/gpu/drm/i915/display/intel_dvo.c +1 -1
@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );
drivers/gpu/drm/i915/display/intel_sdvo.c +6 -10
@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;
@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,
@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;
@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {
@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }
@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;
@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 12 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)
Quoted 5 lines
v3:
* Rebase on drm-tip (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>
Changes looks ok to me.
Quoted 196 lines
--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +5
-9@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;
drivers/gpu/drm/i915/display/intel_sdvo.c static void intel_sdvo_pre_enable(struct intel_atomic_state *state, · line 1493
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_sdvo.c +1
-1@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
In reply to Manasi NavareQuoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.
Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)
Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 214 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.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
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 13 lines · Ville Syrjälä
Quoted 12 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)
Quoted 5 lines
Quoted 2 lines
v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 211 lines
Quoted 211 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 1 line
2.19.1
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 14 lines · Manasi
Quoted 13 lines · Ville Syrjälä
Quoted 12 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
Quoted 224 lines
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 219 lines
Quoted 215 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 18 lines · Ville Syrjälä
Quoted 17 lines · Manasi
Quoted 16 lines · Ville Syrjälä
Quoted 14 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
Quoted 233 lines
Quoted 225 lines
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 219 lines
Quoted 215 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 6 lines
Ville Syrjälä Intel _______________________________________________ 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
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the adjusted_mode instead keep using hw.mode? How about other cleanups like: intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,
+ struct drm_display_mode *user_mode)
You think we dont need mode as an argument there either?
Manasi
Quoted 227 lines
Quoted 227 lines
Quoted 226 lines
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 219 lines
Quoted 215 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Quoted 11 lines
Quoted 7 lines
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 36 lines · Manasi
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the
adjusted_modeinstead keep using hw.mode? How about other cleanups like:intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(structintel_crtc_state*crtc_state,drivers/gpu/drm/i915/display/intel_display.c +1
-0+ struct drm_display_mode *user_mode)
Quoted 1 line
You think we dont need mode as an argument there either?
Not in this patch if all the other stuff disappears. No idea if some later patch might need something like it.
Quoted 240 lines
Manasi
Quoted 238 lines
Quoted 234 lines
Quoted 226 lines
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 219 lines
Quoted 215 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Manasi
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the
adjusted_modeinstead keep using hw.mode? How about other cleanups like:intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(structintel_crtc_state*crtc_state,(quoted diff) +1
-0+ struct drm_display_mode *user_mode)
Quoted 4 lines
Quoted 1 line
You think we dont need mode as an argument there either?
Not in this patch if all the other stuff disappears. No idea if some later patch might need something like it.
Hi Ville,
So this patch basically removes the hw.mode and just keeps hw.adjusted_mode So no need to remove that?
But basically from this patch onwards we say that there is hw.pipe_mode and hw.adjusted_mode, there is no hw.mode.
Are you suggesting keeping hw.mode as well? Would this be replacing hw.pipe_mode then?
Manasi
Quoted 238 lines
Quoted 238 lines
Manasi
Quoted 235 lines
Quoted 234 lines
Quoted 226 lines
@Maarten any feedback on Ville's unaddressed comments?
Manasi
Quoted 219 lines
Quoted 215 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 29 ++++++++++--------- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dvo.c | 2 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 16 ++++------ 4 files changed, 23 insertions(+), 26 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +15
-14@@ -8892,9 +8892,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc, tmp =intel_de_read (dev_priv,PIPESRC (crtc->pipe)); pipe_config->pipe_src_h = (tmp &0xffff ) +1 ; pipe_config->pipe_src_w = ((tmp >>16 ) &0xffff ) +1 ; - - pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h; - pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w; } void intel_mode_from_pipe_config(struct drm_display_mode *mode,@@ -13079,7 +13076,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,intel_dump_dp_vsc_sdp (dev_priv, &pipe_config->infoframes.vsc);drm_dbg_kms (&dev_priv->drm,"requested mode:\n" ); -drm_mode_debug_printmodeline (&pipe_config->hw.mode); +drm_mode_debug_printmodeline (&pipe_config->uapi.mode);drm_dbg_kms (&dev_priv->drm,"adjusted mode:\n" );drm_mode_debug_printmodeline (&pipe_config->hw.adjusted_mode);intel_dump_crtc_timings (dev_priv, &pipe_config->hw.adjusted_mode);@@ -13221,17 +13218,17 @@ intel_crtc_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;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); } -static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state) +static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state, +struct drm_display_mode *user_mode) { crtc_state->uapi.enable = crtc_state->hw.enable; crtc_state->uapi.active = crtc_state->hw.active;drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, &crtc_state->hw.mode) <0 ); +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13277,6 +13274,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)memcpy (crtc_state, saved_state,sizeof (*crtc_state));kfree (saved_state); +/* Clear I915_MODE_FLAG_INHERITED */ + crtc_state->uapi.mode.private_flags =0 ; + crtc_state->uapi.adjusted_mode.private_flags =0 ; +intel_crtc_copy_uapi_to_hw_state (crtc_state);return 0 ;@@ -13324,7 +13325,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.mode, +drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -18461,15 +18462,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)int min_cdclk =0 ;if (crtc_state->hw.active) { -struct drm_display_mode *mode = &crtc_state->hw.mode; +struct drm_display_mode mode;intel_mode_from_pipe_config (&crtc_state->hw.adjusted_mode, crtc_state); - *mode = crtc_state->hw.adjusted_mode; - mode->hdisplay = crtc_state->pipe_src_w; - mode->vdisplay = crtc_state->pipe_src_h; -/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the @@ -18481,11 +18478,15 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; + mode = crtc_state->hw.adjusted_mode; + mode.hdisplay = crtc_state->pipe_src_w; + mode.vdisplay = crtc_state->pipe_src_h; +intel_crtc_compute_pixel_rate (crtc_state);intel_crtc_update_active_timings (crtc_state); -intel_crtc_copy_hw_to_uapi_state (crtc_state); +intel_crtc_copy_hw_to_uapi_state (crtc_state, &mode); }for_each_intel_plane_on_crtc (&dev_priv->drm, crtc, plane) {drivers/gpu/drm/i915/display/intel_display_types.h +1
-1@@ -807,7 +807,7 @@ struct intel_crtc_state {struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode mode, adjusted_mode; +struct drm_display_mode adjusted_mode; } hw;/** drivers/gpu/drm/i915/display/intel_dvo.c +1
-1@@ -209,7 +209,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,u32 temp =intel_de_read (dev_priv, dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode, &pipe_config->hw.adjusted_mode);intel_de_write (dev_priv, dvo_reg, temp |DVO_ENABLE );drivers/gpu/drm/i915/display/intel_sdvo.c +6
-10@@ -1223,7 +1223,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,static bool intel_sdvo_get_preferred_input_mode (struct intel_sdvo *intel_sdvo,struct intel_sdvo_connector *intel_sdvo_connector, -const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode) {struct intel_sdvo_dtd input_dtd;@@ -1234,9 +1233,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,if (!intel_sdvo_create_preferred_input_timing (intel_sdvo, intel_sdvo_connector, - mode->clock /10 , - mode->hdisplay, - mode->vdisplay)) + adjusted_mode->clock /10 , + adjusted_mode->hdisplay, + adjusted_mode->vdisplay))return false; if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,@@ -1308,7 +1307,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector);struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; -struct drm_display_mode *mode = &pipe_config->hw.mode;DRM_DEBUG_KMS ("forcing bpc to 8 for SDVO\n" ); pipe_config->pipe_bpp =8 *3 ;@@ -1324,12 +1322,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,* the sequence to do it. Oh well. */ if (IS_TV (intel_sdvo_connector)) { -if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, mode)) +if (!intel_sdvo_set_output_timings_from_mode (intel_sdvo, + adjusted_mode))return -EINVAL ; (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); pipe_config->sdvo_tv_clock = true; }else if (IS_LVDS (intel_sdvo_connector)) {@@ -1339,7 +1337,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder, (void )intel_sdvo_get_preferred_input_mode (intel_sdvo, intel_sdvo_connector, - mode, adjusted_mode); }@@ -1458,7 +1455,6 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,to_intel_sdvo_connector_state (conn_state);const struct intel_sdvo_connector *intel_sdvo_connector =to_intel_sdvo_connector (conn_state->connector); -const struct drm_display_mode *mode = &crtc_state->hw.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;@@ -1491,7 +1487,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state,intel_sdvo_get_dtd_from_mode (&output_dtd, intel_sdvo_connector->base.panel.fixed_mode); else - intel_sdvo_get_dtd_from_mode(&output_dtd, mode); + intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);if (!intel_sdvo_set_output_timing (intel_sdvo, &output_dtd)) drm_info(&dev_priv->drm, "Setting output timings on %s failed\n",Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 43 lines · Manasi
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Manasi
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the
adjusted_modeinstead keep using hw.mode? How about other cleanups like:intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(structintel_crtc_state*crtc_state,(quoted diff) +1
-0+ struct drm_display_mode *user_mode)Quoted 4 lines
Quoted 1 line
You think we dont need mode as an argument there either?
Not in this patch if all the other stuff disappears. No idea if some later patch might need something like it.
Quoted 7 lines
Hi Ville,
So this patch basically removes the hw.mode and just keeps hw.adjusted_mode So no need to remove that?
But basically from this patch onwards we say that there is hw.pipe_mode and hw.adjusted_mode, there is no hw.mode.
Are you suggesting keeping hw.mode as well? Would this be replacing hw.pipe_mode then?
No. hw.mode is the original timings, adjusted_mode is the output timings, pipe_mode is the the pipe timings.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Quoted 46 lines · Ville Syrjälä
Quoted 45 lines · Manasi
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Manasi
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the
adjusted_modeinstead keep using hw.mode? How about other cleanups like:intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(structintel_crtc_state*crtc_state,(quoted diff) +1
-0+ struct drm_display_mode *user_mode)Quoted 4 lines
Quoted 1 line
You think we dont need mode as an argument there either?
Not in this patch if all the other stuff disappears. No idea if some later patch might need something like it.
Hi Ville,
Quoted 8 lines
Quoted 5 lines
So this patch basically removes the hw.mode and just keeps hw.adjusted_mode So no need to remove that?
But basically from this patch onwards we say that there is hw.pipe_mode and hw.adjusted_mode, there is no hw.mode.
Are you suggesting keeping hw.mode as well? Would this be replacing hw.pipe_mode then?No. hw.mode is the original timings,
adjusted_modeis the output timings,pipe_modeis the the pipe timings.
So is the suggestion to keep hw.mode so the original timings as well as adjusted_mode and then have pipe_mode for per pipe timings.
So get rid of this patch meaning do not remove hw.mode?
Manasi
Quoted 4 lines
Signature · 3 lines
-- Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 02/11] drm/i915: Remove hw.mode
Hi Ville,
So to confirm I am skipping this patch completely. So basically keeping hw.mode as well
Manasi
Quoted 63 lines · Manasi
Quoted 46 lines · Ville Syrjälä
Quoted 45 lines · Manasi
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Manasi
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 8 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
The members in hw.mode can be used from
adjusted_modeas well, use that when available.Some places that use hw.mode can be converted to use
adjusted_modeas well.Quoted 6 lines
v2:
* Manual rebase (Manasi)
* remove the use ofpipe_modedefined in patch 3 (Manasi)v3:
* Rebase on drm-tip (Manasi)Previous review was apparently ignored. Or is there a better version somewhere? If not, this still looks very wrong.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
This was the latest rev that Maarten had in his local tree which he said should address all the review comments. What in particular looks wrong or what review comments were unaddressed here?
The dvo/sdvo changes.
I recommend just dropping this patch entirely. It doesn't seem to have anything to do with the bigjoiner anyway.
So for the dvo/svdo changes, no need to use the
adjusted_modeinstead keep using hw.mode? How about other cleanups like:intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode); and static void intel_crtc_copy_hw_to_uapi_state(structintel_crtc_state*crtc_state,(quoted diff) +1
-0+ struct drm_display_mode *user_mode)Quoted 4 lines
Quoted 1 line
You think we dont need mode as an argument there either?
Not in this patch if all the other stuff disappears. No idea if some later patch might need something like it.
Hi Ville,
Quoted 8 lines
Quoted 5 lines
So this patch basically removes the hw.mode and just keeps hw.adjusted_mode So no need to remove that?
But basically from this patch onwards we say that there is hw.pipe_mode and hw.adjusted_mode, there is no hw.mode.
Are you suggesting keeping hw.mode as well? Would this be replacing hw.pipe_mode then?No. hw.mode is the original timings,
adjusted_modeis the output timings,pipe_modeis the the pipe timings.So is the suggestion to keep hw.mode so the original timings as well as
adjusted_modeand then havepipe_modefor per pipe timings.
So get rid of this patch meaning do not remove hw.mode?Manasi
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä Intel_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 3/11 drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
In reply to Manasi NavareFrom: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state to crtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)
--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +32 -29
@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,
@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,
@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)
@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);
@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {
@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);
@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/*
@@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);
@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {
@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }
@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);
@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);
@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);
@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);
@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);
@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }
@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }
@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);
@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }
@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;
drivers/gpu/drm/i915/display/intel_display_types.h +9 -2
@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/**
drivers/gpu/drm/i915/intel_pm.c +38 -38
215 lines not on this page · raw message
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [Intel-gfx] [PATCH v6 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
This patch probably needs a description, typing somethign here since it was originally my patch:
With bigjoiner, there will be 2 pipes driving 2 halfs of 1 transcoder, because of this, we need a pipe_mode for various calculations, including for example watermarks, plane clipping, etc.
The transcoder_mode has the full timings, and is used for configuring the transcoder with the intended mode after joining the 2 halves.
To clear the confusion, we rename intel_set_pipe_timings to intel_set_transcoder_timings, and use pipe_mode where the pipe timings are needed.
Op 16-07-2020 om 00:42 schreef Manasi Navare:
Quoted 507 lines
From: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state tocrtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +32
-29@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/* @@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;drivers/gpu/drm/i915/display/intel_display_types.h +9
-2@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/** drivers/gpu/drm/i915/intel_pm.c +37
-37@@ -905,12 +905,12 @@ static void pnv_update_wm(struct intel_crtc *unused_crtc) crtc =single_enabled_crtc (dev_priv);if (crtc) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp = fb->format->cpp[0 ]; -int clock = adjusted_mode->crtc_clock; +int clock = pipe_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pnv_display_wm,@@ -1141,8 +1141,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int latency = dev_priv->wm.pri_latency[level] *10 ;unsigned int clock, htotal, cpp, width, wm;@@ -1169,8 +1169,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, level != G4X_WM_LEVEL_NORMAL) cpp =max (cpp,4u ); - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width =drm_rect_width (&plane_state->uapi.dst);@@ -1666,8 +1666,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int clock, htotal, cpp, width, wm;if (dev_priv->wm.pri_latency[level] ==0 )@@ -1677,8 +1677,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,return 0 ; cpp = plane_state->hw.fb->format->cpp[0 ]; - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width = crtc_state->pipe_src_w;if (plane->id ==PLANE_CURSOR ) {@@ -2267,12 +2267,12 @@ static void i965_update_wm(struct intel_crtc *unused_crtc)if (crtc) {/* self-refresh has much higher latency */ static const int sr_latency_ns =12000 ; -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = crtc->config->pipe_src_w;int cpp = fb->format->cpp[0 ];int entries;@@ -2351,8 +2351,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_A ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_A );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2362,7 +2362,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns); enabled = crtc;@@ -2378,8 +2378,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_B ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_B );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2389,7 +2389,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planeb_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns);if (enabled ==NULL )@@ -2427,12 +2427,12 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)if (HAS_FW_BLC (dev_priv) && enabled) {/* self-refresh has much higher latency */ static const int sr_latency_ns =6000 ; -const struct drm_display_mode *adjusted_mode = - &enabled->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &enabled->config->hw.pipe_mode;const struct drm_framebuffer *fb = enabled->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = enabled->config->pipe_src_w;int cpp;int entries;@@ -2480,7 +2480,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) {struct drm_i915_private *dev_priv =to_i915 (unused_crtc->base.dev);struct intel_crtc *crtc; -const struct drm_display_mode *adjusted_mode; +const struct drm_display_mode *pipe_mode;u32 fwater_lo;int planea_wm;@@ -2488,8 +2488,8 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)if (crtc ==NULL )return ; - adjusted_mode = &crtc->config->hw.adjusted_mode; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + pipe_mode = &crtc->config->hw.pipe_mode; + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, &i845_wm_info, dev_priv->display.get_fifo_size (dev_priv,PLANE_A ),4 , pessimal_latency_ns);@@ -2579,7 +2579,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,return method1; method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);@@ -2607,7 +2607,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, method1 =ilk_wm_method1 (crtc_state->pixel_rate, cpp, mem_value); method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);return min (method1, method2);@@ -2632,7 +2632,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, cpp = plane_state->hw.fb->format->cpp[0 ];return ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value); }@@ -3889,7 +3889,7 @@ static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state)if (!crtc_state->hw.active)return true; -if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (crtc_state->hw.pipe_mode.flags &DRM_MODE_FLAG_INTERLACE )return false;intel_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) {@@ -4180,8 +4180,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,*/ total_slice_mask = dbuf_slice_mask;for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;enum pipe pipe = crtc->pipe;int hdisplay, vdisplay;u32 pipe_dbuf_slice_mask;@@ -4211,7 +4211,7 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,if (dbuf_slice_mask != pipe_dbuf_slice_mask)continue ; -drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); +drm_mode_get_hv_timing (pipe_mode, &hdisplay, &vdisplay); total_width_in_range += hdisplay;@@ -5099,7 +5099,7 @@ intel_get_linetime_us(const struct intel_crtc_state *crtc_state)if (drm_WARN_ON (&dev_priv->drm, pixel_rate ==0 ))return u32_to_fixed16 (0 ); - crtc_htotal = crtc_state->hw.adjusted_mode.crtc_htotal; + crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal; linetime_us =div_fixed16 (crtc_htotal *1000 , pixel_rate);return linetime_us;@@ -5288,14 +5288,14 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, method1 =skl_wm_method1 (dev_priv, wp->plane_pixel_rate, wp->cpp, latency, wp->dbuf_block_size); method2 = skl_wm_method2(wp->plane_pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal, latency,
drivers/gpu/drm/i915/intel_pm.c static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, · line 5301
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +1
-1wp->plane_blocks_per_line);if (wp->y_tiled) { selected_result =max_fixed16 (method2, wp->y_tile_minimum); }else { -if ((wp->cpp * crtc_state->hw.adjusted_mode.crtc_htotal / +if ((wp->cpp * crtc_state->hw.pipe_mode.crtc_htotal / wp->dbuf_block_size <1 ) && (wp->plane_bytes_per_line / wp->dbuf_block_size <1 )) { selected_result = method2;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
In reply to Manasi NavareQuoted 11 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state tocrtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>
Changes looks ok to me.
Quoted 496 lines
--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +32
-29@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/* @@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;drivers/gpu/drm/i915/display/intel_display_types.h +9
-2@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/** drivers/gpu/drm/i915/intel_pm.c +37
-37@@ -905,12 +905,12 @@ static void pnv_update_wm(struct intel_crtc *unused_crtc) crtc =single_enabled_crtc (dev_priv);if (crtc) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp = fb->format->cpp[0 ]; -int clock = adjusted_mode->crtc_clock; +int clock = pipe_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pnv_display_wm,@@ -1141,8 +1141,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int latency = dev_priv->wm.pri_latency[level] *10 ;unsigned int clock, htotal, cpp, width, wm;@@ -1169,8 +1169,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, level != G4X_WM_LEVEL_NORMAL) cpp =max (cpp,4u ); - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width =drm_rect_width (&plane_state->uapi.dst);@@ -1666,8 +1666,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int clock, htotal, cpp, width, wm;if (dev_priv->wm.pri_latency[level] ==0 )@@ -1677,8 +1677,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,return 0 ; cpp = plane_state->hw.fb->format->cpp[0 ]; - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width = crtc_state->pipe_src_w;if (plane->id ==PLANE_CURSOR ) {@@ -2267,12 +2267,12 @@ static void i965_update_wm(struct intel_crtc *unused_crtc)if (crtc) {/* self-refresh has much higher latency */ static const int sr_latency_ns =12000 ; -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = crtc->config->pipe_src_w;int cpp = fb->format->cpp[0 ];int entries;@@ -2351,8 +2351,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_A ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_A );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2362,7 +2362,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns); enabled = crtc;@@ -2378,8 +2378,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_B ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_B );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2389,7 +2389,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planeb_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns);if (enabled ==NULL )@@ -2427,12 +2427,12 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)if (HAS_FW_BLC (dev_priv) && enabled) {/* self-refresh has much higher latency */ static const int sr_latency_ns =6000 ; -const struct drm_display_mode *adjusted_mode = - &enabled->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &enabled->config->hw.pipe_mode;const struct drm_framebuffer *fb = enabled->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = enabled->config->pipe_src_w;int cpp;int entries;@@ -2480,7 +2480,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) {struct drm_i915_private *dev_priv =to_i915 (unused_crtc->base.dev);struct intel_crtc *crtc; -const struct drm_display_mode *adjusted_mode; +const struct drm_display_mode *pipe_mode;u32 fwater_lo;int planea_wm;@@ -2488,8 +2488,8 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)if (crtc ==NULL )return ; - adjusted_mode = &crtc->config->hw.adjusted_mode; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + pipe_mode = &crtc->config->hw.pipe_mode; + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, &i845_wm_info, dev_priv->display.get_fifo_size (dev_priv,PLANE_A ),4 , pessimal_latency_ns);@@ -2579,7 +2579,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,return method1; method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);@@ -2607,7 +2607,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, method1 =ilk_wm_method1 (crtc_state->pixel_rate, cpp, mem_value); method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);return min (method1, method2);@@ -2632,7 +2632,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, cpp = plane_state->hw.fb->format->cpp[0 ];return ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value); }@@ -3889,7 +3889,7 @@ static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state)if (!crtc_state->hw.active)return true; -if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (crtc_state->hw.pipe_mode.flags &DRM_MODE_FLAG_INTERLACE )return false;intel_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) {@@ -4180,8 +4180,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,*/ total_slice_mask = dbuf_slice_mask;for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;enum pipe pipe = crtc->pipe;int hdisplay, vdisplay;u32 pipe_dbuf_slice_mask;@@ -4211,7 +4211,7 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,if (dbuf_slice_mask != pipe_dbuf_slice_mask)continue ; -drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); +drm_mode_get_hv_timing (pipe_mode, &hdisplay, &vdisplay); total_width_in_range += hdisplay;@@ -5099,7 +5099,7 @@ intel_get_linetime_us(const struct intel_crtc_state *crtc_state)if (drm_WARN_ON (&dev_priv->drm, pixel_rate ==0 ))return u32_to_fixed16 (0 ); - crtc_htotal = crtc_state->hw.adjusted_mode.crtc_htotal; + crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal; linetime_us =div_fixed16 (crtc_htotal *1000 , pixel_rate);return linetime_us;@@ -5288,14 +5288,14 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, method1 =skl_wm_method1 (dev_priv, wp->plane_pixel_rate, wp->cpp, latency, wp->dbuf_block_size); method2 = skl_wm_method2(wp->plane_pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal, latency,
drivers/gpu/drm/i915/intel_pm.c static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, · line 5301
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +1
-1wp->plane_blocks_per_line);if (wp->y_tiled) { selected_result =max_fixed16 (method2, wp->y_tile_minimum); }else { -if ((wp->cpp * crtc_state->hw.adjusted_mode.crtc_htotal / +if ((wp->cpp * crtc_state->hw.pipe_mode.crtc_htotal / wp->dbuf_block_size <1 ) && (wp->plane_bytes_per_line / wp->dbuf_block_size <1 )) { selected_result = method2;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
In reply to Manasi NavareQuoted 22 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state tocrtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c static void ilk_pch_clock_get(struct intel_crtc *crtc, · line 155
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);
These renames make it hard to see what changed. Should be split out.
Quoted 497 lines
drivers/gpu/drm/i915/display/intel_display.c +31
-28static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/* @@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;drivers/gpu/drm/i915/display/intel_display_types.h +9
-2@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/** drivers/gpu/drm/i915/intel_pm.c +38
-38@@ -905,12 +905,12 @@ static void pnv_update_wm(struct intel_crtc *unused_crtc) crtc =single_enabled_crtc (dev_priv);if (crtc) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp = fb->format->cpp[0 ]; -int clock = adjusted_mode->crtc_clock; +int clock = pipe_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pnv_display_wm,@@ -1141,8 +1141,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int latency = dev_priv->wm.pri_latency[level] *10 ;unsigned int clock, htotal, cpp, width, wm;@@ -1169,8 +1169,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, level != G4X_WM_LEVEL_NORMAL) cpp =max (cpp,4u ); - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width =drm_rect_width (&plane_state->uapi.dst);@@ -1666,8 +1666,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int clock, htotal, cpp, width, wm;if (dev_priv->wm.pri_latency[level] ==0 )@@ -1677,8 +1677,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,return 0 ; cpp = plane_state->hw.fb->format->cpp[0 ]; - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width = crtc_state->pipe_src_w;if (plane->id ==PLANE_CURSOR ) {@@ -2267,12 +2267,12 @@ static void i965_update_wm(struct intel_crtc *unused_crtc)if (crtc) {/* self-refresh has much higher latency */ static const int sr_latency_ns =12000 ; -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = crtc->config->pipe_src_w;int cpp = fb->format->cpp[0 ];int entries;@@ -2351,8 +2351,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_A ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_A );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2362,7 +2362,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns); enabled = crtc;@@ -2378,8 +2378,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_B ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_B );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2389,7 +2389,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planeb_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns);if (enabled ==NULL )@@ -2427,12 +2427,12 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)if (HAS_FW_BLC (dev_priv) && enabled) {/* self-refresh has much higher latency */ static const int sr_latency_ns =6000 ; -const struct drm_display_mode *adjusted_mode = - &enabled->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &enabled->config->hw.pipe_mode;const struct drm_framebuffer *fb = enabled->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = enabled->config->pipe_src_w;int cpp;int entries;@@ -2480,7 +2480,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) {struct drm_i915_private *dev_priv =to_i915 (unused_crtc->base.dev);struct intel_crtc *crtc; -const struct drm_display_mode *adjusted_mode; +const struct drm_display_mode *pipe_mode;u32 fwater_lo;int planea_wm;@@ -2488,8 +2488,8 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)if (crtc ==NULL )return ; - adjusted_mode = &crtc->config->hw.adjusted_mode; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + pipe_mode = &crtc->config->hw.pipe_mode; + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, &i845_wm_info, dev_priv->display.get_fifo_size (dev_priv,PLANE_A ),4 , pessimal_latency_ns);@@ -2579,7 +2579,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,return method1; method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);@@ -2607,7 +2607,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, method1 =ilk_wm_method1 (crtc_state->pixel_rate, cpp, mem_value); method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);return min (method1, method2);@@ -2632,7 +2632,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, cpp = plane_state->hw.fb->format->cpp[0 ];return ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value); }@@ -3889,7 +3889,7 @@ static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state)if (!crtc_state->hw.active)return true; -if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (crtc_state->hw.pipe_mode.flags &DRM_MODE_FLAG_INTERLACE )return false;intel_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) {@@ -4180,8 +4180,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,*/ total_slice_mask = dbuf_slice_mask;for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;enum pipe pipe = crtc->pipe;int hdisplay, vdisplay;u32 pipe_dbuf_slice_mask;@@ -4211,7 +4211,7 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,if (dbuf_slice_mask != pipe_dbuf_slice_mask)continue ; -drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); +drm_mode_get_hv_timing (pipe_mode, &hdisplay, &vdisplay); total_width_in_range += hdisplay;@@ -5099,7 +5099,7 @@ intel_get_linetime_us(const struct intel_crtc_state *crtc_state)if (drm_WARN_ON (&dev_priv->drm, pixel_rate ==0 ))return u32_to_fixed16 (0 ); - crtc_htotal = crtc_state->hw.adjusted_mode.crtc_htotal; + crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal; linetime_us =div_fixed16 (crtc_htotal *1000 , pixel_rate);return linetime_us;@@ -5288,14 +5288,14 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, method1 =skl_wm_method1 (dev_priv, wp->plane_pixel_rate, wp->cpp, latency, wp->dbuf_block_size); method2 =skl_wm_method2 (wp->plane_pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal, latency, wp->plane_blocks_per_line);if (wp->y_tiled) { selected_result =max_fixed16 (method2, wp->y_tile_minimum); }else { -if ((wp->cpp * crtc_state->hw.adjusted_mode.crtc_htotal / +if ((wp->cpp * crtc_state->hw.pipe_mode.crtc_htotal / wp->dbuf_block_size <1 ) && (wp->plane_bytes_per_line / wp->dbuf_block_size <1 )) { selected_result = method2;Signature · 6 lines
2.19.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
Re: [Intel-gfx] [PATCH v6 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
Quoted 18 lines · Ville Syrjälä
Quoted 17 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state tocrtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_display.c static void ilk_pch_clock_get(struct intel_crtc *crtc, · line 155
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);These renames make it hard to see what changed. Should be split out.
So just have the renaming in separate patch?
Manasi
Quoted 494 lines
Quoted 494 lines
drivers/gpu/drm/i915/display/intel_display.c +31
-28static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/* @@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;drivers/gpu/drm/i915/display/intel_display_types.h +9
-2@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/** drivers/gpu/drm/i915/intel_pm.c +38
-38@@ -905,12 +905,12 @@ static void pnv_update_wm(struct intel_crtc *unused_crtc) crtc =single_enabled_crtc (dev_priv);if (crtc) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp = fb->format->cpp[0 ]; -int clock = adjusted_mode->crtc_clock; +int clock = pipe_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pnv_display_wm,@@ -1141,8 +1141,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int latency = dev_priv->wm.pri_latency[level] *10 ;unsigned int clock, htotal, cpp, width, wm;@@ -1169,8 +1169,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, level != G4X_WM_LEVEL_NORMAL) cpp =max (cpp,4u ); - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width =drm_rect_width (&plane_state->uapi.dst);@@ -1666,8 +1666,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int clock, htotal, cpp, width, wm;if (dev_priv->wm.pri_latency[level] ==0 )@@ -1677,8 +1677,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,return 0 ; cpp = plane_state->hw.fb->format->cpp[0 ]; - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width = crtc_state->pipe_src_w;if (plane->id ==PLANE_CURSOR ) {@@ -2267,12 +2267,12 @@ static void i965_update_wm(struct intel_crtc *unused_crtc)if (crtc) {/* self-refresh has much higher latency */ static const int sr_latency_ns =12000 ; -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = crtc->config->pipe_src_w;int cpp = fb->format->cpp[0 ];int entries;@@ -2351,8 +2351,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_A ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_A );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2362,7 +2362,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns); enabled = crtc;@@ -2378,8 +2378,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_B ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_B );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2389,7 +2389,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planeb_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns);if (enabled ==NULL )@@ -2427,12 +2427,12 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)if (HAS_FW_BLC (dev_priv) && enabled) {/* self-refresh has much higher latency */ static const int sr_latency_ns =6000 ; -const struct drm_display_mode *adjusted_mode = - &enabled->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &enabled->config->hw.pipe_mode;const struct drm_framebuffer *fb = enabled->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = enabled->config->pipe_src_w;int cpp;int entries;@@ -2480,7 +2480,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) {struct drm_i915_private *dev_priv =to_i915 (unused_crtc->base.dev);struct intel_crtc *crtc; -const struct drm_display_mode *adjusted_mode; +const struct drm_display_mode *pipe_mode;u32 fwater_lo;int planea_wm;@@ -2488,8 +2488,8 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)if (crtc ==NULL )return ; - adjusted_mode = &crtc->config->hw.adjusted_mode; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + pipe_mode = &crtc->config->hw.pipe_mode; + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, &i845_wm_info, dev_priv->display.get_fifo_size (dev_priv,PLANE_A ),4 , pessimal_latency_ns);@@ -2579,7 +2579,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,return method1; method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);@@ -2607,7 +2607,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, method1 =ilk_wm_method1 (crtc_state->pixel_rate, cpp, mem_value); method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);return min (method1, method2);@@ -2632,7 +2632,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, cpp = plane_state->hw.fb->format->cpp[0 ];return ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value); }@@ -3889,7 +3889,7 @@ static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state)if (!crtc_state->hw.active)return true; -if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (crtc_state->hw.pipe_mode.flags &DRM_MODE_FLAG_INTERLACE )return false;intel_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) {@@ -4180,8 +4180,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,*/ total_slice_mask = dbuf_slice_mask;for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;enum pipe pipe = crtc->pipe;int hdisplay, vdisplay;u32 pipe_dbuf_slice_mask;@@ -4211,7 +4211,7 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,if (dbuf_slice_mask != pipe_dbuf_slice_mask)continue ; -drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); +drm_mode_get_hv_timing (pipe_mode, &hdisplay, &vdisplay); total_width_in_range += hdisplay;@@ -5099,7 +5099,7 @@ intel_get_linetime_us(const struct intel_crtc_state *crtc_state)if (drm_WARN_ON (&dev_priv->drm, pixel_rate ==0 ))return u32_to_fixed16 (0 ); - crtc_htotal = crtc_state->hw.adjusted_mode.crtc_htotal; + crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal; linetime_us =div_fixed16 (crtc_htotal *1000 , pixel_rate);return linetime_us;@@ -5288,14 +5288,14 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, method1 =skl_wm_method1 (dev_priv, wp->plane_pixel_rate, wp->cpp, latency, wp->dbuf_block_size); method2 =skl_wm_method2 (wp->plane_pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal, latency, wp->plane_blocks_per_line);if (wp->y_tiled) { selected_result =max_fixed16 (method2, wp->y_tile_minimum); }else { -if ((wp->cpp * crtc_state->hw.adjusted_mode.crtc_htotal / +if ((wp->cpp * crtc_state->hw.pipe_mode.crtc_htotal / wp->dbuf_block_size <1 ) && (wp->plane_bytes_per_line / wp->dbuf_block_size <1 )) { selected_result = method2;Signature · 1 line
2.19.1
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split
Quoted 32 lines · Manasi
Quoted 18 lines · Ville Syrjälä
Quoted 17 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
v4:
* Manual rebase (Manasi)
v3:
* Change state tocrtc_state, fix rebase err (Manasi) v2:
* Manual Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 61 ++++++++------- .../drm/i915/display/intel_display_types.h | 11 ++- drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++---------- 3 files changed, 79 insertions(+), 69 deletions(-)Quoted 12 lines
drivers/gpu/drm/i915/display/intel_display.c static void ilk_pch_clock_get(struct intel_crtc *crtc, · line 155
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -152,7 +152,7 @@ static void ilk_pch_clock_get(struct intel_crtc *crtc,static int intel_framebuffer_init (struct intel_framebuffer *ifb,struct drm_i915_gem_object *obj,struct drm_mode_fb_cmd2 *mode_cmd); -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state); +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state);These renames make it hard to see what changed. Should be split out.
Quoted 1 line
So just have the renaming in separate patch?
Yeah.
Quoted 504 lines
Manasi
Quoted 502 lines
Quoted 498 lines
drivers/gpu/drm/i915/display/intel_display.c +31
-28static void intel_set_pipe_src_size (const struct intel_crtc_state *crtc_state); static void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, const struct intel_link_m_n *m_n,@@ -6110,18 +6110,16 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,static int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;int width, height;if (crtc_state->pch_pfit.enabled) { width =drm_rect_width (&crtc_state->pch_pfit.dst); height =drm_rect_height (&crtc_state->pch_pfit.dst); }else { - width = adjusted_mode->crtc_hdisplay; - height = adjusted_mode->crtc_vdisplay; + width = pipe_mode->crtc_hdisplay; + height = pipe_mode->crtc_vdisplay; } - return skl_update_scaler(crtc_state, !crtc_state->hw.active, SKL_CRTC_INDEX, &crtc_state->scaler_state.scaler_id,@@ -6901,7 +6899,7 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (new_crtc_state->has_pch_encoder)@@ -7046,7 +7044,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,intel_encoders_pre_enable (state, crtc);if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);@@ -7429,7 +7427,7 @@ static void valleyview_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);if (IS_CHERRYVIEW (dev_priv) && pipe ==PIPE_B ) {@@ -7497,7 +7495,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,if (intel_crtc_has_dp_encoder (new_crtc_state))intel_dp_set_m_n (new_crtc_state,M1_N1 ); -intel_set_pipe_timings (new_crtc_state); +intel_set_transcoder_timings (new_crtc_state);intel_set_pipe_src_size (new_crtc_state);i9xx_set_pipeconf (new_crtc_state);@@ -7971,7 +7969,7 @@ static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc)static u32 ilk_pipe_pixel_rate (const struct intel_crtc_state *crtc_state) { -u32 pixel_rate = crtc_state->hw.adjusted_mode.crtc_clock; +u32 pixel_rate = crtc_state->hw.pipe_mode.crtc_clock;unsigned int pipe_w, pipe_h, pfit_w, pfit_h;/* @@ -8008,7 +8006,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)if (HAS_GMCH (dev_priv))/* FIXME calculate proper pipe pixel rate for GMCH pfit */ crtc_state->pixel_rate = - crtc_state->hw.adjusted_mode.crtc_clock; + crtc_state->hw.pipe_mode.crtc_clock;else crtc_state->pixel_rate =ilk_pipe_pixel_rate (crtc_state);@@ -8018,7 +8016,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq;if (INTEL_GEN (dev_priv) <4 ) {@@ -8029,16 +8027,16 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* is > 90% of the (display) core speed. */ if (intel_crtc_supports_double_wide (crtc) && - adjusted_mode->crtc_clock > clock_limit) { + pipe_mode->crtc_clock > clock_limit) { clock_limit = dev_priv->max_dotclk_freq; pipe_config->double_wide = true; } } -if (adjusted_mode->crtc_clock > clock_limit) { +if (pipe_mode->crtc_clock > clock_limit) {drm_dbg_kms (&dev_priv->drm,"requested pixel clock (%d kHz) too high (max: %d kHz, double wide: %s)\n" , - adjusted_mode->crtc_clock, clock_limit, + pipe_mode->crtc_clock, clock_limit,yesno (pipe_config->double_wide));return -EINVAL ; }@@ -8081,7 +8079,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - adjusted_mode->crtc_hsync_start == adjusted_mode->crtc_hdisplay) + pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -8751,7 +8749,7 @@ static void i8xx_compute_dpll(struct intel_crtc *crtc, crtc_state->dpll_hw_state.dpll = dpll; } -static void intel_set_pipe_timings (const struct intel_crtc_state *crtc_state) +static void intel_set_transcoder_timings (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -8837,8 +8835,8 @@ static bool intel_pipe_is_interlaced(const struct intel_crtc_state *crtc_state)return intel_de_read (dev_priv,PIPECONF (cpu_transcoder)) &PIPECONF_INTERLACE_MASK ; } -static void intel_get_pipe_timings (struct intel_crtc *crtc, -struct intel_crtc_state *pipe_config) +static void intel_get_transcoder_timings (struct intel_crtc *crtc, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -9458,7 +9456,7 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,if (INTEL_GEN (dev_priv) <4 ) pipe_config->double_wide = tmp &PIPECONF_DOUBLE_WIDE ; -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);i9xx_get_pfit_config (pipe_config);@@ -10739,7 +10737,7 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, pipe_config->pixel_multiplier =1 ; } -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config);intel_get_pipe_src_size (crtc, pipe_config);ilk_get_pfit_config (pipe_config);@@ -11147,7 +11145,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,if (!transcoder_is_dsi (pipe_config->cpu_transcoder) ||INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config); -intel_get_pipe_timings (crtc, pipe_config); +intel_get_transcoder_timings (crtc, pipe_config); }intel_get_pipe_src_size (crtc, pipe_config);@@ -12593,15 +12591,15 @@ static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)static u16 hsw_linetime_wm (const struct intel_crtc_state *crtc_state) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;int linetime_wm;if (!crtc_state->hw.enable)return 0 ; - linetime_wm =DIV_ROUND_CLOSEST (adjusted_mode->crtc_htotal *1000 *8 , - adjusted_mode->crtc_clock); + linetime_wm =DIV_ROUND_CLOSEST (pipe_mode->crtc_htotal *1000 *8 , + pipe_mode->crtc_clock);return min (linetime_wm,0x1ff ); }@@ -13218,7 +13216,7 @@ intel_crtc_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.adjusted_mode = crtc_state->uapi.adjusted_mode; + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); }@@ -13325,7 +13323,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* computation to clearly distinguish it from the adjusted mode, which * can be changed by the connectors in the below retry loop. */ -drm_mode_get_hv_timing (&pipe_config->hw.adjusted_mode, +drm_mode_get_hv_timing (&pipe_config->hw.pipe_mode, &pipe_config->pipe_src_w, &pipe_config->pipe_src_h);@@ -13424,6 +13422,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; +/* without bigjoiner, pipe_mode == adjusted_mode */ + pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -18478,6 +18478,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)*/ crtc_state->inherited = true; +/* initialize pipe_mode */ + crtc_state->hw.pipe_mode = crtc_state->hw.adjusted_mode; + mode = crtc_state->hw.adjusted_mode; mode.hdisplay = crtc_state->pipe_src_w; mode.vdisplay = crtc_state->pipe_src_h;drivers/gpu/drm/i915/display/intel_display_types.h +9
-2@@ -799,15 +799,22 @@ struct intel_crtc_state {* The following members are used to verify the hardware state: * - enable * - active -* - mode / adjusted_mode +* - adjusted_mode * - color property blobs. * * During initial hw readout, they need to be copied to uapi. +* +* Bigjoiner will allow a transcoder mode that spans 2 pipes; +* Use the pipe_mode for calculations like watermarks, pipe +* scaler, and bandwidth. +* +* Use adjusted_mode for things that need to know the full +* mode on the transcoder, which spans all pipes. */ struct {bool active, enable;struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; -struct drm_display_mode adjusted_mode; +struct drm_display_mode pipe_mode, adjusted_mode; } hw;/** drivers/gpu/drm/i915/intel_pm.c +38
-38@@ -905,12 +905,12 @@ static void pnv_update_wm(struct intel_crtc *unused_crtc) crtc =single_enabled_crtc (dev_priv);if (crtc) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp = fb->format->cpp[0 ]; -int clock = adjusted_mode->crtc_clock; +int clock = pipe_mode->crtc_clock;/* Display SR */ wm = intel_calculate_wm(clock, &pnv_display_wm,@@ -1141,8 +1141,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int latency = dev_priv->wm.pri_latency[level] *10 ;unsigned int clock, htotal, cpp, width, wm;@@ -1169,8 +1169,8 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, level != G4X_WM_LEVEL_NORMAL) cpp =max (cpp,4u ); - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width =drm_rect_width (&plane_state->uapi.dst);@@ -1666,8 +1666,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;unsigned int clock, htotal, cpp, width, wm;if (dev_priv->wm.pri_latency[level] ==0 )@@ -1677,8 +1677,8 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,return 0 ; cpp = plane_state->hw.fb->format->cpp[0 ]; - clock = adjusted_mode->crtc_clock; - htotal = adjusted_mode->crtc_htotal; + clock = pipe_mode->crtc_clock; + htotal = pipe_mode->crtc_htotal; width = crtc_state->pipe_src_w;if (plane->id ==PLANE_CURSOR ) {@@ -2267,12 +2267,12 @@ static void i965_update_wm(struct intel_crtc *unused_crtc)if (crtc) {/* self-refresh has much higher latency */ static const int sr_latency_ns =12000 ; -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = crtc->config->pipe_src_w;int cpp = fb->format->cpp[0 ];int entries;@@ -2351,8 +2351,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_A ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_A );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2362,7 +2362,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns); enabled = crtc;@@ -2378,8 +2378,8 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc) fifo_size = dev_priv->display.get_fifo_size (dev_priv,PLANE_B ); crtc =intel_get_crtc_for_plane (dev_priv,PLANE_B );if (intel_crtc_active (crtc)) { -const struct drm_display_mode *adjusted_mode = - &crtc->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc->config->hw.pipe_mode;const struct drm_framebuffer *fb = crtc->base.primary->state->fb;int cpp;@@ -2389,7 +2389,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)else cpp = fb->format->cpp[0 ]; - planeb_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + planeb_wm =intel_calculate_wm (pipe_mode->crtc_clock, wm_info, fifo_size, cpp, pessimal_latency_ns);if (enabled ==NULL )@@ -2427,12 +2427,12 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)if (HAS_FW_BLC (dev_priv) && enabled) {/* self-refresh has much higher latency */ static const int sr_latency_ns =6000 ; -const struct drm_display_mode *adjusted_mode = - &enabled->config->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &enabled->config->hw.pipe_mode;const struct drm_framebuffer *fb = enabled->base.primary->state->fb; -int clock = adjusted_mode->crtc_clock; -int htotal = adjusted_mode->crtc_htotal; +int clock = pipe_mode->crtc_clock; +int htotal = pipe_mode->crtc_htotal;int hdisplay = enabled->config->pipe_src_w;int cpp;int entries;@@ -2480,7 +2480,7 @@ static void i845_update_wm(struct intel_crtc *unused_crtc) {struct drm_i915_private *dev_priv =to_i915 (unused_crtc->base.dev);struct intel_crtc *crtc; -const struct drm_display_mode *adjusted_mode; +const struct drm_display_mode *pipe_mode;u32 fwater_lo;int planea_wm;@@ -2488,8 +2488,8 @@ static void i845_update_wm(struct intel_crtc *unused_crtc)if (crtc ==NULL )return ; - adjusted_mode = &crtc->config->hw.adjusted_mode; - planea_wm =intel_calculate_wm (adjusted_mode->crtc_clock, + pipe_mode = &crtc->config->hw.pipe_mode; + planea_wm =intel_calculate_wm (pipe_mode->crtc_clock, &i845_wm_info, dev_priv->display.get_fifo_size (dev_priv,PLANE_A ),4 , pessimal_latency_ns);@@ -2579,7 +2579,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,return method1; method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);@@ -2607,7 +2607,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, method1 =ilk_wm_method1 (crtc_state->pixel_rate, cpp, mem_value); method2 =ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value);return min (method1, method2);@@ -2632,7 +2632,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, cpp = plane_state->hw.fb->format->cpp[0 ];return ilk_wm_method2 (crtc_state->pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal,drm_rect_width (&plane_state->uapi.dst), cpp, mem_value); }@@ -3889,7 +3889,7 @@ static bool skl_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state)if (!crtc_state->hw.active)return true; -if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (crtc_state->hw.pipe_mode.flags &DRM_MODE_FLAG_INTERLACE )return false;intel_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) {@@ -4180,8 +4180,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,*/ total_slice_mask = dbuf_slice_mask;for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) { -const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; +const struct drm_display_mode *pipe_mode = + &crtc_state->hw.pipe_mode;enum pipe pipe = crtc->pipe;int hdisplay, vdisplay;u32 pipe_dbuf_slice_mask;@@ -4211,7 +4211,7 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,if (dbuf_slice_mask != pipe_dbuf_slice_mask)continue ; -drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); +drm_mode_get_hv_timing (pipe_mode, &hdisplay, &vdisplay); total_width_in_range += hdisplay;@@ -5099,7 +5099,7 @@ intel_get_linetime_us(const struct intel_crtc_state *crtc_state)if (drm_WARN_ON (&dev_priv->drm, pixel_rate ==0 ))return u32_to_fixed16 (0 ); - crtc_htotal = crtc_state->hw.adjusted_mode.crtc_htotal; + crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal; linetime_us =div_fixed16 (crtc_htotal *1000 , pixel_rate);return linetime_us;@@ -5288,14 +5288,14 @@ static void skl_compute_plane_wm(const struct intel_crtc_state *crtc_state, method1 =skl_wm_method1 (dev_priv, wp->plane_pixel_rate, wp->cpp, latency, wp->dbuf_block_size); method2 =skl_wm_method2 (wp->plane_pixel_rate, - crtc_state->hw.adjusted_mode.crtc_htotal, + crtc_state->hw.pipe_mode.crtc_htotal, latency, wp->plane_blocks_per_line);if (wp->y_tiled) { selected_result =max_fixed16 (method2, wp->y_tile_minimum); }else { -if ((wp->cpp * crtc_state->hw.adjusted_mode.crtc_htotal / +if ((wp->cpp * crtc_state->hw.pipe_mode.crtc_htotal / wp->dbuf_block_size <1 ) && (wp->plane_bytes_per_line / wp->dbuf_block_size <1 )) { selected_result = method2;Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 4/11 drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
In reply to Manasi NavareFrom: Maarten Lankhorst <[email protected]>
Small changes to intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.
eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)
Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Rename intel_dp_downstream_max_dotclock to intel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ; plane_height_max =4320 ; }else { plane_width_max =5120 ;
drivers/gpu/drm/i915/display/intel_dp.c +90 -29
204 lines not on this page · raw message
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Op 16-07-2020 om 00:42 schreef Manasi Navare:
Quoted 23 lines
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)
Quoted 2 lines
Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>
Looking good, but I think you should have someone else review it as well to be certain. :)
Quoted 226 lines
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ; plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +87
-28@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay,
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2275
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-1+ false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
In reply to Manasi NavareQuoted 35 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;
Other encoder also use this function and big joiner on DP only need this change. Is it good idea to add encoder check? Maybe in a cover-letter can we add some description about big-joiner feature and current limitation.
Overall changes looks good to me, for dsc related code better get a review from someone who has worked before.
Regards,
Animesh
Quoted 211 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +87
-28@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay,
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2275
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-1+ false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 32 lines · Animesh
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)
Quoted 15 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;Other encoder also use this function and big joiner on DP only need this change. Is it good idea to add encoder check? Maybe in a cover-letter can we add some description about big-joiner feature and current limitation.
Overall changes looks good to me, for dsc related code better get a review from someone who has worked before.
Yes I think the plane width max also should only be changed to 7680 if big joiner is supported so this needs some tweak anyways. I will take a look into this.
Also will sync with Maarten on what might be the best approach.
Manasi
Quoted 197 lines
Regards,
AnimeshQuoted 193 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +88
-28@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2275
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-1intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
In reply to Manasi NavareQuoted 35 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;
This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Quoted 228 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.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
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)
Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Hmm, so the caller of intel_mode_valid_max_plane_size() should check on the bigjoiner flag and perhaps if bigjoiner is true then increase the plane_width_max to 7680?
Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in intel_mode_valid
Where should this be added according to you?
Manasi
Quoted 225 lines
Quoted 225 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 1 line
2.19.1
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 47 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Quoted 7 lines
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validWhere should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
Personally I'd just write the thing as something like:intel_mode_valid_max_plane_size(..., bool bigjoiner)
{
...
plane_width_max = 5120 << bigjoiner;
...
}Quoted 235 lines
Manasi
Quoted 233 lines
Quoted 229 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 54 lines · Ville Syrjälä
Quoted 53 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_valid
Quoted 7 lines
Quoted 1 line
Where should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
So in intel_dp_mode_valid() we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true in intel_dp_mode_valid() and then pass that to intel_mode_valid_max_plane_size(..., book bigjoiner)
Sounds good?
Quoted 235 lines
Personally I'd just write the thing as something like:
intel_mode_valid_max_plane_size(..., bool bigjoiner){ ... plane_width_max = 5120 << bigjoiner; ... }Quoted 227 lines
Manasi
Quoted 225 lines
Quoted 225 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 1 line
2.19.1
Quoted 12 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 63 lines · Manasi
Quoted 54 lines · Ville Syrjälä
Quoted 53 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validQuoted 7 lines
Quoted 1 line
Where should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
Quoted 4 lines
So in
intel_dp_mode_valid()we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true inintel_dp_mode_valid()and then pass that tointel_mode_valid_max_plane_size(..., book bigjoiner)
can_bigjoiner() {
return gen >= 12 || (gen==11 && port!=A);
}or something.
Quoted 250 lines
Sounds good?
Quoted 247 lines
Personally I'd just write the thing as something like:
intel_mode_valid_max_plane_size(..., bool bigjoiner){ ... plane_width_max = 5120 << bigjoiner; ... }Quoted 235 lines
Manasi
Quoted 233 lines
Quoted 229 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 64 lines · Ville Syrjälä
Quoted 63 lines · Manasi
Quoted 61 lines · Ville Syrjälä
Quoted 47 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Quoted 7 lines
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validWhere should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
Quoted 8 lines
Quoted 4 lines
So in
intel_dp_mode_valid()we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true inintel_dp_mode_valid()and then pass that tointel_mode_valid_max_plane_size(..., book bigjoiner)can_bigjoiner() { return gen >= 12 || (gen==11 && port!=A); }
Hmm, gen check can be done but can the port check be done in intel_dp_mode_valid() since we dont have an encoder yet?
Else we set the bigjoiner to true here based on gen check but add the port check later in compute_config at what point if not supported then encoder config will fail.
or can this be sufficient check:
can_bigjoiner() {
return gen >= 12 || (gen == 11 && !intel_dp_is_edp())
}Manasi
Quoted 250 lines
or something.
Quoted 247 lines
Sounds good?
Quoted 244 lines
Personally I'd just write the thing as something like:
intel_mode_valid_max_plane_size(..., bool bigjoiner){ ... plane_width_max = 5120 << bigjoiner; ... }Quoted 235 lines
Manasi
Quoted 233 lines
Quoted 229 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 70 lines · Manasi
Quoted 69 lines · Ville Syrjälä
Quoted 67 lines · Manasi
Quoted 54 lines · Ville Syrjälä
Quoted 53 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validQuoted 7 lines
Quoted 1 line
Where should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
So in
intel_dp_mode_valid()we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true inintel_dp_mode_valid()and then pass that tointel_mode_valid_max_plane_size(..., book bigjoiner)
Quoted 6 lines
Quoted 3 lines
can_bigjoiner() { return gen >= 12 || (gen==11 && port!=A); }Hmm, gen check can be done but can the port check be done in
intel_dp_mode_valid()since we dont have an encoder yet?
The encoder is there already.
Quoted 268 lines
Else we set the bigjoiner to true here based on gen check but add the port check later in
compute_configat what point if not supported then encoder config will fail.or can this be sufficient check:
can_bigjoiner() { return gen >= 12 || (gen == 11 && !intel_dp_is_edp()) }Manasi
Quoted 257 lines
or something.
Quoted 250 lines
Sounds good?
Quoted 247 lines
Personally I'd just write the thing as something like:
intel_mode_valid_max_plane_size(..., bool bigjoiner){ ... plane_width_max = 5120 << bigjoiner; ... }Quoted 235 lines
Manasi
Quoted 233 lines
Quoted 229 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 66 lines · Ville Syrjälä
Quoted 65 lines · Manasi
Quoted 64 lines · Ville Syrjälä
Quoted 63 lines · Manasi
Quoted 61 lines · Ville Syrjälä
Quoted 47 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Quoted 7 lines
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validWhere should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
So in
intel_dp_mode_valid()we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true inintel_dp_mode_valid()and then pass that tointel_mode_valid_max_plane_size(..., book bigjoiner)can_bigjoiner() { return gen >= 12 || (gen==11 && port!=A);
On Gen 11, Port A is eDP or MIPI DSI so I could check:
can_bigjoiner()
{
return gen >=12 || (gen == 11 && !intel_dp_is_edp())
}The above should be okay right?
Manasi
Quoted 268 lines
Quoted 4 lines
Quoted 1 line
}
Hmm, gen check can be done but can the port check be done in
intel_dp_mode_valid()since we dont have an encoder yet?The encoder is there already.
Quoted 261 lines
Else we set the bigjoiner to true here based on gen check but add the port check later in
compute_configat what point if not supported then encoder config will fail.or can this be sufficient check:
can_bigjoiner() { return gen >= 12 || (gen == 11 && !intel_dp_is_edp()) }Manasi
Quoted 250 lines
or something.
Quoted 247 lines
Sounds good?
Quoted 244 lines
Personally I'd just write the thing as something like:
intel_mode_valid_max_plane_size(..., bool bigjoiner){ ... plane_width_max = 5120 << bigjoiner; ... }Quoted 235 lines
Manasi
Quoted 233 lines
Quoted 229 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0plane_height_max =4320 ; }else { plane_width_max =5120 ;drivers/gpu/drm/i915/display/intel_dp.c +90
-29@@ -248,25 +248,37 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)return max_link_clock * max_lanes; } -static int -intel_dp_downstream_max_dotclock (struct intel_dp *intel_dp) +static int source_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) { -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct intel_encoder *encoder = &dig_port->base; +struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); +struct intel_encoder *encoder = &intel_dig_port->base;struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -int max_dotclk = dev_priv->max_dotclk_freq; -int ds_max_dotclk; +if (allow_bigjoiner &&INTEL_GEN (dev_priv) >=11 && !intel_dp_is_edp (intel_dp)) +return 2 * dev_priv->max_dotclk_freq; + +return dev_priv->max_dotclk_freq; +} + +static int downstream_max_dotclock (struct intel_dp *intel_dp) +{int type = intel_dp->downstream_ports[0 ] &DP_DS_PORT_TYPE_MASK ;if (type !=DP_DS_PORT_TYPE_VGA ) -return max_dotclk; +return 0 ; - ds_max_dotclk =drm_dp_downstream_max_clock (intel_dp->dpcd, - intel_dp->downstream_ports); +return drm_dp_downstream_max_clock (intel_dp->dpcd, + intel_dp->downstream_ports); +} + +static int +intel_dp_max_dotclock (struct intel_dp *intel_dp,bool allow_bigjoiner) +{ +int max_dotclk =source_max_dotclock (intel_dp, allow_bigjoiner); +int ds_max_dotclk =downstream_max_dotclock (intel_dp);if (ds_max_dotclk !=0 ) - max_dotclk =min (max_dotclk, ds_max_dotclk); +return min (max_dotclk, ds_max_dotclk);return max_dotclk; }@@ -527,7 +539,8 @@ small_joiner_ram_size_bits(struct drm_i915_private *i915)static u16 intel_dp_dsc_get_output_bpp (struct drm_i915_private *i915,u32 link_clock,u32 lane_count, -u32 mode_clock,u32 mode_hdisplay) +u32 mode_clock,u32 mode_hdisplay, +bool bigjoiner) {u32 bits_per_pixel, max_bpp_small_joiner_ram;int i;@@ -545,6 +558,10 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */ max_bpp_small_joiner_ram =small_joiner_ram_size_bits (i915) / mode_hdisplay; + +if (bigjoiner) + max_bpp_small_joiner_ram *=2 ; +drm_dbg_kms (&i915->drm,"Max small joiner bpp: %u\n" , max_bpp_small_joiner_ram);@@ -554,6 +571,15 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915,*/ bits_per_pixel =min (bits_per_pixel, max_bpp_small_joiner_ram); +if (bigjoiner) { +u32 max_bpp_bigjoiner = + i915->max_cdclk_freq *48 / +intel_dp_mode_to_fec_clock (mode_clock); + +DRM_DEBUG_KMS ("Max big joiner bpp: %u\n" , max_bpp_bigjoiner); + bits_per_pixel =min (bits_per_pixel, max_bpp_bigjoiner); + } +/* Error out if the max bpp is less than smallest allowed valid bpp */ if (bits_per_pixel < valid_dsc_bpp[0 ]) { drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min %u\n",@@ -576,7 +602,8 @@ static u16 intel_dp_dsc_get_output_bpp(struct drm_i915_private *i915, }static u8 intel_dp_dsc_get_slice_count (struct intel_dp *intel_dp, -int mode_clock,int mode_hdisplay) +int mode_clock,int mode_hdisplay, +bool bigjoiner) {struct drm_i915_private *i915 =dp_to_i915 (intel_dp);u8 min_slice_count, i;@@ -603,12 +630,20 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,/* Find the closest match to the valid slice count values */ for (i =0 ; i <ARRAY_SIZE (valid_dsc_slicecount); i++) { -if (valid_dsc_slicecount[i] > -drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, - false)) +u8 test_slice_count = bigjoiner ? +2 * valid_dsc_slicecount[i] : + valid_dsc_slicecount[i]; + +if (test_slice_count > +drm_dp_dsc_sink_max_slice_count (intel_dp->dsc_dpcd, false))break ; -if (min_slice_count <= valid_dsc_slicecount[i]) -return valid_dsc_slicecount[i]; + +/* big joiner needs small joiner to be enabled */ +if (bigjoiner && test_slice_count <4 ) +continue ; + +if (min_slice_count <= test_slice_count) +return test_slice_count; } drm_dbg_kms(&i915->drm, "Unsupported Slice Count %d\n",@@ -648,11 +683,15 @@ intel_dp_mode_valid(struct drm_connector *connector,int max_dotclk;u16 dsc_max_output_bpp =0 ;u8 dsc_slice_count =0 ; +bool dsc = false, bigjoiner = false;if (mode->flags &DRM_MODE_FLAG_DBLSCAN )return MODE_NO_DBLESCAN ; - max_dotclk =intel_dp_downstream_max_dotclock (intel_dp); +if (mode->flags &DRM_MODE_FLAG_DBLCLK ) +return MODE_H_ILLEGAL ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, false);if (intel_dp_is_edp (intel_dp) && fixed_mode) {if (mode->hdisplay > fixed_mode->hdisplay)@@ -664,6 +703,21 @@ intel_dp_mode_valid(struct drm_connector *connector, target_clock = fixed_mode->clock; } +if (mode->clock <10000 ) +return MODE_CLOCK_LOW ; + +if (target_clock > max_dotclk) { +if (intel_dp_is_edp (intel_dp)) +return MODE_CLOCK_HIGH ; + + max_dotclk =intel_dp_max_dotclock (intel_dp, true); + +if (target_clock > max_dotclk) +return MODE_CLOCK_HIGH ; + + bigjoiner = true; + } + max_link_clock =intel_dp_max_link_rate (intel_dp); max_lanes =intel_dp_max_lane_count (intel_dp);@@ -691,23 +745,28 @@ intel_dp_mode_valid(struct drm_connector *connector, max_link_clock, max_lanes, target_clock, - mode->hdisplay) >> 4; + mode->hdisplay, + bigjoiner) >> 4; dsc_slice_count =intel_dp_dsc_get_slice_count (intel_dp, target_clock, - mode->hdisplay); + mode->hdisplay, + bigjoiner); } + + dsc = dsc_max_output_bpp && dsc_slice_count; } -if ((mode_rate > max_rate && !(dsc_max_output_bpp && dsc_slice_count)) || - target_clock > max_dotclk) +/* big joiner configuration needs DSC */ +if (bigjoiner && !dsc) { +DRM_DEBUG_KMS ("Link clock needs bigjoiner, but DSC or FEC not available\n" );return MODE_CLOCK_HIGH ; + } -if (mode->clock <10000 ) -return MODE_CLOCK_LOW ; - -if (mode->flags &DRM_MODE_FLAG_DBLCLK ) -return MODE_H_ILLEGAL ; +if (mode_rate > max_rate && !dsc) { +DRM_DEBUG_KMS ("Cannot drive without DSC\n" ); +return MODE_CLOCK_HIGH ; + }return intel_mode_valid_max_plane_size (dev_priv, mode); }@@ -2204,11 +2263,13 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock, pipe_config->lane_count, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, - adjusted_mode->crtc_hdisplay); + adjusted_mode->crtc_hdisplay, + false);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä IntelSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3.
Quoted 75 lines · Manasi
Quoted 66 lines · Ville Syrjälä
Quoted 65 lines · Manasi
Quoted 64 lines · Ville Syrjälä
Quoted 63 lines · Manasi
Quoted 61 lines · Ville Syrjälä
Quoted 47 lines · Manasi
Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Small changes to
intel_dp_mode_valid(), allow listing modes that can only be supported in the bigjoiner configuration, which is not supported yet.eDP does not support bigjoiner, so do not expose bigjoiner only modes on the eDP port.
v5:
* Increase max plane width to support 8K with bigjoiner (Maarten) v4:
* Rebase (Manasi)Changes since v1:
- Disallow bigjoiner on eDP.
Changes since v2:
- Renameintel_dp_downstream_max_dotclocktointel_dp_max_dotclock, and split off the downstream and source checking to its own function. (Ville)
v3:
* Rebase (Manasi)Signed-off-by Manasi Navare <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 119 ++++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-)Quoted 14 lines
drivers/gpu/drm/i915/display/intel_display.c intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv, · line 17403
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -17400,7 +17400,7 @@ intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,* too big for that. */ if (INTEL_GEN (dev_priv) >=11 ) { - plane_width_max =5120 ; + plane_width_max =7680 ;This looks misplaced. Planes do no know whether bigjoiner can be used or not. They should not care in fact. The caller should have that knowledge and can deal with it properly.
Quoted 7 lines
Hmm, so the caller of
intel_mode_valid_max_plane_size()should check on the bigjoiner flag and perhaps if bigjoiner is true then increase theplane_width_maxto 7680?Am still not sure where this should happen? We need to have the plane max width to be 7680 before we prune the 8K mode in
intel_mode_validWhere should this be added according to you?
Hmm. I guess we do need to put it into this function given the way this is structured. However we still can't assume bigjoiner can be used since it can't be used on DDI A on icl. So we should probably just pass in a bool here to indicate whether bigjoiner can be used or not.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
So in
intel_dp_mode_valid()we set bigjoiner = true if not edp and higher clock.
I think here we need to do the platform check also, 1. because now we are enabling this for TGL+ where big joiner on all pipes. But we should still I think add GEN >=12 check before setting bigjoiner to true inintel_dp_mode_valid()and then pass that tointel_mode_valid_max_plane_size(..., book bigjoiner)can_bigjoiner() { return gen >= 12 || (gen==11 && port!=A);
Quoted 8 lines
On Gen 11, Port A is eDP or MIPI DSI so I could check:
can_bigjoiner(){ return gen >=12 || (gen == 11 && !intel_dp_is_edp()) }The above should be okay right?
No. Check for port A.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 5/11 drm/i915: Try to make bigjoiner work in atomic check
In reply to Manasi NavareFrom: Maarten Lankhorst <[email protected]>
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc.
This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's crtc_state, so it doesn't depend at commit time on the other crtc_state.
v3:
* Manual Rebase (Manasi)
Changes since v1:
- Rename pipe timings to transcoder timings, as they are now different. Changes since v2:
- Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more.
- Use pipe_mode instead of transcoder_mode, to clean up the code.
--- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 201 ++++++++++++++++-- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 211 insertions(+), 33 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic.c +5 -4
@@ -270,14 +270,15 @@ 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) +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) {drm_property_replace_blob (&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut);drm_property_replace_blob (&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut);drm_property_replace_blob (&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); }/**
drivers/gpu/drm/i915/display/intel_atomic.h +2 -1
@@ -43,7 +43,8 @@ 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); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_free (struct drm_atomic_state *state);void intel_atomic_state_clear (struct drm_atomic_state *state);
drivers/gpu/drm/i915/display/intel_display.c +179 -22
310 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display_types.h +9 -0
@@ -1053,6 +1053,15 @@ struct intel_crtc_state {/* enable pipe csc? */ bool csc_enable; +/* enable pipe big joiner? */ +bool bigjoiner; + +/* big joiner slave crtc? */ +bool bigjoiner_slave; + +/* linked crtc for bigjoiner, either slave or master */ +struct intel_crtc *bigjoiner_linked_crtc; +/* Display Stream compression state */ struct {bool compression_enable;
drivers/gpu/drm/i915/display/intel_dp.c +16 -6
@@ -2247,6 +2247,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock = intel_dp->common_rates[limits->max_clock]; pipe_config->lane_count = limits->max_lane_count; +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, false)) { +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, true)) { +DRM_DEBUG_KMS ("Clock rate too high for big joiner\n" ); +return -EINVAL ; + } + pipe_config->bigjoiner = true; +DRM_DEBUG_KMS ("Using bigjoiner configuration\n" ); + } +if (intel_dp_is_edp (intel_dp)) { pipe_config->dsc.compressed_bpp = min_t(u16, drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4,
@@ -2264,12 +2273,12 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->lane_count, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );
@@ -2285,14 +2294,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,* is greater than the maximum Cdclock and if slice count is even * then we need to use 2 VDSC instances. */ -if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq) { -if (pipe_config->dsc.slice_count >1 ) { - pipe_config->dsc.dsc_split = true; - }else { +if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq || + pipe_config->bigjoiner) { +if (pipe_config->dsc.slice_count <2 ) {drm_dbg_kms (&dev_priv->drm,"Cannot split stream to use 2 VDSC instances\n" );return -EINVAL ; } + + pipe_config->dsc.dsc_split = true; } ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 05/11] drm/i915: Try to make bigjoiner work in atomic check
Quoted 35 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc.
This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's
crtc_state, so it doesn't depend at commit time on the othercrtc_state.v3:
* Manual Rebase (Manasi)
Changes since v1:
- Rename pipe timings to transcoder timings, as they are now different. Changes since v2:
- Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more.
- Usepipe_modeinstead oftranscoder_mode, to clean up the code.Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 201 ++++++++++++++++-- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 211 insertions(+), 33 deletions(-)drivers/gpu/drm/i915/display/intel_atomic.c +0
-0
drivers/gpu/drm/i915/display/intel_atomic.c void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) · line 274
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_atomic.c +2
-1@@ -270,14 +270,15 @@ 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) +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state)
can we use primary_crtc_state instead of from_crtc_state?
Quoted 67 lines
drivers/gpu/drm/i915/display/intel_atomic.c +3
-3{drm_property_replace_blob (&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut);drm_property_replace_blob (&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut);drm_property_replace_blob (&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); }/** drivers/gpu/drm/i915/display/intel_atomic.h +2
-1@@ -43,7 +43,8 @@ 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); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_free (struct drm_atomic_state *state);void intel_atomic_state_clear (struct drm_atomic_state *state);drivers/gpu/drm/i915/display/intel_display.c +17
-2@@ -8016,9 +8016,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; +struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq; + *pipe_mode = pipe_config->hw.adjusted_mode; + +/* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ +if (pipe_config->bigjoiner) { + pipe_mode->crtc_clock /=2 ; + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_config->pipe_src_w /=2 ; + } +if (INTEL_GEN (dev_priv) <4 ) { clock_limit = dev_priv->max_cdclk_freq *9 /10 ;@@ -8079,7 +8094,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay) + pipe_config->hw.adjusted_mode.crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);
drivers/gpu/drm/i915/display/intel_display.c static bool encoders_cloneable(const struct intel_encoder *a, · line 12451
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -12433,7 +12448,7 @@ static bool encoders_cloneable(const struct intel_encoder *a, b->cloneable & (1 << a->type)); } -static bool check_single_encoder_cloning(struct drm_atomic_state *state, +static bool check_single_encoder_cloning(struct intel_atomic_state *state,
we may not need it.
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1struct intel_crtc *crtc, struct intel_encoder *encoder) {@@ -12442,7 +12457,7 @@ static bool check_single_encoder_cloning(struct drm_atomic_state *state,struct drm_connector_state *connector_state;int i; -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {if (connector_state->crtc != &crtc->base)continue ;
drivers/gpu/drm/i915/display/intel_display.c static int intel_crtc_atomic_check(struct intel_atomic_state *state, · line 12700
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-0@@ -12682,6 +12697,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state, if (mode_changed && crtc_state->hw.enable && dev_priv->display.crtc_compute_clock && + !crtc_state->bigjoiner_slave &&
based on recent direction better to use primary/secondary keyword instead of master/slave.
Quoted 293 lines
drivers/gpu/drm/i915/display/intel_display.c +159
-18!drm_WARN_ON(&dev_priv->drm, crtc_state->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock (crtc, crtc_state);if (ret)@@ -13206,18 +13222,31 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state) }static void -intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) { -intel_crtc_copy_color_blobs (crtc_state); +const struct intel_crtc_state *from_crtc_state = crtc_state; + +if (crtc_state->bigjoiner_slave) { + from_crtc_state =intel_atomic_get_new_crtc_state (state, + crtc_state->bigjoiner_linked_crtc); + +/* No need to copy state if the master state is unchanged */ +if (!from_crtc_state) +return ; + } + +intel_crtc_copy_color_blobs (crtc_state, from_crtc_state); }static void -intel_crtc_copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state (struct intel_atomic_state *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.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; -intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, crtc_state); } static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,@@ -13240,7 +13269,49 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state }static int -intel_crtc_prepare_cleared_state (struct intel_crtc_state *crtc_state) +copy_bigjoiner_crtc_state (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) +{ +struct intel_crtc_state *saved_state; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); + + saved_state =kmemdup (from_crtc_state,sizeof (*saved_state),GFP_KERNEL ); +if (!saved_state) +return -ENOMEM ; + + 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; + saved_state->crc_enabled = crtc_state->crc_enabled; + +intel_crtc_free_hw_state (crtc_state); +memcpy (crtc_state, saved_state,sizeof (*crtc_state)); +kfree (saved_state); + +/* Re-init hw state */ +memset (&crtc_state->hw,0 ,sizeof (saved_state->hw)); + crtc_state->hw.enable = from_crtc_state->hw.enable; + crtc_state->hw.active = from_crtc_state->hw.active; + crtc_state->hw.pipe_mode = from_crtc_state->hw.pipe_mode; + crtc_state->hw.adjusted_mode = from_crtc_state->hw.adjusted_mode; + +/* Some fixups */ + crtc_state->uapi.mode_changed = from_crtc_state->uapi.mode_changed; + crtc_state->uapi.connectors_changed = from_crtc_state->uapi.connectors_changed; + crtc_state->uapi.active_changed = from_crtc_state->uapi.active_changed; + crtc_state->nv12_planes = crtc_state->c8_planes = crtc_state->update_planes =0 ; + crtc_state->bigjoiner_linked_crtc =to_intel_crtc (from_crtc_state->uapi.crtc); + crtc_state->bigjoiner_slave = true; + crtc_state->cpu_transcoder = (enum transcoder )crtc->pipe; + crtc_state->has_audio = false; + +return 0 ; +} + +static int +intel_crtc_prepare_cleared_state (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -13276,16 +13347,16 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state) crtc_state->uapi.mode.private_flags =0 ; crtc_state->uapi.adjusted_mode.private_flags =0 ; -intel_crtc_copy_uapi_to_hw_state (crtc_state); +intel_crtc_copy_uapi_to_hw_state (state, crtc_state);return 0 ; }static int -intel_modeset_pipe_config (struct intel_crtc_state *pipe_config) +intel_modeset_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *pipe_config) {struct drm_crtc *crtc = pipe_config->uapi.crtc; -struct drm_atomic_state *state = pipe_config->uapi.state;struct drm_i915_private *i915 =to_i915 (pipe_config->uapi.crtc->dev);struct drm_connector *connector;struct drm_connector_state *connector_state;@@ -13327,7 +13398,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) &pipe_config->pipe_src_w, &pipe_config->pipe_src_h); -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13365,7 +13436,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* adjust it according to limitations or connector properties, and also * a chance to reject the mode entirely. */ -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13422,8 +13493,6 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; -/* without bigjoiner, pipe_mode == adjusted_mode */ - pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -14820,6 +14889,75 @@ static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,return false; } +static int intel_atomic_check_bigjoiner (struct intel_atomic_state *state, +struct intel_crtc *crtc, +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); +struct intel_crtc_state *slave_crtc_state, *master_crtc_state; +struct intel_crtc *slave, *master; + +/* slave being enabled, is master is still claiming this crtc? */ +if (old_crtc_state->bigjoiner_slave) { + slave = crtc; + master = old_crtc_state->bigjoiner_linked_crtc; + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); +if (!master_crtc_state || !needs_modeset (master_crtc_state)) + goto claimed; + } + +if (!new_crtc_state->bigjoiner) +return 0 ; + +if (1 + crtc->pipe >=INTEL_NUM_PIPES (dev_priv)) { +DRM_DEBUG_KMS ("[CRTC:%d:%s] Big joiner configuration requires " +"CRTC + 1 to be used, doesn't exist\n" , + crtc->base.base.id, crtc->base.name); +return -EINVAL ; + } + + slave = new_crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe +1 ); + slave_crtc_state =intel_atomic_get_crtc_state (&state->base, slave); + master = crtc; +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + +/* master being enabled, slave was already configured? */ +if (slave_crtc_state->uapi.enable) + goto claimed; + +DRM_DEBUG_KMS ("[CRTC:%d:%s] Used as slave for big joiner\n" , + slave->base.base.id, slave->base.name); + +return copy_bigjoiner_crtc_state (slave_crtc_state, new_crtc_state); + +claimed: +DRM_DEBUG_KMS ("[CRTC:%d:%s] Slave is enabled as normal CRTC, but " +"[CRTC:%d:%s] claiming this CRTC for bigjoiner.\n" , + slave->base.base.id, slave->base.name, + master->base.base.id, master->base.name); +return -EINVAL ; +} + +static int kill_bigjoiner_slave (struct intel_atomic_state *state, +struct intel_crtc_state *master_crtc_state) +{ +struct intel_crtc_state *slave_crtc_state = +intel_atomic_get_crtc_state (&state->base, + master_crtc_state->bigjoiner_linked_crtc); + +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + + slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false; + slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false; + slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc =NULL ; +intel_crtc_copy_uapi_to_hw_state (state, slave_crtc_state); +return 0 ; +} +/** * intel_atomic_check - validate state object * @dev: drm device @@ -14849,19 +14987,36 @@ static int intel_atomic_check(struct drm_device *dev, new_crtc_state, i) {if (!needs_modeset (new_crtc_state)) {/* Light copy */ -intel_crtc_copy_uapi_to_hw_state_nomodeset (new_crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, new_crtc_state);continue ; } - ret =intel_crtc_prepare_cleared_state (new_crtc_state); +/* Kill old bigjoiner link, we may re-establish afterwards */ +if (old_crtc_state->bigjoiner && !old_crtc_state->bigjoiner_slave) { + ret =kill_bigjoiner_slave (state, new_crtc_state); +if (ret) + goto fail; + } + +if (!new_crtc_state->uapi.enable) { +if (!new_crtc_state->bigjoiner_slave) { +intel_crtc_copy_uapi_to_hw_state (state, new_crtc_state); + any_ms = true; + } +continue ; + } + + ret =intel_crtc_prepare_cleared_state (state, new_crtc_state);if (ret) goto fail; -if (!new_crtc_state->hw.enable) -continue ; + ret =intel_modeset_pipe_config (state, new_crtc_state); +if (ret) + goto fail; - ret =intel_modeset_pipe_config (new_crtc_state); + ret =intel_atomic_check_bigjoiner (state, crtc, old_crtc_state, + new_crtc_state);if (ret) goto fail; }@@ -15193,7 +15348,9 @@ static void intel_update_crtc(struct intel_atomic_state *state,commit_pipe_config (state, crtc); -if (INTEL_GEN (dev_priv) >=9 ) +if (new_crtc_state->bigjoiner) { +/* Not supported yet */ + }else if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc);drivers/gpu/drm/i915/display/intel_display_types.h +9
-0@@ -1053,6 +1053,15 @@ struct intel_crtc_state {/* enable pipe csc? */ bool csc_enable; +/* enable pipe big joiner? */ +bool bigjoiner; + +/* big joiner slave crtc? */ +bool bigjoiner_slave; + +/* linked crtc for bigjoiner, either slave or master */ +struct intel_crtc *bigjoiner_linked_crtc; +/* Display Stream compression state */ struct {bool compression_enable;drivers/gpu/drm/i915/display/intel_dp.c +0
-0@@ -2247,6 +2247,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock = intel_dp->common_rates[limits->max_clock]; pipe_config->lane_count = limits->max_lane_count;
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2258
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +9
-0+if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, false)) { +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, true)) { +DRM_DEBUG_KMS ("Clock rate too high for big joiner\n" ); +return -EINVAL ; + } + pipe_config->bigjoiner = true; +DRM_DEBUG_KMS ("Using bigjoiner configuration\n" ); + } +
Adding a flag for big-joiner and setting it can be part of previous patch and instead of using true/false directly it can be used in dsc functions. Other changes looks fine to me.
Regards,
Animesh
Quoted 28 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-6if (intel_dp_is_edp (intel_dp)) { pipe_config->dsc.compressed_bpp = min_t(u16, drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4,@@ -2264,12 +2273,12 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->lane_count, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );@@ -2285,14 +2294,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,* is greater than the maximum Cdclock and if slice count is even * then we need to use 2 VDSC instances. */ -if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq) { -if (pipe_config->dsc.slice_count >1 ) { - pipe_config->dsc.dsc_split = true; - }else { +if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq || + pipe_config->bigjoiner) {
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2308
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +3
-0+if (pipe_config->dsc.slice_count <2 ) {drm_dbg_kms (&dev_priv->drm,"Cannot split stream to use 2 VDSC instances\n" );return -EINVAL ; } + + pipe_config->dsc.dsc_split = true; } ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 05/11] drm/i915: Try to make bigjoiner work in atomic check
Quoted 32 lines · Animesh
Quoted 30 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc.
This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's
crtc_state, so it doesn't depend at commit time on the othercrtc_state.v3:
* Manual Rebase (Manasi)
Changes since v1:
- Rename pipe timings to transcoder timings, as they are now different. Changes since v2:
- Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more.
- Usepipe_modeinstead oftranscoder_mode, to clean up the code.Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 201 ++++++++++++++++-- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 211 insertions(+), 33 deletions(-)
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_atomic.c void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state) · line 273
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_atomic.c +2
-1@@ -270,14 +270,15 @@ 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) +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state)can we use
primary_crtc_stateinstead offrom_crtc_state?
You mean more intiutive naming instead of from_crtc_state ?
I feel primary_crtc_state might be confusing with primary/secondary planes naming But may be we call it master_crtc_state or primary_big_joiner_crtc_state ?
@Maarten @Ville, any thoughts on better naming here?
Quoted 62 lines
Quoted 62 lines
drivers/gpu/drm/i915/display/intel_atomic.c +3
-3{drm_property_replace_blob (&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut);drm_property_replace_blob (&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut);drm_property_replace_blob (&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); }/** drivers/gpu/drm/i915/display/intel_atomic.h +2
-1@@ -43,7 +43,8 @@ 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); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_free (struct drm_atomic_state *state);void intel_atomic_state_clear (struct drm_atomic_state *state);drivers/gpu/drm/i915/display/intel_display.c +17
-2@@ -8016,9 +8016,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; +struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq; + *pipe_mode = pipe_config->hw.adjusted_mode; + +/* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ +if (pipe_config->bigjoiner) { + pipe_mode->crtc_clock /=2 ; + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_config->pipe_src_w /=2 ; + } +if (INTEL_GEN (dev_priv) <4 ) { clock_limit = dev_priv->max_cdclk_freq *9 /10 ;@@ -8079,7 +8094,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay) + pipe_config->hw.adjusted_mode.crtc_hsync_start == pipe_mode->crtc_hdisplay)return -EINVAL ;
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_display.c static bool encoders_cloneable(const struct intel_encoder *a, · line 12450
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1intel_crtc_compute_pixel_rate (pipe_config);@@ -12433,7 +12448,7 @@ static bool encoders_cloneable(const struct intel_encoder *a, b->cloneable & (1 << a->type)); } -static bool check_single_encoder_cloning(struct drm_atomic_state *state, +static bool check_single_encoder_cloning(struct intel_atomic_state *state,we may not need it.
What do you mean we may not need it? Do you mean making it static not needed?
Quoted 17 lines
Quoted 12 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1struct intel_crtc *crtc, struct intel_encoder *encoder) {@@ -12442,7 +12457,7 @@ static bool check_single_encoder_cloning(struct drm_atomic_state *state,struct drm_connector_state *connector_state;int i; -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {if (connector_state->crtc != &crtc->base)continue ;drivers/gpu/drm/i915/display/intel_display.c static int intel_crtc_atomic_check(struct intel_atomic_state *state, · line 12699
Quoted 3 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-0@@ -12682,6 +12697,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state, if (mode_changed && crtc_state->hw.enable && dev_priv->display.crtc_compute_clock && + !crtc_state->bigjoiner_slave &&based on recent direction better to use primary/secondary keyword instead of master/slave.
Hmm, but in terms of big joiner terminology, we still call it master and slave. But we can discuss offline on the recent direction and figure out the best naming.
Manasi
Quoted 319 lines
Quoted 274 lines
drivers/gpu/drm/i915/display/intel_display.c +159
-18!drm_WARN_ON(&dev_priv->drm, crtc_state->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock (crtc, crtc_state);if (ret)@@ -13206,18 +13222,31 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state) }static void -intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) { -intel_crtc_copy_color_blobs (crtc_state); +const struct intel_crtc_state *from_crtc_state = crtc_state; + +if (crtc_state->bigjoiner_slave) { + from_crtc_state =intel_atomic_get_new_crtc_state (state, + crtc_state->bigjoiner_linked_crtc); + +/* No need to copy state if the master state is unchanged */ +if (!from_crtc_state) +return ; + } + +intel_crtc_copy_color_blobs (crtc_state, from_crtc_state); }static void -intel_crtc_copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state (struct intel_atomic_state *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.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; -intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, crtc_state); } static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,@@ -13240,7 +13269,49 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state }static int -intel_crtc_prepare_cleared_state (struct intel_crtc_state *crtc_state) +copy_bigjoiner_crtc_state (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) +{ +struct intel_crtc_state *saved_state; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); + + saved_state =kmemdup (from_crtc_state,sizeof (*saved_state),GFP_KERNEL ); +if (!saved_state) +return -ENOMEM ; + + 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; + saved_state->crc_enabled = crtc_state->crc_enabled; + +intel_crtc_free_hw_state (crtc_state); +memcpy (crtc_state, saved_state,sizeof (*crtc_state)); +kfree (saved_state); + +/* Re-init hw state */ +memset (&crtc_state->hw,0 ,sizeof (saved_state->hw)); + crtc_state->hw.enable = from_crtc_state->hw.enable; + crtc_state->hw.active = from_crtc_state->hw.active; + crtc_state->hw.pipe_mode = from_crtc_state->hw.pipe_mode; + crtc_state->hw.adjusted_mode = from_crtc_state->hw.adjusted_mode; + +/* Some fixups */ + crtc_state->uapi.mode_changed = from_crtc_state->uapi.mode_changed; + crtc_state->uapi.connectors_changed = from_crtc_state->uapi.connectors_changed; + crtc_state->uapi.active_changed = from_crtc_state->uapi.active_changed; + crtc_state->nv12_planes = crtc_state->c8_planes = crtc_state->update_planes =0 ; + crtc_state->bigjoiner_linked_crtc =to_intel_crtc (from_crtc_state->uapi.crtc); + crtc_state->bigjoiner_slave = true; + crtc_state->cpu_transcoder = (enum transcoder )crtc->pipe; + crtc_state->has_audio = false; + +return 0 ; +} + +static int +intel_crtc_prepare_cleared_state (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -13276,16 +13347,16 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state) crtc_state->uapi.mode.private_flags =0 ; crtc_state->uapi.adjusted_mode.private_flags =0 ; -intel_crtc_copy_uapi_to_hw_state (crtc_state); +intel_crtc_copy_uapi_to_hw_state (state, crtc_state);return 0 ; }static int -intel_modeset_pipe_config (struct intel_crtc_state *pipe_config) +intel_modeset_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *pipe_config) {struct drm_crtc *crtc = pipe_config->uapi.crtc; -struct drm_atomic_state *state = pipe_config->uapi.state;struct drm_i915_private *i915 =to_i915 (pipe_config->uapi.crtc->dev);struct drm_connector *connector;struct drm_connector_state *connector_state;@@ -13327,7 +13398,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) &pipe_config->pipe_src_w, &pipe_config->pipe_src_h); -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13365,7 +13436,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* adjust it according to limitations or connector properties, and also * a chance to reject the mode entirely. */ -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13422,8 +13493,6 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; -/* without bigjoiner, pipe_mode == adjusted_mode */ - pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -14820,6 +14889,75 @@ static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,return false; } +static int intel_atomic_check_bigjoiner (struct intel_atomic_state *state, +struct intel_crtc *crtc, +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); +struct intel_crtc_state *slave_crtc_state, *master_crtc_state; +struct intel_crtc *slave, *master; + +/* slave being enabled, is master is still claiming this crtc? */ +if (old_crtc_state->bigjoiner_slave) { + slave = crtc; + master = old_crtc_state->bigjoiner_linked_crtc; + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); +if (!master_crtc_state || !needs_modeset (master_crtc_state)) + goto claimed; + } + +if (!new_crtc_state->bigjoiner) +return 0 ; + +if (1 + crtc->pipe >=INTEL_NUM_PIPES (dev_priv)) { +DRM_DEBUG_KMS ("[CRTC:%d:%s] Big joiner configuration requires " +"CRTC + 1 to be used, doesn't exist\n" , + crtc->base.base.id, crtc->base.name); +return -EINVAL ; + } + + slave = new_crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe +1 ); + slave_crtc_state =intel_atomic_get_crtc_state (&state->base, slave); + master = crtc; +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + +/* master being enabled, slave was already configured? */ +if (slave_crtc_state->uapi.enable) + goto claimed; + +DRM_DEBUG_KMS ("[CRTC:%d:%s] Used as slave for big joiner\n" , + slave->base.base.id, slave->base.name); + +return copy_bigjoiner_crtc_state (slave_crtc_state, new_crtc_state); + +claimed: +DRM_DEBUG_KMS ("[CRTC:%d:%s] Slave is enabled as normal CRTC, but " +"[CRTC:%d:%s] claiming this CRTC for bigjoiner.\n" , + slave->base.base.id, slave->base.name, + master->base.base.id, master->base.name); +return -EINVAL ; +} + +static int kill_bigjoiner_slave (struct intel_atomic_state *state, +struct intel_crtc_state *master_crtc_state) +{ +struct intel_crtc_state *slave_crtc_state = +intel_atomic_get_crtc_state (&state->base, + master_crtc_state->bigjoiner_linked_crtc); + +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + + slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false; + slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false; + slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc =NULL ; +intel_crtc_copy_uapi_to_hw_state (state, slave_crtc_state); +return 0 ; +} +/** * intel_atomic_check - validate state object * @dev: drm device @@ -14849,19 +14987,36 @@ static int intel_atomic_check(struct drm_device *dev, new_crtc_state, i) {if (!needs_modeset (new_crtc_state)) {/* Light copy */ -intel_crtc_copy_uapi_to_hw_state_nomodeset (new_crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, new_crtc_state);continue ; } - ret =intel_crtc_prepare_cleared_state (new_crtc_state); +/* Kill old bigjoiner link, we may re-establish afterwards */ +if (old_crtc_state->bigjoiner && !old_crtc_state->bigjoiner_slave) { + ret =kill_bigjoiner_slave (state, new_crtc_state); +if (ret) + goto fail; + } + +if (!new_crtc_state->uapi.enable) { +if (!new_crtc_state->bigjoiner_slave) { +intel_crtc_copy_uapi_to_hw_state (state, new_crtc_state); + any_ms = true; + } +continue ; + } + + ret =intel_crtc_prepare_cleared_state (state, new_crtc_state);if (ret) goto fail; -if (!new_crtc_state->hw.enable) -continue ; + ret =intel_modeset_pipe_config (state, new_crtc_state); +if (ret) + goto fail; - ret =intel_modeset_pipe_config (new_crtc_state); + ret =intel_atomic_check_bigjoiner (state, crtc, old_crtc_state, + new_crtc_state);if (ret) goto fail; }@@ -15193,7 +15348,9 @@ static void intel_update_crtc(struct intel_atomic_state *state,commit_pipe_config (state, crtc); -if (INTEL_GEN (dev_priv) >=9 ) +if (new_crtc_state->bigjoiner) { +/* Not supported yet */ + }else if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc);drivers/gpu/drm/i915/display/intel_display_types.h +9
-0@@ -1053,6 +1053,15 @@ struct intel_crtc_state {/* enable pipe csc? */ bool csc_enable; +/* enable pipe big joiner? */ +bool bigjoiner; + +/* big joiner slave crtc? */ +bool bigjoiner_slave; + +/* linked crtc for bigjoiner, either slave or master */ +struct intel_crtc *bigjoiner_linked_crtc; +/* Display Stream compression state */ struct {bool compression_enable;drivers/gpu/drm/i915/display/intel_dp.c +0
-0@@ -2247,6 +2247,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock = intel_dp->common_rates[limits->max_clock];drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2257
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +9
-0pipe_config->lane_count = limits->max_lane_count; +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, false)) { +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, true)) { +DRM_DEBUG_KMS ("Clock rate too high for big joiner\n" ); +return -EINVAL ; + } + pipe_config->bigjoiner = true; +DRM_DEBUG_KMS ("Using bigjoiner configuration\n" ); + } +Adding a flag for big-joiner and setting it can be part of previous patch and instead of using true/false directly it can be used in dsc functions. Other changes looks fine to me.
Regards,
AnimeshQuoted 29 lines
drivers/gpu/drm/i915/display/intel_dp.c +5
-6if (intel_dp_is_edp (intel_dp)) { pipe_config->dsc.compressed_bpp = min_t(u16, drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4,@@ -2264,12 +2273,12 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->lane_count, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );@@ -2285,14 +2294,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,* is greater than the maximum Cdclock and if slice count is even * then we need to use 2 VDSC instances. */ -if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq) { -if (pipe_config->dsc.slice_count >1 ) { - pipe_config->dsc.dsc_split = true; - }else { +if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq || + pipe_config->bigjoiner) { +if (pipe_config->dsc.slice_count <2 ) {
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2308
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c +2
-0drm_dbg_kms (&dev_priv->drm,"Cannot split stream to use 2 VDSC instances\n" );return -EINVAL ; } + + pipe_config->dsc.dsc_split = true; } ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 05/11] drm/i915: Try to make bigjoiner work in atomic check
In reply to Manasi NavareQuoted 99 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc.
This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's
crtc_state, so it doesn't depend at commit time on the othercrtc_state.v3:
* Manual Rebase (Manasi)
Changes since v1:
- Rename pipe timings to transcoder timings, as they are now different. Changes since v2:
- Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more.
- Usepipe_modeinstead oftranscoder_mode, to clean up the code.Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 201 ++++++++++++++++-- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 211 insertions(+), 33 deletions(-)drivers/gpu/drm/i915/display/intel_atomic.c +5
-4@@ -270,14 +270,15 @@ 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) +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) {drm_property_replace_blob (&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut);drm_property_replace_blob (&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut);drm_property_replace_blob (&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); }/** drivers/gpu/drm/i915/display/intel_atomic.h +2
-1@@ -43,7 +43,8 @@ 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); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_free (struct drm_atomic_state *state);void intel_atomic_state_clear (struct drm_atomic_state *state);drivers/gpu/drm/i915/display/intel_display.c +16
-1@@ -8016,9 +8016,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; +struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq; + *pipe_mode = pipe_config->hw.adjusted_mode; + +/* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ +if (pipe_config->bigjoiner) { + pipe_mode->crtc_clock /=2 ; + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_config->pipe_src_w /=2 ; + } +if (INTEL_GEN (dev_priv) <4 ) { clock_limit = dev_priv->max_cdclk_freq *9 /10 ;
drivers/gpu/drm/i915/display/intel_display.c static int intel_crtc_compute_config(struct intel_crtc *crtc, · line 8097
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -8079,7 +8094,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay) + pipe_config->hw.adjusted_mode.crtc_hsync_start == pipe_mode->crtc_hdisplay)
What's the deal here? I think I asked this same question ages ago already...
Quoted 252 lines
drivers/gpu/drm/i915/display/intel_display.c +140
-16return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -12433,7 +12448,7 @@ static bool encoders_cloneable(const struct intel_encoder *a, b->cloneable & (1 << a->type)); } -static bool check_single_encoder_cloning (struct drm_atomic_state *state, +static bool check_single_encoder_cloning (struct intel_atomic_state *state,struct intel_crtc *crtc,struct intel_encoder *encoder) {@@ -12442,7 +12457,7 @@ static bool check_single_encoder_cloning(struct drm_atomic_state *state,struct drm_connector_state *connector_state;int i; -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {if (connector_state->crtc != &crtc->base)continue ;@@ -12682,6 +12697,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,if (mode_changed && crtc_state->hw.enable && dev_priv->display.crtc_compute_clock && + !crtc_state->bigjoiner_slave && !drm_WARN_ON (&dev_priv->drm, crtc_state->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock (crtc, crtc_state);if (ret)@@ -13206,18 +13222,31 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state) }static void -intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) { -intel_crtc_copy_color_blobs (crtc_state); +const struct intel_crtc_state *from_crtc_state = crtc_state; + +if (crtc_state->bigjoiner_slave) { + from_crtc_state =intel_atomic_get_new_crtc_state (state, + crtc_state->bigjoiner_linked_crtc); + +/* No need to copy state if the master state is unchanged */ +if (!from_crtc_state) +return ; + } + +intel_crtc_copy_color_blobs (crtc_state, from_crtc_state); }static void -intel_crtc_copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state (struct intel_atomic_state *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.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; -intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, crtc_state); } static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,@@ -13240,7 +13269,49 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state }static int -intel_crtc_prepare_cleared_state (struct intel_crtc_state *crtc_state) +copy_bigjoiner_crtc_state (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) +{ +struct intel_crtc_state *saved_state; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); + + saved_state =kmemdup (from_crtc_state,sizeof (*saved_state),GFP_KERNEL ); +if (!saved_state) +return -ENOMEM ; + + 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; + saved_state->crc_enabled = crtc_state->crc_enabled; + +intel_crtc_free_hw_state (crtc_state); +memcpy (crtc_state, saved_state,sizeof (*crtc_state)); +kfree (saved_state); + +/* Re-init hw state */ +memset (&crtc_state->hw,0 ,sizeof (saved_state->hw)); + crtc_state->hw.enable = from_crtc_state->hw.enable; + crtc_state->hw.active = from_crtc_state->hw.active; + crtc_state->hw.pipe_mode = from_crtc_state->hw.pipe_mode; + crtc_state->hw.adjusted_mode = from_crtc_state->hw.adjusted_mode; + +/* Some fixups */ + crtc_state->uapi.mode_changed = from_crtc_state->uapi.mode_changed; + crtc_state->uapi.connectors_changed = from_crtc_state->uapi.connectors_changed; + crtc_state->uapi.active_changed = from_crtc_state->uapi.active_changed; + crtc_state->nv12_planes = crtc_state->c8_planes = crtc_state->update_planes =0 ; + crtc_state->bigjoiner_linked_crtc =to_intel_crtc (from_crtc_state->uapi.crtc); + crtc_state->bigjoiner_slave = true; + crtc_state->cpu_transcoder = (enum transcoder )crtc->pipe; + crtc_state->has_audio = false; + +return 0 ; +} + +static int +intel_crtc_prepare_cleared_state (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -13276,16 +13347,16 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state) crtc_state->uapi.mode.private_flags =0 ; crtc_state->uapi.adjusted_mode.private_flags =0 ; -intel_crtc_copy_uapi_to_hw_state (crtc_state); +intel_crtc_copy_uapi_to_hw_state (state, crtc_state);return 0 ; }static int -intel_modeset_pipe_config (struct intel_crtc_state *pipe_config) +intel_modeset_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *pipe_config) {struct drm_crtc *crtc = pipe_config->uapi.crtc; -struct drm_atomic_state *state = pipe_config->uapi.state;struct drm_i915_private *i915 =to_i915 (pipe_config->uapi.crtc->dev);struct drm_connector *connector;struct drm_connector_state *connector_state;@@ -13327,7 +13398,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) &pipe_config->pipe_src_w, &pipe_config->pipe_src_h); -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13365,7 +13436,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* adjust it according to limitations or connector properties, and also * a chance to reject the mode entirely. */ -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13422,8 +13493,6 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; -/* without bigjoiner, pipe_mode == adjusted_mode */ - pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -14820,6 +14889,75 @@ static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,return false; } +static int intel_atomic_check_bigjoiner (struct intel_atomic_state *state, +struct intel_crtc *crtc, +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); +struct intel_crtc_state *slave_crtc_state, *master_crtc_state; +struct intel_crtc *slave, *master; + +/* slave being enabled, is master is still claiming this crtc? */ +if (old_crtc_state->bigjoiner_slave) { + slave = crtc; + master = old_crtc_state->bigjoiner_linked_crtc; + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); +if (!master_crtc_state || !needs_modeset (master_crtc_state)) + goto claimed; + } + +if (!new_crtc_state->bigjoiner) +return 0 ; + +if (1 + crtc->pipe >=INTEL_NUM_PIPES (dev_priv)) { +DRM_DEBUG_KMS ("[CRTC:%d:%s] Big joiner configuration requires " +"CRTC + 1 to be used, doesn't exist\n" , + crtc->base.base.id, crtc->base.name); +return -EINVAL ; + } + + slave = new_crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe +1 ); + slave_crtc_state =intel_atomic_get_crtc_state (&state->base, slave); + master = crtc; +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + +/* master being enabled, slave was already configured? */ +if (slave_crtc_state->uapi.enable) + goto claimed; + +DRM_DEBUG_KMS ("[CRTC:%d:%s] Used as slave for big joiner\n" , + slave->base.base.id, slave->base.name); + +return copy_bigjoiner_crtc_state (slave_crtc_state, new_crtc_state); + +claimed: +DRM_DEBUG_KMS ("[CRTC:%d:%s] Slave is enabled as normal CRTC, but " +"[CRTC:%d:%s] claiming this CRTC for bigjoiner.\n" , + slave->base.base.id, slave->base.name, + master->base.base.id, master->base.name); +return -EINVAL ; +} + +static int kill_bigjoiner_slave (struct intel_atomic_state *state, +struct intel_crtc_state *master_crtc_state) +{ +struct intel_crtc_state *slave_crtc_state = +intel_atomic_get_crtc_state (&state->base, + master_crtc_state->bigjoiner_linked_crtc); + +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + + slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false; + slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false; + slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc =NULL ; +intel_crtc_copy_uapi_to_hw_state (state, slave_crtc_state); +return 0 ; +} +/** * intel_atomic_check - validate state object * @dev: drm device @@ -14849,19 +14987,36 @@ static int intel_atomic_check(struct drm_device *dev, new_crtc_state, i) {if (!needs_modeset (new_crtc_state)) {/* Light copy */ -intel_crtc_copy_uapi_to_hw_state_nomodeset (new_crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, new_crtc_state);continue ; } - ret =intel_crtc_prepare_cleared_state (new_crtc_state); +/* Kill old bigjoiner link, we may re-establish afterwards */ +if (old_crtc_state->bigjoiner && !old_crtc_state->bigjoiner_slave) {
drivers/gpu/drm/i915/display/intel_display.c static int intel_atomic_check(struct drm_device *dev, · line 15006
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +10
-0+ ret =kill_bigjoiner_slave (state, new_crtc_state); +if (ret) + goto fail; + } + +if (!new_crtc_state->uapi.enable) { +if (!new_crtc_state->bigjoiner_slave) { +intel_crtc_copy_uapi_to_hw_state (state, new_crtc_state); + any_ms = true; + }
I'm confused. Where do we add the other pipe to the state if there are no modesets involved?
Quoted 112 lines
drivers/gpu/drm/i915/display/intel_display.c +12
-4+continue ; + } + + ret =intel_crtc_prepare_cleared_state (state, new_crtc_state);if (ret) goto fail; -if (!new_crtc_state->hw.enable) -continue ; + ret =intel_modeset_pipe_config (state, new_crtc_state); +if (ret) + goto fail; - ret =intel_modeset_pipe_config (new_crtc_state); + ret =intel_atomic_check_bigjoiner (state, crtc, old_crtc_state, + new_crtc_state);if (ret) goto fail; }@@ -15193,7 +15348,9 @@ static void intel_update_crtc(struct intel_atomic_state *state,commit_pipe_config (state, crtc); -if (INTEL_GEN (dev_priv) >=9 ) +if (new_crtc_state->bigjoiner) { +/* Not supported yet */ + }else if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc);drivers/gpu/drm/i915/display/intel_display_types.h +9
-0@@ -1053,6 +1053,15 @@ struct intel_crtc_state {/* enable pipe csc? */ bool csc_enable; +/* enable pipe big joiner? */ +bool bigjoiner; + +/* big joiner slave crtc? */ +bool bigjoiner_slave; + +/* linked crtc for bigjoiner, either slave or master */ +struct intel_crtc *bigjoiner_linked_crtc; +/* Display Stream compression state */ struct {bool compression_enable;drivers/gpu/drm/i915/display/intel_dp.c +16
-6@@ -2247,6 +2247,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock = intel_dp->common_rates[limits->max_clock]; pipe_config->lane_count = limits->max_lane_count; +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, false)) { +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, true)) { +DRM_DEBUG_KMS ("Clock rate too high for big joiner\n" ); +return -EINVAL ; + } + pipe_config->bigjoiner = true; +DRM_DEBUG_KMS ("Using bigjoiner configuration\n" ); + } +if (intel_dp_is_edp (intel_dp)) { pipe_config->dsc.compressed_bpp = min_t(u16, drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4,@@ -2264,12 +2273,12 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->lane_count, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );@@ -2285,14 +2294,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,* is greater than the maximum Cdclock and if slice count is even * then we need to use 2 VDSC instances. */ -if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq) { -if (pipe_config->dsc.slice_count >1 ) { - pipe_config->dsc.dsc_split = true; - }else { +if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq || + pipe_config->bigjoiner) { +if (pipe_config->dsc.slice_count <2 ) {drm_dbg_kms (&dev_priv->drm,"Cannot split stream to use 2 VDSC instances\n" );return -EINVAL ; } + + pipe_config->dsc.dsc_split = true; } ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);Signature · 6 lines
2.19.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
Re: [Intel-gfx] [PATCH v6 05/11] drm/i915: Try to make bigjoiner work in atomic check
Quoted 99 lines · Ville Syrjälä
Quoted 98 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
When the clock is higher than the dotclock, try with 2 pipes enabled. If we can enable 2, then we will go into big joiner mode, and steal the adjacent crtc.
This only links the crtc's in software, no hardware or plane programming is done yet. Blobs are also copied from the master's
crtc_state, so it doesn't depend at commit time on the othercrtc_state.v3:
* Manual Rebase (Manasi)
Changes since v1:
- Rename pipe timings to transcoder timings, as they are now different. Changes since v2:
- Rework bigjoiner checks; always disable slave when recalculating master. No need to have a separate bigjoiner pass any more.
- Usepipe_modeinstead oftranscoder_mode, to clean up the code.Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/intel_atomic.c | 9 +- drivers/gpu/drm/i915/display/intel_atomic.h | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 201 ++++++++++++++++-- .../drm/i915/display/intel_display_types.h | 9 + drivers/gpu/drm/i915/display/intel_dp.c | 22 +- 5 files changed, 211 insertions(+), 33 deletions(-)drivers/gpu/drm/i915/display/intel_atomic.c +5
-4@@ -270,14 +270,15 @@ 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) +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) {drm_property_replace_blob (&crtc_state->hw.degamma_lut, - crtc_state->uapi.degamma_lut); + from_crtc_state->uapi.degamma_lut);drm_property_replace_blob (&crtc_state->hw.gamma_lut, - crtc_state->uapi.gamma_lut); + from_crtc_state->uapi.gamma_lut);drm_property_replace_blob (&crtc_state->hw.ctm, - crtc_state->uapi.ctm); + from_crtc_state->uapi.ctm); }/** drivers/gpu/drm/i915/display/intel_atomic.h +2
-1@@ -43,7 +43,8 @@ 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); +void intel_crtc_copy_color_blobs (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_free (struct drm_atomic_state *state);void intel_atomic_state_clear (struct drm_atomic_state *state);drivers/gpu/drm/i915/display/intel_display.c +16
-1@@ -8016,9 +8016,24 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -const struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode; +struct drm_display_mode *pipe_mode = &pipe_config->hw.pipe_mode;int clock_limit = dev_priv->max_dotclk_freq; + *pipe_mode = pipe_config->hw.adjusted_mode; + +/* Adjust pipe_mode for bigjoiner, with half the horizontal mode */ +if (pipe_config->bigjoiner) { + pipe_mode->crtc_clock /=2 ; + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_config->pipe_src_w /=2 ; + } +if (INTEL_GEN (dev_priv) <4 ) { clock_limit = dev_priv->max_cdclk_freq *9 /10 ;
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_display.c static int intel_crtc_compute_config(struct intel_crtc *crtc, · line 8097
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -8079,7 +8094,7 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. */ if ((INTEL_GEN (dev_priv) >4 ||IS_G4X (dev_priv)) && - pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay) + pipe_config->hw.adjusted_mode.crtc_hsync_start == pipe_mode->crtc_hdisplay)What's the deal here? I think I asked this same question ages ago already...
Yea I have no idea why we compare pipe_config->hw.adjusted_mode.crtc_hsync_start with pipe_mode->crtc_hdisplay?
It should just be a check of pipe_mode->crtc_hsync_start == pipe_mode->crtc_hdisplay so no change needed
Ville, do you agree?
Quoted 250 lines
Quoted 250 lines
drivers/gpu/drm/i915/display/intel_display.c +138
-15return -EINVAL ;intel_crtc_compute_pixel_rate (pipe_config);@@ -12433,7 +12448,7 @@ static bool encoders_cloneable(const struct intel_encoder *a, b->cloneable & (1 << a->type)); } -static bool check_single_encoder_cloning (struct drm_atomic_state *state, +static bool check_single_encoder_cloning (struct intel_atomic_state *state,struct intel_crtc *crtc,struct intel_encoder *encoder) {@@ -12442,7 +12457,7 @@ static bool check_single_encoder_cloning(struct drm_atomic_state *state,struct drm_connector_state *connector_state;int i; -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {if (connector_state->crtc != &crtc->base)continue ;@@ -12682,6 +12697,7 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,if (mode_changed && crtc_state->hw.enable && dev_priv->display.crtc_compute_clock && + !crtc_state->bigjoiner_slave && !drm_WARN_ON (&dev_priv->drm, crtc_state->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock (crtc, crtc_state);if (ret)@@ -13206,18 +13222,31 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state) }static void -intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state_nomodeset (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) { -intel_crtc_copy_color_blobs (crtc_state); +const struct intel_crtc_state *from_crtc_state = crtc_state; + +if (crtc_state->bigjoiner_slave) { + from_crtc_state =intel_atomic_get_new_crtc_state (state, + crtc_state->bigjoiner_linked_crtc); + +/* No need to copy state if the master state is unchanged */ +if (!from_crtc_state) +return ; + } + +intel_crtc_copy_color_blobs (crtc_state, from_crtc_state); }static void -intel_crtc_copy_uapi_to_hw_state (struct intel_crtc_state *crtc_state) +intel_crtc_copy_uapi_to_hw_state (struct intel_atomic_state *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.pipe_mode = crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode; -intel_crtc_copy_uapi_to_hw_state_nomodeset (crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, crtc_state); } static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,@@ -13240,7 +13269,49 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state }static int -intel_crtc_prepare_cleared_state (struct intel_crtc_state *crtc_state) +copy_bigjoiner_crtc_state (struct intel_crtc_state *crtc_state, +const struct intel_crtc_state *from_crtc_state) +{ +struct intel_crtc_state *saved_state; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); + + saved_state =kmemdup (from_crtc_state,sizeof (*saved_state),GFP_KERNEL ); +if (!saved_state) +return -ENOMEM ; + + 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; + saved_state->crc_enabled = crtc_state->crc_enabled; + +intel_crtc_free_hw_state (crtc_state); +memcpy (crtc_state, saved_state,sizeof (*crtc_state)); +kfree (saved_state); + +/* Re-init hw state */ +memset (&crtc_state->hw,0 ,sizeof (saved_state->hw)); + crtc_state->hw.enable = from_crtc_state->hw.enable; + crtc_state->hw.active = from_crtc_state->hw.active; + crtc_state->hw.pipe_mode = from_crtc_state->hw.pipe_mode; + crtc_state->hw.adjusted_mode = from_crtc_state->hw.adjusted_mode; + +/* Some fixups */ + crtc_state->uapi.mode_changed = from_crtc_state->uapi.mode_changed; + crtc_state->uapi.connectors_changed = from_crtc_state->uapi.connectors_changed; + crtc_state->uapi.active_changed = from_crtc_state->uapi.active_changed; + crtc_state->nv12_planes = crtc_state->c8_planes = crtc_state->update_planes =0 ; + crtc_state->bigjoiner_linked_crtc =to_intel_crtc (from_crtc_state->uapi.crtc); + crtc_state->bigjoiner_slave = true; + crtc_state->cpu_transcoder = (enum transcoder )crtc->pipe; + crtc_state->has_audio = false; + +return 0 ; +} + +static int +intel_crtc_prepare_cleared_state (struct intel_atomic_state *state, +struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);@@ -13276,16 +13347,16 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state) crtc_state->uapi.mode.private_flags =0 ; crtc_state->uapi.adjusted_mode.private_flags =0 ; -intel_crtc_copy_uapi_to_hw_state (crtc_state); +intel_crtc_copy_uapi_to_hw_state (state, crtc_state);return 0 ; }static int -intel_modeset_pipe_config (struct intel_crtc_state *pipe_config) +intel_modeset_pipe_config (struct intel_atomic_state *state, +struct intel_crtc_state *pipe_config) {struct drm_crtc *crtc = pipe_config->uapi.crtc; -struct drm_atomic_state *state = pipe_config->uapi.state;struct drm_i915_private *i915 =to_i915 (pipe_config->uapi.crtc->dev);struct drm_connector *connector;struct drm_connector_state *connector_state;@@ -13327,7 +13398,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config) &pipe_config->pipe_src_w, &pipe_config->pipe_src_h); -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13365,7 +13436,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* adjust it according to limitations or connector properties, and also * a chance to reject the mode entirely. */ -for_each_new_connector_in_state (state, connector, connector_state, i) { +for_each_new_connector_in_state (&state->base, connector, connector_state, i) {struct intel_encoder *encoder =to_intel_encoder (connector_state->best_encoder);@@ -13422,8 +13493,6 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)* drm_atomic_helper_update_legacy_modeset_state() happy */ pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode; -/* without bigjoiner, pipe_mode == adjusted_mode */ - pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;return 0 ; }@@ -14820,6 +14889,75 @@ static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,return false; } +static int intel_atomic_check_bigjoiner (struct intel_atomic_state *state, +struct intel_crtc *crtc, +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); +struct intel_crtc_state *slave_crtc_state, *master_crtc_state; +struct intel_crtc *slave, *master; + +/* slave being enabled, is master is still claiming this crtc? */ +if (old_crtc_state->bigjoiner_slave) { + slave = crtc; + master = old_crtc_state->bigjoiner_linked_crtc; + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); +if (!master_crtc_state || !needs_modeset (master_crtc_state)) + goto claimed; + } + +if (!new_crtc_state->bigjoiner) +return 0 ; + +if (1 + crtc->pipe >=INTEL_NUM_PIPES (dev_priv)) { +DRM_DEBUG_KMS ("[CRTC:%d:%s] Big joiner configuration requires " +"CRTC + 1 to be used, doesn't exist\n" , + crtc->base.base.id, crtc->base.name); +return -EINVAL ; + } + + slave = new_crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe +1 ); + slave_crtc_state =intel_atomic_get_crtc_state (&state->base, slave); + master = crtc; +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + +/* master being enabled, slave was already configured? */ +if (slave_crtc_state->uapi.enable) + goto claimed; + +DRM_DEBUG_KMS ("[CRTC:%d:%s] Used as slave for big joiner\n" , + slave->base.base.id, slave->base.name); + +return copy_bigjoiner_crtc_state (slave_crtc_state, new_crtc_state); + +claimed: +DRM_DEBUG_KMS ("[CRTC:%d:%s] Slave is enabled as normal CRTC, but " +"[CRTC:%d:%s] claiming this CRTC for bigjoiner.\n" , + slave->base.base.id, slave->base.name, + master->base.base.id, master->base.name); +return -EINVAL ; +} + +static int kill_bigjoiner_slave (struct intel_atomic_state *state, +struct intel_crtc_state *master_crtc_state) +{ +struct intel_crtc_state *slave_crtc_state = +intel_atomic_get_crtc_state (&state->base, + master_crtc_state->bigjoiner_linked_crtc); + +if (IS_ERR (slave_crtc_state)) +return PTR_ERR (slave_crtc_state); + + slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false; + slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false; + slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc =NULL ; +intel_crtc_copy_uapi_to_hw_state (state, slave_crtc_state); +return 0 ; +} +/** * intel_atomic_check - validate state object * @dev: drm device @@ -14849,19 +14987,36 @@ static int intel_atomic_check(struct drm_device *dev, new_crtc_state, i) {if (!needs_modeset (new_crtc_state)) {/* Light copy */ -intel_crtc_copy_uapi_to_hw_state_nomodeset (new_crtc_state); +intel_crtc_copy_uapi_to_hw_state_nomodeset (state, new_crtc_state);continue ; }
Quoted 17 lines
drivers/gpu/drm/i915/display/intel_display.c static int intel_atomic_check(struct drm_device *dev, · line 15006
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_display.c +12
-1- ret =intel_crtc_prepare_cleared_state (new_crtc_state); +/* Kill old bigjoiner link, we may re-establish afterwards */ +if (old_crtc_state->bigjoiner && !old_crtc_state->bigjoiner_slave) { + ret =kill_bigjoiner_slave (state, new_crtc_state); +if (ret) + goto fail; + } + +if (!new_crtc_state->uapi.enable) { +if (!new_crtc_state->bigjoiner_slave) { +intel_crtc_copy_uapi_to_hw_state (state, new_crtc_state); + any_ms = true; + }I'm confused. Where do we add the other pipe to the state if there are no modesets involved?
We get crtc state for pipe + 1 (stolen pipe) in intel_atomic_check_bigjoiner In the testing now I see that we correctly steal the pipe and do modeset on that
Whats your concern here, could ypu elaborate?
Manasi
Quoted 104 lines
Quoted 104 lines
drivers/gpu/drm/i915/display/intel_display.c +12
-4+continue ; + } + + ret =intel_crtc_prepare_cleared_state (state, new_crtc_state);if (ret) goto fail; -if (!new_crtc_state->hw.enable) -continue ; + ret =intel_modeset_pipe_config (state, new_crtc_state); +if (ret) + goto fail; - ret =intel_modeset_pipe_config (new_crtc_state); + ret =intel_atomic_check_bigjoiner (state, crtc, old_crtc_state, + new_crtc_state);if (ret) goto fail; }@@ -15193,7 +15348,9 @@ static void intel_update_crtc(struct intel_atomic_state *state,commit_pipe_config (state, crtc); -if (INTEL_GEN (dev_priv) >=9 ) +if (new_crtc_state->bigjoiner) { +/* Not supported yet */ + }else if (INTEL_GEN (dev_priv) >=9 )skl_update_planes_on_crtc (state, crtc);else i9xx_update_planes_on_crtc (state, crtc);drivers/gpu/drm/i915/display/intel_display_types.h +9
-0@@ -1053,6 +1053,15 @@ struct intel_crtc_state {/* enable pipe csc? */ bool csc_enable; +/* enable pipe big joiner? */ +bool bigjoiner; + +/* big joiner slave crtc? */ +bool bigjoiner_slave; + +/* linked crtc for bigjoiner, either slave or master */ +struct intel_crtc *bigjoiner_linked_crtc; +/* Display Stream compression state */ struct {bool compression_enable;drivers/gpu/drm/i915/display/intel_dp.c +16
-6@@ -2247,6 +2247,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->port_clock = intel_dp->common_rates[limits->max_clock]; pipe_config->lane_count = limits->max_lane_count; +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, false)) { +if (adjusted_mode->crtc_clock >intel_dp_max_dotclock (intel_dp, true)) { +DRM_DEBUG_KMS ("Clock rate too high for big joiner\n" ); +return -EINVAL ; + } + pipe_config->bigjoiner = true; +DRM_DEBUG_KMS ("Using bigjoiner configuration\n" ); + } +if (intel_dp_is_edp (intel_dp)) { pipe_config->dsc.compressed_bpp = min_t(u16, drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4,@@ -2264,12 +2273,12 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, pipe_config->lane_count, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner); dsc_dp_slice_count =intel_dp_dsc_get_slice_count (intel_dp, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, - false); + pipe_config->bigjoiner);if (!dsc_max_output_bpp || !dsc_dp_slice_count) {drm_dbg_kms (&dev_priv->drm,"Compressed BPP/Slice Count not supported\n" );@@ -2285,14 +2294,15 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,* is greater than the maximum Cdclock and if slice count is even * then we need to use 2 VDSC instances. */ -if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq) { -if (pipe_config->dsc.slice_count >1 ) { - pipe_config->dsc.dsc_split = true; - }else { +if (adjusted_mode->crtc_clock > dev_priv->max_cdclk_freq || + pipe_config->bigjoiner) { +if (pipe_config->dsc.slice_count <2 ) {drm_dbg_kms (&dev_priv->drm,"Cannot split stream to use 2 VDSC instances\n" );return -EINVAL ; } + + pipe_config->dsc.dsc_split = true; }
Quoted 12 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c +0
-0ret =intel_dp_dsc_compute_params (&dig_port->base, pipe_config);Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v6 6/11 drm/i915: Enable big joiner support in enable and disable sequences.
In reply to Manasi NavareFrom: Maarten Lankhorst <[email protected]>
Make vdsc work when no output is enabled. The big joiner needs VDSC on the slave, so enable it and set the appropriate bits. Also update timestamping constants, because slave crtc's are not updated in drm_atomic_helper_update_legacy_modeset_state().
This should be enough to bring up CRTC's in a big joiner configuration, without any plane configuration on the second pipe yet.
HOWEVER, we still bring up the crtc's in the wrong order. We need to make sure that the master crtc is brought up after the slave crtc. This is done correctly later in this series.
The next steps are to enable planes correctly, and make sure we enable and update both master and slave in the correct order.
v2:
* Manual rebase (Manasi)
v3:
* Rebase (Manasi)
v4:
* Rebase (Manasi)
--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_ddi.c | 68 +++- drivers/gpu/drm/i915/display/intel_display.c | 377 ++++++++++++------ .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 6 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 199 ++++----- drivers/gpu/drm/i915/display/intel_vdsc.h | 7 +- 7 files changed, 414 insertions(+), 246 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +0 -2
@@ -1454,8 +1454,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -intel_dsc_get_config (encoder, pipe_config); -/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =intel_dpll_get_freq (i915, pipe_config->shared_dpll);
drivers/gpu/drm/i915/display/intel_ddi.c +51 -17
130 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display.c +255 -122
557 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
@@ -826,6 +826,7 @@ struct intel_crtc_state {* accordingly. */ #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1)/* bigjoiner slave, partial readout */ unsigned long quirks;unsigned fb_bits;/* framebuffers to flip */
drivers/gpu/drm/i915/display/intel_dp.c +2 -4
@@ -2004,12 +2004,10 @@ static bool intel_dp_supports_fec(struct intel_dp *intel_dp,static bool intel_dp_supports_dsc (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) { -struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; - -if (!intel_dp_is_edp (intel_dp) && !crtc_state->fec_enable) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP ) && !crtc_state->fec_enable)return false; -return intel_dsc_source_support (encoder, crtc_state) && +return intel_dsc_source_support (crtc_state) &&drm_dp_sink_supports_dsc (intel_dp->dsc_dpcd); }
drivers/gpu/drm/i915/display/intel_vdsc.c +102 -97
262 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_vdsc.h +3 -4
@@ -11,15 +11,14 @@struct intel_encoder ;struct intel_crtc_state ; -bool intel_dsc_source_support (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state); +bool intel_dsc_source_support (const struct intel_crtc_state *crtc_state);void intel_dsc_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state);void intel_dsc_disable (const struct intel_crtc_state *crtc_state);int intel_dsc_compute_params (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); -void intel_dsc_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *crtc_state); +void intel_dsc_get_config (struct intel_crtc_state *crtc_state); +enum intel_display_power_domain intel_dsc_power_domain (const struct intel_crtc_state *crtc_state);
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 06/11] drm/i915: Enable big joiner support in enable and disable sequences.
Quoted 941 lines · Manasi Navare
From: Maarten Lankhorst <[email protected]>
Make vdsc work when no output is enabled. The big joiner needs VDSC on the slave, so enable it and set the appropriate bits. Also update timestamping constants, because slave crtc's are not updated in
drm_atomic_helper_update_legacy_modeset_state().This should be enough to bring up CRTC's in a big joiner configuration, without any plane configuration on the second pipe yet.
HOWEVER, we still bring up the crtc's in the wrong order. We need to make sure that the master crtc is brought up after the slave crtc. This is done correctly later in this series.
The next steps are to enable planes correctly, and make sure we enable and update both master and slave in the correct order.
v2:
* Manual rebase (Manasi)v3:
* Rebase (Manasi)v4:
* Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_ddi.c | 68 +++- drivers/gpu/drm/i915/display/intel_display.c | 377 ++++++++++++------ .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 6 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 199 ++++----- drivers/gpu/drm/i915/display/intel_vdsc.h | 7 +- 7 files changed, 414 insertions(+), 246 deletions(-)drivers/gpu/drm/i915/display/icl_dsi.c +0
-2@@ -1454,8 +1454,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -intel_dsc_get_config (encoder, pipe_config); -/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =intel_dpll_get_freq (i915, pipe_config->shared_dpll);drivers/gpu/drm/i915/display/intel_ddi.c +51
-17@@ -28,6 +28,7 @@#include <drm/drm_scdc_helper.h> #include "i915_drv.h" +#include "i915_trace.h" #include "intel_audio.h" #include "intel_combo_phy.h" #include "intel_connector.h" @@ -2040,12 +2041,6 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,intel_display_power_get (dev_priv,intel_ddi_main_link_aux_domain (dig_port)); -/* -* VDSC power is needed when DSC is enabled -*/ -if (crtc_state->dsc.compression_enable) -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state)); } void intel_ddi_enable_pipe_clock(struct intel_encoder *encoder,@@ -3313,7 +3308,8 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,/* 7.l Configure and enable FEC if needed */ intel_ddi_enable_fec (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3384,7 +3380,8 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,if (!is_mst)intel_ddi_enable_pipe_clock (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3639,6 +3636,21 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state,ilk_pfit_disable (old_crtc_state); } +if (old_crtc_state->bigjoiner_linked_crtc) { +struct intel_atomic_state *state = +to_intel_atomic_state (old_crtc_state->uapi.state); +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; +const struct intel_crtc_state *old_slave_crtc_state = +intel_atomic_get_old_crtc_state (state, slave); + +intel_crtc_vblank_off (old_slave_crtc_state); +trace_intel_pipe_disable (slave); + +intel_dsc_disable (old_slave_crtc_state); +skl_scaler_disable (old_slave_crtc_state); + } +/* * When called from DP MST code: * - old_conn_state will be NULL @@ -3853,7 +3865,8 @@ static void intel_enable_ddi(struct intel_atomic_state *state, {drm_WARN_ON (state->base.dev, crtc_state->has_pch_encoder); -intel_ddi_enable_transcoder_func (encoder, crtc_state); +if (!crtc_state->bigjoiner_slave) +intel_ddi_enable_transcoder_func (encoder, crtc_state);intel_enable_pipe (crtc_state);@@ -4200,8 +4213,8 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) crtc_state->sync_mode_slaves_mask); } -void intel_ddi_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +static void intel_ddi_read_func_ctl (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->uapi.crtc);@@ -4209,13 +4222,10 @@ void intel_ddi_get_config(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (encoder);u32 temp, flags =0 ; -/* XXX: DSI transcoder paranoia */ -if (drm_WARN_ON (&dev_priv->drm,transcoder_is_dsi (cpu_transcoder))) + temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(temp &TRANS_DDI_FUNC_ENABLE ))return ; -intel_dsc_get_config (encoder, pipe_config); - - temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder));if (temp &TRANS_DDI_PHSYNC ) flags |=DRM_MODE_FLAG_PHSYNC ;else @@ -4323,6 +4333,29 @@ void intel_ddi_get_config(struct intel_encoder *encoder, intel_dp->regs.dp_tp_ctl =TGL_DP_TP_CTL (transcoder); intel_dp->regs.dp_tp_status =TGL_DP_TP_STATUS (transcoder); } +} + +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); +enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; + +/* XXX: DSI transcoder paranoia */ +if (WARN_ON (transcoder_is_dsi (cpu_transcoder))) +return ; + +intel_ddi_read_func_ctl (encoder, pipe_config); +if (pipe_config->bigjoiner_slave) { +/* read out pipe settings from master */ +enum transcoder save = pipe_config->cpu_transcoder; + +/* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */ +WARN_ON (pipe_config->output_types); + pipe_config->cpu_transcoder = (enum transcoder )pipe_config->bigjoiner_linked_crtc->pipe; +intel_ddi_read_func_ctl (encoder, pipe_config); + pipe_config->cpu_transcoder = save; + } pipe_config->has_audio =intel_ddi_is_audio_enabled (dev_priv, cpu_transcoder);@@ -4348,7 +4381,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp; } -intel_ddi_clock_get (encoder, pipe_config); +if (!pipe_config->bigjoiner_slave) +intel_ddi_clock_get (encoder, pipe_config);if (IS_GEN9_LP (dev_priv)) pipe_config->lane_lat_optim_mask =drivers/gpu/drm/i915/display/intel_display.c +255
-122@@ -7023,6 +7023,45 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state)intel_de_write (dev_priv, reg, val); } +static void tgl_ddi_bigjoiner_pre_enable (struct intel_atomic_state *state, +const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *master =to_intel_crtc (crtc_state->uapi.crtc); +struct intel_crtc_state *master_crtc_state; +struct drm_connector_state *conn_state; +struct drm_connector *conn; +struct intel_encoder *encoder =NULL ; +int i; + +if (crtc_state->bigjoiner_slave) + master = crtc_state->bigjoiner_linked_crtc; + + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); + +for_each_new_connector_in_state (&state->base, conn, conn_state, i) { +if (conn_state->crtc != &master->base) +continue ; + + encoder =to_intel_encoder (conn_state->best_encoder); +break ; + } + +if (!crtc_state->bigjoiner_slave) { +/* need to enable VDSC, which we skipped in pre-enable */ +intel_dsc_enable (encoder, crtc_state); + }else { +/* +* Enable sequence steps 1-7 on bigjoiner master +*/ +intel_encoders_pre_pll_enable (state, master); +intel_enable_shared_dpll (master_crtc_state); +intel_encoders_pre_enable (state, master); + +/* and DSC on slave */ +intel_dsc_enable (NULL , crtc_state); + } +} +static void hsw_crtc_enable (struct intel_atomic_state *state,struct intel_crtc *crtc) {@@ -7036,34 +7075,39 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (drm_WARN_ON (&dev_priv->drm, crtc->active))return ; -intel_encoders_pre_pll_enable (state, crtc); - -if (new_crtc_state->shared_dpll) -intel_enable_shared_dpll (new_crtc_state); +if (!new_crtc_state->bigjoiner) { +intel_encoders_pre_pll_enable (state, crtc); -intel_encoders_pre_enable (state, crtc); +if (new_crtc_state->shared_dpll) +intel_enable_shared_dpll (new_crtc_state); -if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_transcoder_timings (new_crtc_state); +intel_encoders_pre_enable (state, crtc); + }else { +tgl_ddi_bigjoiner_pre_enable (state, new_crtc_state); + }intel_set_pipe_src_size (new_crtc_state); +if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) +bdw_set_pipemisc (new_crtc_state); -if (cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (cpu_transcoder)) -intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), - new_crtc_state->pixel_multiplier -1 ); +if (!new_crtc_state->bigjoiner_slave && !transcoder_is_dsi (cpu_transcoder)) { +if (!transcoder_is_dsi (cpu_transcoder)) +intel_set_transcoder_timings (new_crtc_state); -if (new_crtc_state->has_pch_encoder) -intel_cpu_transcoder_set_m_n (new_crtc_state, - &new_crtc_state->fdi_m_n,NULL ); +if (cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (cpu_transcoder)) +intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), + new_crtc_state->pixel_multiplier -1 ); + +if (new_crtc_state->has_pch_encoder) +intel_cpu_transcoder_set_m_n (new_crtc_state, + &new_crtc_state->fdi_m_n,NULL ); -if (!transcoder_is_dsi (cpu_transcoder)) {hsw_set_frame_start_delay (new_crtc_state); -hsw_set_pipeconf (new_crtc_state); } -if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) -bdw_set_pipemisc (new_crtc_state); +if (!transcoder_is_dsi (cpu_transcoder)) +hsw_set_pipeconf (new_crtc_state); crtc->active = true;@@ -7099,6 +7143,11 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (crtc); +if (new_crtc_state->bigjoiner_slave) { +trace_intel_pipe_enable (crtc); +intel_crtc_vblank_on (new_crtc_state); + } +intel_encoders_enable (state, crtc);if (psl_clkgate_wa) {@@ -7381,6 +7430,9 @@ static u64 get_crtc_power_domains(struct intel_crtc_state *crtc_state)if (crtc_state->shared_dpll) mask |=BIT_ULL (POWER_DOMAIN_DISPLAY_CORE ); +if (crtc_state->dsc.compression_enable) + mask |=BIT_ULL (intel_dsc_power_domain (crtc_state)); +return mask; }@@ -7999,6 +8051,30 @@ static u32 ilk_pipe_pixel_rate(const struct intel_crtc_state *crtc_state) pfit_w * pfit_h); } +static void intel_encoder_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; + + encoder->get_config (encoder, crtc_state); + + *pipe_mode = crtc_state->hw.adjusted_mode; +if (crtc_state->bigjoiner) { +/* +* transcoder is programmed to the full mode, +* but pipe timings are half of the transcoder mode +*/ + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_mode->crtc_clock /=2 ; + } +} +static void intel_crtc_compute_pixel_rate (struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);@@ -8910,20 +8986,22 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,void intel_mode_from_pipe_config (struct drm_display_mode *mode,struct intel_crtc_state *pipe_config) { - mode->hdisplay = pipe_config->hw.adjusted_mode.crtc_hdisplay; - mode->htotal = pipe_config->hw.adjusted_mode.crtc_htotal; - mode->hsync_start = pipe_config->hw.adjusted_mode.crtc_hsync_start; - mode->hsync_end = pipe_config->hw.adjusted_mode.crtc_hsync_end; +struct drm_display_mode *hw_mode = &pipe_config->hw.adjusted_mode; - mode->vdisplay = pipe_config->hw.adjusted_mode.crtc_vdisplay; - mode->vtotal = pipe_config->hw.adjusted_mode.crtc_vtotal; - mode->vsync_start = pipe_config->hw.adjusted_mode.crtc_vsync_start; - mode->vsync_end = pipe_config->hw.adjusted_mode.crtc_vsync_end; + mode->hdisplay = hw_mode->crtc_hdisplay; + mode->htotal = hw_mode->crtc_htotal; + mode->hsync_start = hw_mode->crtc_hsync_start; + mode->hsync_end = hw_mode->crtc_hsync_end; - mode->flags = pipe_config->hw.adjusted_mode.flags; + mode->vdisplay = hw_mode->crtc_vdisplay; + mode->vtotal = hw_mode->crtc_vtotal; + mode->vsync_start = hw_mode->crtc_vsync_start; + mode->vsync_end = hw_mode->crtc_vsync_end; + + mode->flags = hw_mode->flags; mode->type =DRM_MODE_TYPE_DRIVER ; - mode->clock = pipe_config->hw.adjusted_mode.crtc_clock; + mode->clock = hw_mode->crtc_clock;drm_mode_set_name (mode); }@@ -11081,6 +11159,9 @@ static void hsw_get_ddi_port_state(struct intel_crtc *crtc, }else { tmp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(tmp &TRANS_DDI_FUNC_ENABLE )) +return ; +if (INTEL_GEN (dev_priv) >=12 ) port =TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT (tmp);else @@ -11153,12 +11234,20 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,drm_WARN_ON (&dev_priv->drm, active); active = true; } +intel_dsc_get_config (pipe_config); -if (!active) - goto out; +if (!active) { +/* bigjoiner slave doesn't enable transcoder */ +if (!pipe_config->bigjoiner_slave) + goto out; -if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || -INTEL_GEN (dev_priv) >=11 ) { + active = true; + pipe_config->pixel_multiplier =1 ; + +/* we cannot read out most state, so don't bother.. */ + pipe_config->quirks |=PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE ; + }else if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || +INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config);intel_get_transcoder_timings (crtc, pipe_config); }@@ -11244,8 +11333,11 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc, } } -if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (pipe_config->cpu_transcoder)) { +if (pipe_config->bigjoiner_slave) { +/* Cannot be read out as a slave, set to 0. */ + pipe_config->pixel_multiplier =0 ; + }else if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (pipe_config->cpu_transcoder)) { pipe_config->pixel_multiplier =intel_de_read (dev_priv,PIPE_MULT (pipe_config->cpu_transcoder)) +1 ;@@ -12260,7 +12352,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)return NULL ; } - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state);intel_mode_from_pipe_config (mode, crtc_state);@@ -13252,10 +13344,12 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_atomic_state *state,static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state,struct drm_display_mode *user_mode) { - crtc_state->uapi.enable = crtc_state->hw.enable; - crtc_state->uapi.active = crtc_state->hw.active; -drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); +if (!crtc_state->bigjoiner_slave) { + crtc_state->uapi.enable = crtc_state->hw.enable; + crtc_state->uapi.active = crtc_state->hw.active; +drm_WARN_ON (crtc_state->uapi.crtc->dev, +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); + } crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13902,21 +13996,42 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (output_types); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); - -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); - -PIPE_CONF_CHECK_I (pixel_multiplier); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +/* bigjoiner mode = transcoder mode / 2, for calculations */ +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vtotal); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); + +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_INTERLACE ); + +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PVSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NVSYNC ); + } +PIPE_CONF_CHECK_I (pixel_multiplier); + }PIPE_CONF_CHECK_I (output_format);PIPE_CONF_CHECK_BOOL (has_hdmi_sink); if ((INTEL_GEN(dev_priv) < 8 && !IS_HASWELL(dev_priv)) ||@@ -13926,24 +14041,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (hdmi_scrambling);PIPE_CONF_CHECK_BOOL (hdmi_high_tmds_clock_ratio);PIPE_CONF_CHECK_BOOL (has_infoframe); -PIPE_CONF_CHECK_BOOL (fec_enable); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_BOOL (fec_enable);PIPE_CONF_CHECK_BOOL_INCOMPLETE (has_audio); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_INTERLACE ); - -if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PVSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NVSYNC ); - } -PIPE_CONF_CHECK_X (gmch_pfit.control);/* pfit ratios are autocomputed by the hw on gen4+ */ if (INTEL_GEN (dev_priv) <4 )@@ -13969,7 +14071,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, }PIPE_CONF_CHECK_I (scaler_state.scaler_id); -PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate);PIPE_CONF_CHECK_X (gamma_mode);if (IS_CHERRYVIEW (dev_priv))@@ -13990,48 +14093,51 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (double_wide);PIPE_CONF_CHECK_P (shared_dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); -PIPE_CONF_CHECK_X (dpll_hw_state.fp0); -PIPE_CONF_CHECK_X (dpll_hw_state.fp1); -PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); -PIPE_CONF_CHECK_X (dpll_hw_state.spll); -PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); -PIPE_CONF_CHECK_X (dpll_hw_state.pll0); -PIPE_CONF_CHECK_X (dpll_hw_state.pll1); -PIPE_CONF_CHECK_X (dpll_hw_state.pll2); -PIPE_CONF_CHECK_X (dpll_hw_state.pll3); -PIPE_CONF_CHECK_X (dpll_hw_state.pll6); -PIPE_CONF_CHECK_X (dpll_hw_state.pll8); -PIPE_CONF_CHECK_X (dpll_hw_state.pll9); -PIPE_CONF_CHECK_X (dpll_hw_state.pll10); -PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); - -PIPE_CONF_CHECK_X (dsi_pll.ctrl); -PIPE_CONF_CHECK_X (dsi_pll.div); - -if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) -PIPE_CONF_CHECK_I (pipe_bpp); - -PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); -PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); - -PIPE_CONF_CHECK_I (min_voltage_level); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +PIPE_CONF_CHECK_X (dpll_hw_state.dpll); +PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); +PIPE_CONF_CHECK_X (dpll_hw_state.fp0); +PIPE_CONF_CHECK_X (dpll_hw_state.fp1); +PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); +PIPE_CONF_CHECK_X (dpll_hw_state.spll); +PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); +PIPE_CONF_CHECK_X (dpll_hw_state.pll0); +PIPE_CONF_CHECK_X (dpll_hw_state.pll1); +PIPE_CONF_CHECK_X (dpll_hw_state.pll2); +PIPE_CONF_CHECK_X (dpll_hw_state.pll3); +PIPE_CONF_CHECK_X (dpll_hw_state.pll6); +PIPE_CONF_CHECK_X (dpll_hw_state.pll8); +PIPE_CONF_CHECK_X (dpll_hw_state.pll9); +PIPE_CONF_CHECK_X (dpll_hw_state.pll10); +PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); + +PIPE_CONF_CHECK_X (dsi_pll.ctrl); +PIPE_CONF_CHECK_X (dsi_pll.div); + +if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) +PIPE_CONF_CHECK_I (pipe_bpp); + +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.pipe_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); + +PIPE_CONF_CHECK_I (min_voltage_level); + }PIPE_CONF_CHECK_X (infoframes.enable);PIPE_CONF_CHECK_X (infoframes.gcp);@@ -14043,11 +14149,12 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (sync_mode_slaves_mask);PIPE_CONF_CHECK_I (master_transcoder); - +PIPE_CONF_CHECK_BOOL (bigjoiner); +PIPE_CONF_CHECK_BOOL (bigjoiner_slave); +PIPE_CONF_CHECK_P (bigjoiner_linked_crtc);PIPE_CONF_CHECK_I (dsc.compression_enable);PIPE_CONF_CHECK_I (dsc.dsc_split);PIPE_CONF_CHECK_I (dsc.compressed_bpp); -PIPE_CONF_CHECK_I (mst_master_transcoder);#undef PIPE_CONF_CHECK_X@@ -14314,6 +14421,7 @@ verify_crtc_state(struct intel_crtc *crtc,struct intel_encoder *encoder;struct intel_crtc_state *pipe_config = old_crtc_state;struct drm_atomic_state *state = old_crtc_state->uapi.state; +struct intel_crtc *master = crtc;bool active;__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->uapi);@@ -14340,7 +14448,10 @@ verify_crtc_state(struct intel_crtc *crtc,"(expected %i, found %i)\n" , new_crtc_state->hw.active, crtc->active); -for_each_encoder_on_crtc (dev, &crtc->base, encoder) { +if (new_crtc_state->bigjoiner_slave) + master = new_crtc_state->bigjoiner_linked_crtc; + +for_each_encoder_on_crtc (dev, &master->base, encoder) {enum pipe pipe; active = encoder->get_hw_state (encoder, &pipe);@@ -14349,12 +14460,12 @@ verify_crtc_state(struct intel_crtc *crtc, encoder->base.base.id, active, new_crtc_state->hw.active); -I915_STATE_WARN (active && crtc->pipe != pipe, +I915_STATE_WARN (active && master->pipe != pipe,"Encoder connected to wrong pipe %c\n" ,pipe_name (pipe));if (active) - encoder->get_config (encoder, pipe_config); +intel_encoder_get_config (encoder, pipe_config); }intel_crtc_compute_pixel_rate (pipe_config);@@ -15376,7 +15487,12 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state, {struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +drm_WARN_ON (&dev_priv->drm, old_crtc_state->bigjoiner_slave); +intel_crtc_disable_planes (state, crtc); +if (old_crtc_state->bigjoiner) +intel_crtc_disable_planes (state, + old_crtc_state->bigjoiner_linked_crtc);/* * We need to disable pipe CRC before disabling the pipe, @@ -15406,7 +15522,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)/* Only disable port sync and MST slaves */ for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (new_crtc_state)) +if (!needs_modeset (new_crtc_state) || old_crtc_state->bigjoiner_slave)continue ;if (!old_crtc_state->hw.active)@@ -15421,7 +15537,6 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) !intel_dp_mst_is_slave_trans(old_crtc_state)) continue; -intel_pre_plane_update (state, crtc);intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc); handled |=BIT (crtc->pipe);@@ -15431,10 +15546,18 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {if (!needs_modeset (new_crtc_state) || - (handled &BIT (crtc->pipe))) + (handled &BIT (crtc->pipe)) || + old_crtc_state->bigjoiner_slave)continue ;intel_pre_plane_update (state, crtc); +if (old_crtc_state->bigjoiner) { +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; + +intel_pre_plane_update (state, slave); + } +if (old_crtc_state->hw.active)intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc);@@ -18063,7 +18186,7 @@ int intel_modeset_init(struct drm_i915_private *i915)for_each_intel_crtc (dev, crtc) {struct intel_initial_plane_config plane_config = {}; -if (!crtc->active) +if (!to_intel_crtc_state (crtc->base.state)->uapi.active)continue ;/* @@ -18562,7 +18685,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc_state =to_intel_crtc_state (crtc->base.state); encoder->base.crtc = &crtc->base; - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state); + +/* read out to slave crtc as well for bigjoiner */ +if (crtc_state->bigjoiner) { +/* encoder should read be linked to bigjoiner master */ +WARN_ON (crtc_state->bigjoiner_slave); + + crtc = crtc_state->bigjoiner_linked_crtc; + crtc_state =to_intel_crtc_state (crtc->base.state); +intel_encoder_get_config (encoder, crtc_state); + } }else { encoder->base.crtc =NULL ; }drivers/gpu/drm/i915/display/intel_display_types.h +1
-0@@ -826,6 +826,7 @@ struct intel_crtc_state {* accordingly. */ #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1)/* bigjoiner slave, partial readout */ unsigned long quirks;unsigned fb_bits;/* framebuffers to flip */ drivers/gpu/drm/i915/display/intel_dp.c +2
-4@@ -2004,12 +2004,10 @@ static bool intel_dp_supports_fec(struct intel_dp *intel_dp,static bool intel_dp_supports_dsc (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) { -struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; - -if (!intel_dp_is_edp (intel_dp) && !crtc_state->fec_enable) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP ) && !crtc_state->fec_enable)return false; -return intel_dsc_source_support (encoder, crtc_state) && +return intel_dsc_source_support (crtc_state) &&drm_dp_sink_supports_dsc (intel_dp->dsc_dpcd); }drivers/gpu/drm/i915/display/intel_vdsc.c +27
-58@@ -332,11 +332,10 @@ static const struct rc_parameters *get_rc_params(u16 compressed_bpp,return &rc_parameters[row_index][column_index]; } -bool intel_dsc_source_support (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +bool intel_dsc_source_support (const struct intel_crtc_state *crtc_state) {const struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct drm_i915_private *i915 =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;enum pipe pipe = crtc->pipe;@@ -490,11 +489,10 @@ intel_dsc_power_domain(const struct intel_crtc_state *crtc_state)return POWER_DOMAIN_TRANSCODER_VDSC_PW2 ; } -static void intel_dsc_pps_configure (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +static void intel_dsc_pps_configure (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;enum pipe pipe = crtc->pipe;u32 pps_val =0 ;@@ -503,6 +501,9 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder,u8 num_vdsc_instances = (crtc_state->dsc.dsc_split) ?2 :1 ;int i =0 ; +if (crtc_state->bigjoiner) + num_vdsc_instances *=2 ; +/* Populate PICTURE_PARAMETER_SET_0 registers */ pps_val =DSC_VER_MAJ | vdsc_cfg->dsc_version_minor << DSC_VER_MIN_SHIFT |@@ -973,55 +974,6 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } -void intel_dsc_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -enum pipe pipe = crtc->pipe; -enum intel_display_power_domain power_domain; -intel_wakeref_t wakeref; -u32 dss_ctl1, dss_ctl2, val; - -if (!intel_dsc_source_support (encoder, crtc_state)) -return ; - - power_domain =intel_dsc_power_domain (crtc_state); - - wakeref =intel_display_power_get_if_enabled (dev_priv, power_domain); -if (!wakeref) -return ; - -if (!is_pipe_dsc (crtc_state)) { - dss_ctl1 =intel_de_read (dev_priv,DSS_CTL1 ); - dss_ctl2 =intel_de_read (dev_priv,DSS_CTL2 ); - }else { - dss_ctl1 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL1 (pipe)); - dss_ctl2 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL2 (pipe)); - } - - crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; -if (!crtc_state->dsc.compression_enable) - goto out; - - crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && - (dss_ctl1 &JOINER_ENABLE ); - -/* FIXME: add more state readout as needed */ - -/* PPS1 */ -if (!is_pipe_dsc (crtc_state)) - val =intel_de_read (dev_priv,DSCA_PICTURE_PARAMETER_SET_1 ); -else - val =intel_de_read (dev_priv, -ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); - vdsc_cfg->bits_per_pixel = val; - crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; -out: -intel_display_power_put (dev_priv, power_domain, wakeref); -} -static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {@@ -1060,77 +1012,130 @@ static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, sizeof(dp_dsc_pps_sdp)); } +static i915_reg_t dss_ctl1_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL1 ; + +return ICL_PIPE_DSS_CTL1 (pipe); +} + +static i915_reg_t dss_ctl2_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL2 ; + +return ICL_PIPE_DSS_CTL2 (pipe); +} +void intel_dsc_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -enum pipe pipe = crtc->pipe; -i915_reg_t dss_ctl1_reg, dss_ctl2_reg;
drivers/gpu/drm/i915/display/intel_vdsc.c static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, · line 1078
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +1
-3+struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);u32 dss_ctl1_val =0 ;u32 dss_ctl2_val =0 ;if (!crtc_state->dsc.compression_enable)return ; -/* Enable Power wells for VDSC/joining */ -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state));
Why do we remove the power get for dsc_power_domains here? IMO this is causing the CI error since in dsc_disables we do try to put the dsc_power_domains but we error out saying on dsc disable:
"Use count on VDSC POWER DOMAIN already 0"
we need to get power domains here since for Pipe A/eDP on TGL, we do need a separate PW2 for VDSC.
Manasi
Quoted 158 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +74
-36+intel_dsc_pps_configure (crtc_state); -intel_dsc_pps_configure (encoder, crtc_state); - -if (encoder->type ==INTEL_OUTPUT_DSI ) -intel_dsc_dsi_pps_write (encoder, crtc_state); -else -intel_dsc_dp_pps_write (encoder, crtc_state); - -if (!is_pipe_dsc (crtc_state)) { - dss_ctl1_reg =DSS_CTL1 ; - dss_ctl2_reg =DSS_CTL2 ; - }else { - dss_ctl1_reg =ICL_PIPE_DSS_CTL1 (pipe); - dss_ctl2_reg =ICL_PIPE_DSS_CTL2 (pipe); +if (!crtc_state->bigjoiner_slave) { +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DSI )) +intel_dsc_dsi_pps_write (encoder, crtc_state); +else +intel_dsc_dp_pps_write (encoder, crtc_state); } + dss_ctl2_val |=LEFT_BRANCH_VDSC_ENABLE ;if (crtc_state->dsc.dsc_split) { dss_ctl2_val |=RIGHT_BRANCH_VDSC_ENABLE ; dss_ctl1_val |=JOINER_ENABLE ; } -intel_de_write (dev_priv, dss_ctl1_reg, dss_ctl1_val); -intel_de_write (dev_priv, dss_ctl2_reg, dss_ctl2_val); +if (crtc_state->bigjoiner) { + dss_ctl1_val |=BIG_JOINER_ENABLE ; +if (!crtc_state->bigjoiner_slave) + dss_ctl1_val |=MASTER_BIG_JOINER_ENABLE ; + } +intel_de_write (dev_priv,dss_ctl1_reg (crtc_state), dss_ctl1_val); +intel_de_write (dev_priv,dss_ctl2_reg (crtc_state), dss_ctl2_val); }void intel_dsc_disable (const struct intel_crtc_state *old_crtc_state) {struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -enum pipe pipe = crtc->pipe; -i915_reg_t dss_ctl1_reg, dss_ctl2_reg; -u32 dss_ctl1_val =0 , dss_ctl2_val =0 ;if (!old_crtc_state->dsc.compression_enable)return ; -if (!is_pipe_dsc (old_crtc_state)) { - dss_ctl1_reg =DSS_CTL1 ; - dss_ctl2_reg =DSS_CTL2 ; - }else { - dss_ctl1_reg =ICL_PIPE_DSS_CTL1 (pipe); - dss_ctl2_reg =ICL_PIPE_DSS_CTL2 (pipe); - } - dss_ctl1_val =intel_de_read (dev_priv, dss_ctl1_reg); -if (dss_ctl1_val &JOINER_ENABLE ) - dss_ctl1_val &= ~JOINER_ENABLE ; -intel_de_write (dev_priv, dss_ctl1_reg, dss_ctl1_val); - - dss_ctl2_val =intel_de_read (dev_priv, dss_ctl2_reg); -if (dss_ctl2_val &LEFT_BRANCH_VDSC_ENABLE || - dss_ctl2_val &RIGHT_BRANCH_VDSC_ENABLE ) - dss_ctl2_val &= ~(LEFT_BRANCH_VDSC_ENABLE | -RIGHT_BRANCH_VDSC_ENABLE ); -intel_de_write (dev_priv, dss_ctl2_reg, dss_ctl2_val); +intel_de_write (dev_priv,dss_ctl1_reg (old_crtc_state),0 ); +intel_de_write (dev_priv,dss_ctl2_reg (old_crtc_state),0 );/* Disable Power wells for VDSC/joining */ intel_display_power_put_unchecked (dev_priv,intel_dsc_power_domain (old_crtc_state)); } + +void intel_dsc_get_config (struct intel_crtc_state *crtc_state) +{ +struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; +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; +enum intel_display_power_domain power_domain; +intel_wakeref_t wakeref; +u32 dss_ctl1, dss_ctl2, val; + +if (!intel_dsc_source_support (crtc_state)) +return ; + + power_domain =intel_dsc_power_domain (crtc_state); + + wakeref =intel_display_power_get_if_enabled (dev_priv, power_domain); +if (!wakeref) +return ; + + dss_ctl1 =intel_de_read (dev_priv,dss_ctl1_reg (crtc_state)); + dss_ctl2 =intel_de_read (dev_priv,dss_ctl2_reg (crtc_state)); + + crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; +if (!crtc_state->dsc.compression_enable) + goto out; + + crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && + (dss_ctl1 &JOINER_ENABLE ); + +if (dss_ctl1 &BIG_JOINER_ENABLE ) { + crtc_state->bigjoiner = true; + +if (!(dss_ctl1 &MASTER_BIG_JOINER_ENABLE )) { + crtc_state->bigjoiner_slave = true; +if (!WARN_ON (crtc->pipe ==PIPE_A )) + crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe -1 ); + }else { +if (!WARN_ON (INTEL_NUM_PIPES (dev_priv) == crtc->pipe +1 )) + crtc_state->bigjoiner_linked_crtc = +intel_get_crtc_for_pipe (dev_priv, crtc->pipe +1 ); + } + } + +/* FIXME: add more state readout as needed */ + +/* PPS1 */ +if (!is_pipe_dsc (crtc_state)) + val =intel_de_read (dev_priv,DSCA_PICTURE_PARAMETER_SET_1 ); +else + val =intel_de_read (dev_priv, +ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); + vdsc_cfg->bits_per_pixel = val; + crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; +out: +intel_display_power_put (dev_priv, power_domain, wakeref); +}drivers/gpu/drm/i915/display/intel_vdsc.h +3
-4@@ -11,15 +11,14 @@struct intel_encoder ;struct intel_crtc_state ; -bool intel_dsc_source_support (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state); +bool intel_dsc_source_support (const struct intel_crtc_state *crtc_state);void intel_dsc_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state);void intel_dsc_disable (const struct intel_crtc_state *crtc_state);int intel_dsc_compute_params (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); -void intel_dsc_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *crtc_state); +void intel_dsc_get_config (struct intel_crtc_state *crtc_state); +enum intel_display_power_domain intel_dsc_power_domain (const struct intel_crtc_state *crtc_state);Signature · 1 line
2.19.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [Intel-gfx] [PATCH v6 06/11] drm/i915: Enable big joiner support in enable and disable sequences.
Op 16-07-2020 om 21:27 schreef Manasi Navare:
Quoted 955 lines · Manasi Navare
Quoted 941 lines
From: Maarten Lankhorst <[email protected]>
Make vdsc work when no output is enabled. The big joiner needs VDSC on the slave, so enable it and set the appropriate bits. Also update timestamping constants, because slave crtc's are not updated in
drm_atomic_helper_update_legacy_modeset_state().This should be enough to bring up CRTC's in a big joiner configuration, without any plane configuration on the second pipe yet.
HOWEVER, we still bring up the crtc's in the wrong order. We need to make sure that the master crtc is brought up after the slave crtc. This is done correctly later in this series.
The next steps are to enable planes correctly, and make sure we enable and update both master and slave in the correct order.
v2:
* Manual rebase (Manasi)v3:
* Rebase (Manasi)v4:
* Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_ddi.c | 68 +++- drivers/gpu/drm/i915/display/intel_display.c | 377 ++++++++++++------ .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 6 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 199 ++++----- drivers/gpu/drm/i915/display/intel_vdsc.h | 7 +- 7 files changed, 414 insertions(+), 246 deletions(-)drivers/gpu/drm/i915/display/icl_dsi.c +0
-2@@ -1454,8 +1454,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -intel_dsc_get_config (encoder, pipe_config); -/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =intel_dpll_get_freq (i915, pipe_config->shared_dpll);drivers/gpu/drm/i915/display/intel_ddi.c +51
-17@@ -28,6 +28,7 @@#include <drm/drm_scdc_helper.h> #include "i915_drv.h" +#include "i915_trace.h" #include "intel_audio.h" #include "intel_combo_phy.h" #include "intel_connector.h" @@ -2040,12 +2041,6 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,intel_display_power_get (dev_priv,intel_ddi_main_link_aux_domain (dig_port)); -/* -* VDSC power is needed when DSC is enabled -*/ -if (crtc_state->dsc.compression_enable) -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state)); } void intel_ddi_enable_pipe_clock(struct intel_encoder *encoder,@@ -3313,7 +3308,8 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,/* 7.l Configure and enable FEC if needed */ intel_ddi_enable_fec (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3384,7 +3380,8 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,if (!is_mst)intel_ddi_enable_pipe_clock (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3639,6 +3636,21 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state,ilk_pfit_disable (old_crtc_state); } +if (old_crtc_state->bigjoiner_linked_crtc) { +struct intel_atomic_state *state = +to_intel_atomic_state (old_crtc_state->uapi.state); +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; +const struct intel_crtc_state *old_slave_crtc_state = +intel_atomic_get_old_crtc_state (state, slave); + +intel_crtc_vblank_off (old_slave_crtc_state); +trace_intel_pipe_disable (slave); + +intel_dsc_disable (old_slave_crtc_state); +skl_scaler_disable (old_slave_crtc_state); + } +/* * When called from DP MST code: * - old_conn_state will be NULL @@ -3853,7 +3865,8 @@ static void intel_enable_ddi(struct intel_atomic_state *state, {drm_WARN_ON (state->base.dev, crtc_state->has_pch_encoder); -intel_ddi_enable_transcoder_func (encoder, crtc_state); +if (!crtc_state->bigjoiner_slave) +intel_ddi_enable_transcoder_func (encoder, crtc_state);intel_enable_pipe (crtc_state);@@ -4200,8 +4213,8 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) crtc_state->sync_mode_slaves_mask); } -void intel_ddi_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +static void intel_ddi_read_func_ctl (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->uapi.crtc);@@ -4209,13 +4222,10 @@ void intel_ddi_get_config(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (encoder);u32 temp, flags =0 ; -/* XXX: DSI transcoder paranoia */ -if (drm_WARN_ON (&dev_priv->drm,transcoder_is_dsi (cpu_transcoder))) + temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(temp &TRANS_DDI_FUNC_ENABLE ))return ; -intel_dsc_get_config (encoder, pipe_config); - - temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder));if (temp &TRANS_DDI_PHSYNC ) flags |=DRM_MODE_FLAG_PHSYNC ;else @@ -4323,6 +4333,29 @@ void intel_ddi_get_config(struct intel_encoder *encoder, intel_dp->regs.dp_tp_ctl =TGL_DP_TP_CTL (transcoder); intel_dp->regs.dp_tp_status =TGL_DP_TP_STATUS (transcoder); } +} + +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); +enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; + +/* XXX: DSI transcoder paranoia */ +if (WARN_ON (transcoder_is_dsi (cpu_transcoder))) +return ; + +intel_ddi_read_func_ctl (encoder, pipe_config); +if (pipe_config->bigjoiner_slave) { +/* read out pipe settings from master */ +enum transcoder save = pipe_config->cpu_transcoder; + +/* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */ +WARN_ON (pipe_config->output_types); + pipe_config->cpu_transcoder = (enum transcoder )pipe_config->bigjoiner_linked_crtc->pipe; +intel_ddi_read_func_ctl (encoder, pipe_config); + pipe_config->cpu_transcoder = save; + } pipe_config->has_audio =intel_ddi_is_audio_enabled (dev_priv, cpu_transcoder);@@ -4348,7 +4381,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp; } -intel_ddi_clock_get (encoder, pipe_config); +if (!pipe_config->bigjoiner_slave) +intel_ddi_clock_get (encoder, pipe_config);if (IS_GEN9_LP (dev_priv)) pipe_config->lane_lat_optim_mask =drivers/gpu/drm/i915/display/intel_display.c +255
-122@@ -7023,6 +7023,45 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state)intel_de_write (dev_priv, reg, val); } +static void tgl_ddi_bigjoiner_pre_enable (struct intel_atomic_state *state, +const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *master =to_intel_crtc (crtc_state->uapi.crtc); +struct intel_crtc_state *master_crtc_state; +struct drm_connector_state *conn_state; +struct drm_connector *conn; +struct intel_encoder *encoder =NULL ; +int i; + +if (crtc_state->bigjoiner_slave) + master = crtc_state->bigjoiner_linked_crtc; + + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); + +for_each_new_connector_in_state (&state->base, conn, conn_state, i) { +if (conn_state->crtc != &master->base) +continue ; + + encoder =to_intel_encoder (conn_state->best_encoder); +break ; + } + +if (!crtc_state->bigjoiner_slave) { +/* need to enable VDSC, which we skipped in pre-enable */ +intel_dsc_enable (encoder, crtc_state); + }else { +/* +* Enable sequence steps 1-7 on bigjoiner master +*/ +intel_encoders_pre_pll_enable (state, master); +intel_enable_shared_dpll (master_crtc_state); +intel_encoders_pre_enable (state, master); + +/* and DSC on slave */ +intel_dsc_enable (NULL , crtc_state); + } +} +static void hsw_crtc_enable (struct intel_atomic_state *state,struct intel_crtc *crtc) {@@ -7036,34 +7075,39 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (drm_WARN_ON (&dev_priv->drm, crtc->active))return ; -intel_encoders_pre_pll_enable (state, crtc); - -if (new_crtc_state->shared_dpll) -intel_enable_shared_dpll (new_crtc_state); +if (!new_crtc_state->bigjoiner) { +intel_encoders_pre_pll_enable (state, crtc); -intel_encoders_pre_enable (state, crtc); +if (new_crtc_state->shared_dpll) +intel_enable_shared_dpll (new_crtc_state); -if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_transcoder_timings (new_crtc_state); +intel_encoders_pre_enable (state, crtc); + }else { +tgl_ddi_bigjoiner_pre_enable (state, new_crtc_state); + }intel_set_pipe_src_size (new_crtc_state); +if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) +bdw_set_pipemisc (new_crtc_state); -if (cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (cpu_transcoder)) -intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), - new_crtc_state->pixel_multiplier -1 ); +if (!new_crtc_state->bigjoiner_slave && !transcoder_is_dsi (cpu_transcoder)) { +if (!transcoder_is_dsi (cpu_transcoder)) +intel_set_transcoder_timings (new_crtc_state); -if (new_crtc_state->has_pch_encoder) -intel_cpu_transcoder_set_m_n (new_crtc_state, - &new_crtc_state->fdi_m_n,NULL ); +if (cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (cpu_transcoder)) +intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), + new_crtc_state->pixel_multiplier -1 ); + +if (new_crtc_state->has_pch_encoder) +intel_cpu_transcoder_set_m_n (new_crtc_state, + &new_crtc_state->fdi_m_n,NULL ); -if (!transcoder_is_dsi (cpu_transcoder)) {hsw_set_frame_start_delay (new_crtc_state); -hsw_set_pipeconf (new_crtc_state); } -if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) -bdw_set_pipemisc (new_crtc_state); +if (!transcoder_is_dsi (cpu_transcoder)) +hsw_set_pipeconf (new_crtc_state); crtc->active = true;@@ -7099,6 +7143,11 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (crtc); +if (new_crtc_state->bigjoiner_slave) { +trace_intel_pipe_enable (crtc); +intel_crtc_vblank_on (new_crtc_state); + } +intel_encoders_enable (state, crtc);if (psl_clkgate_wa) {@@ -7381,6 +7430,9 @@ static u64 get_crtc_power_domains(struct intel_crtc_state *crtc_state)if (crtc_state->shared_dpll) mask |=BIT_ULL (POWER_DOMAIN_DISPLAY_CORE ); +if (crtc_state->dsc.compression_enable) + mask |=BIT_ULL (intel_dsc_power_domain (crtc_state)); +return mask; }@@ -7999,6 +8051,30 @@ static u32 ilk_pipe_pixel_rate(const struct intel_crtc_state *crtc_state) pfit_w * pfit_h); } +static void intel_encoder_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; + + encoder->get_config (encoder, crtc_state); + + *pipe_mode = crtc_state->hw.adjusted_mode; +if (crtc_state->bigjoiner) { +/* +* transcoder is programmed to the full mode, +* but pipe timings are half of the transcoder mode +*/ + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_mode->crtc_clock /=2 ; + } +} +static void intel_crtc_compute_pixel_rate (struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);@@ -8910,20 +8986,22 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,void intel_mode_from_pipe_config (struct drm_display_mode *mode,struct intel_crtc_state *pipe_config) { - mode->hdisplay = pipe_config->hw.adjusted_mode.crtc_hdisplay; - mode->htotal = pipe_config->hw.adjusted_mode.crtc_htotal; - mode->hsync_start = pipe_config->hw.adjusted_mode.crtc_hsync_start; - mode->hsync_end = pipe_config->hw.adjusted_mode.crtc_hsync_end; +struct drm_display_mode *hw_mode = &pipe_config->hw.adjusted_mode; - mode->vdisplay = pipe_config->hw.adjusted_mode.crtc_vdisplay; - mode->vtotal = pipe_config->hw.adjusted_mode.crtc_vtotal; - mode->vsync_start = pipe_config->hw.adjusted_mode.crtc_vsync_start; - mode->vsync_end = pipe_config->hw.adjusted_mode.crtc_vsync_end; + mode->hdisplay = hw_mode->crtc_hdisplay; + mode->htotal = hw_mode->crtc_htotal; + mode->hsync_start = hw_mode->crtc_hsync_start; + mode->hsync_end = hw_mode->crtc_hsync_end; - mode->flags = pipe_config->hw.adjusted_mode.flags; + mode->vdisplay = hw_mode->crtc_vdisplay; + mode->vtotal = hw_mode->crtc_vtotal; + mode->vsync_start = hw_mode->crtc_vsync_start; + mode->vsync_end = hw_mode->crtc_vsync_end; + + mode->flags = hw_mode->flags; mode->type =DRM_MODE_TYPE_DRIVER ; - mode->clock = pipe_config->hw.adjusted_mode.crtc_clock; + mode->clock = hw_mode->crtc_clock;drm_mode_set_name (mode); }@@ -11081,6 +11159,9 @@ static void hsw_get_ddi_port_state(struct intel_crtc *crtc, }else { tmp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(tmp &TRANS_DDI_FUNC_ENABLE )) +return ; +if (INTEL_GEN (dev_priv) >=12 ) port =TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT (tmp);else @@ -11153,12 +11234,20 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,drm_WARN_ON (&dev_priv->drm, active); active = true; } +intel_dsc_get_config (pipe_config); -if (!active) - goto out; +if (!active) { +/* bigjoiner slave doesn't enable transcoder */ +if (!pipe_config->bigjoiner_slave) + goto out; -if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || -INTEL_GEN (dev_priv) >=11 ) { + active = true; + pipe_config->pixel_multiplier =1 ; + +/* we cannot read out most state, so don't bother.. */ + pipe_config->quirks |=PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE ; + }else if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || +INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config);intel_get_transcoder_timings (crtc, pipe_config); }@@ -11244,8 +11333,11 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc, } } -if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (pipe_config->cpu_transcoder)) { +if (pipe_config->bigjoiner_slave) { +/* Cannot be read out as a slave, set to 0. */ + pipe_config->pixel_multiplier =0 ; + }else if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (pipe_config->cpu_transcoder)) { pipe_config->pixel_multiplier =intel_de_read (dev_priv,PIPE_MULT (pipe_config->cpu_transcoder)) +1 ;@@ -12260,7 +12352,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)return NULL ; } - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state);intel_mode_from_pipe_config (mode, crtc_state);@@ -13252,10 +13344,12 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_atomic_state *state,static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state,struct drm_display_mode *user_mode) { - crtc_state->uapi.enable = crtc_state->hw.enable; - crtc_state->uapi.active = crtc_state->hw.active; -drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); +if (!crtc_state->bigjoiner_slave) { + crtc_state->uapi.enable = crtc_state->hw.enable; + crtc_state->uapi.active = crtc_state->hw.active; +drm_WARN_ON (crtc_state->uapi.crtc->dev, +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); + } crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13902,21 +13996,42 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (output_types); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); - -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); - -PIPE_CONF_CHECK_I (pixel_multiplier); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +/* bigjoiner mode = transcoder mode / 2, for calculations */ +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vtotal); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); + +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_INTERLACE ); + +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PVSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NVSYNC ); + } +PIPE_CONF_CHECK_I (pixel_multiplier); + }PIPE_CONF_CHECK_I (output_format);PIPE_CONF_CHECK_BOOL (has_hdmi_sink); if ((INTEL_GEN(dev_priv) < 8 && !IS_HASWELL(dev_priv)) ||@@ -13926,24 +14041,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (hdmi_scrambling);PIPE_CONF_CHECK_BOOL (hdmi_high_tmds_clock_ratio);PIPE_CONF_CHECK_BOOL (has_infoframe); -PIPE_CONF_CHECK_BOOL (fec_enable); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_BOOL (fec_enable);PIPE_CONF_CHECK_BOOL_INCOMPLETE (has_audio); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_INTERLACE ); - -if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PVSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NVSYNC ); - } -PIPE_CONF_CHECK_X (gmch_pfit.control);/* pfit ratios are autocomputed by the hw on gen4+ */ if (INTEL_GEN (dev_priv) <4 )@@ -13969,7 +14071,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, }PIPE_CONF_CHECK_I (scaler_state.scaler_id); -PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate);PIPE_CONF_CHECK_X (gamma_mode);if (IS_CHERRYVIEW (dev_priv))@@ -13990,48 +14093,51 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (double_wide);PIPE_CONF_CHECK_P (shared_dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); -PIPE_CONF_CHECK_X (dpll_hw_state.fp0); -PIPE_CONF_CHECK_X (dpll_hw_state.fp1); -PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); -PIPE_CONF_CHECK_X (dpll_hw_state.spll); -PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); -PIPE_CONF_CHECK_X (dpll_hw_state.pll0); -PIPE_CONF_CHECK_X (dpll_hw_state.pll1); -PIPE_CONF_CHECK_X (dpll_hw_state.pll2); -PIPE_CONF_CHECK_X (dpll_hw_state.pll3); -PIPE_CONF_CHECK_X (dpll_hw_state.pll6); -PIPE_CONF_CHECK_X (dpll_hw_state.pll8); -PIPE_CONF_CHECK_X (dpll_hw_state.pll9); -PIPE_CONF_CHECK_X (dpll_hw_state.pll10); -PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); - -PIPE_CONF_CHECK_X (dsi_pll.ctrl); -PIPE_CONF_CHECK_X (dsi_pll.div); - -if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) -PIPE_CONF_CHECK_I (pipe_bpp); - -PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); -PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); - -PIPE_CONF_CHECK_I (min_voltage_level); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +PIPE_CONF_CHECK_X (dpll_hw_state.dpll); +PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); +PIPE_CONF_CHECK_X (dpll_hw_state.fp0); +PIPE_CONF_CHECK_X (dpll_hw_state.fp1); +PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); +PIPE_CONF_CHECK_X (dpll_hw_state.spll); +PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); +PIPE_CONF_CHECK_X (dpll_hw_state.pll0); +PIPE_CONF_CHECK_X (dpll_hw_state.pll1); +PIPE_CONF_CHECK_X (dpll_hw_state.pll2); +PIPE_CONF_CHECK_X (dpll_hw_state.pll3); +PIPE_CONF_CHECK_X (dpll_hw_state.pll6); +PIPE_CONF_CHECK_X (dpll_hw_state.pll8); +PIPE_CONF_CHECK_X (dpll_hw_state.pll9); +PIPE_CONF_CHECK_X (dpll_hw_state.pll10); +PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); + +PIPE_CONF_CHECK_X (dsi_pll.ctrl); +PIPE_CONF_CHECK_X (dsi_pll.div); + +if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) +PIPE_CONF_CHECK_I (pipe_bpp); + +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.pipe_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); + +PIPE_CONF_CHECK_I (min_voltage_level); + }PIPE_CONF_CHECK_X (infoframes.enable);PIPE_CONF_CHECK_X (infoframes.gcp);@@ -14043,11 +14149,12 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (sync_mode_slaves_mask);PIPE_CONF_CHECK_I (master_transcoder); - +PIPE_CONF_CHECK_BOOL (bigjoiner); +PIPE_CONF_CHECK_BOOL (bigjoiner_slave); +PIPE_CONF_CHECK_P (bigjoiner_linked_crtc);PIPE_CONF_CHECK_I (dsc.compression_enable);PIPE_CONF_CHECK_I (dsc.dsc_split);PIPE_CONF_CHECK_I (dsc.compressed_bpp); -PIPE_CONF_CHECK_I (mst_master_transcoder);#undef PIPE_CONF_CHECK_X@@ -14314,6 +14421,7 @@ verify_crtc_state(struct intel_crtc *crtc,struct intel_encoder *encoder;struct intel_crtc_state *pipe_config = old_crtc_state;struct drm_atomic_state *state = old_crtc_state->uapi.state; +struct intel_crtc *master = crtc;bool active;__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->uapi);@@ -14340,7 +14448,10 @@ verify_crtc_state(struct intel_crtc *crtc,"(expected %i, found %i)\n" , new_crtc_state->hw.active, crtc->active); -for_each_encoder_on_crtc (dev, &crtc->base, encoder) { +if (new_crtc_state->bigjoiner_slave) + master = new_crtc_state->bigjoiner_linked_crtc; + +for_each_encoder_on_crtc (dev, &master->base, encoder) {enum pipe pipe; active = encoder->get_hw_state (encoder, &pipe);@@ -14349,12 +14460,12 @@ verify_crtc_state(struct intel_crtc *crtc, encoder->base.base.id, active, new_crtc_state->hw.active); -I915_STATE_WARN (active && crtc->pipe != pipe, +I915_STATE_WARN (active && master->pipe != pipe,"Encoder connected to wrong pipe %c\n" ,pipe_name (pipe));if (active) - encoder->get_config (encoder, pipe_config); +intel_encoder_get_config (encoder, pipe_config); }intel_crtc_compute_pixel_rate (pipe_config);@@ -15376,7 +15487,12 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state, {struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +drm_WARN_ON (&dev_priv->drm, old_crtc_state->bigjoiner_slave); +intel_crtc_disable_planes (state, crtc); +if (old_crtc_state->bigjoiner) +intel_crtc_disable_planes (state, + old_crtc_state->bigjoiner_linked_crtc);/* * We need to disable pipe CRC before disabling the pipe, @@ -15406,7 +15522,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)/* Only disable port sync and MST slaves */ for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (new_crtc_state)) +if (!needs_modeset (new_crtc_state) || old_crtc_state->bigjoiner_slave)continue ;if (!old_crtc_state->hw.active)@@ -15421,7 +15537,6 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) !intel_dp_mst_is_slave_trans(old_crtc_state)) continue; -intel_pre_plane_update (state, crtc);intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc); handled |=BIT (crtc->pipe);@@ -15431,10 +15546,18 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {if (!needs_modeset (new_crtc_state) || - (handled &BIT (crtc->pipe))) + (handled &BIT (crtc->pipe)) || + old_crtc_state->bigjoiner_slave)continue ;intel_pre_plane_update (state, crtc); +if (old_crtc_state->bigjoiner) { +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; + +intel_pre_plane_update (state, slave); + } +if (old_crtc_state->hw.active)intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc);@@ -18063,7 +18186,7 @@ int intel_modeset_init(struct drm_i915_private *i915)for_each_intel_crtc (dev, crtc) {struct intel_initial_plane_config plane_config = {}; -if (!crtc->active) +if (!to_intel_crtc_state (crtc->base.state)->uapi.active)continue ;/* @@ -18562,7 +18685,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc_state =to_intel_crtc_state (crtc->base.state); encoder->base.crtc = &crtc->base; - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state); + +/* read out to slave crtc as well for bigjoiner */ +if (crtc_state->bigjoiner) { +/* encoder should read be linked to bigjoiner master */ +WARN_ON (crtc_state->bigjoiner_slave); + + crtc = crtc_state->bigjoiner_linked_crtc; + crtc_state =to_intel_crtc_state (crtc->base.state); +intel_encoder_get_config (encoder, crtc_state); + } }else { encoder->base.crtc =NULL ; }drivers/gpu/drm/i915/display/intel_display_types.h +1
-0@@ -826,6 +826,7 @@ struct intel_crtc_state {* accordingly. */ #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1)/* bigjoiner slave, partial readout */ unsigned long quirks;unsigned fb_bits;/* framebuffers to flip */ drivers/gpu/drm/i915/display/intel_dp.c +2
-4@@ -2004,12 +2004,10 @@ static bool intel_dp_supports_fec(struct intel_dp *intel_dp,static bool intel_dp_supports_dsc (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) { -struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; - -if (!intel_dp_is_edp (intel_dp) && !crtc_state->fec_enable) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP ) && !crtc_state->fec_enable)return false; -return intel_dsc_source_support (encoder, crtc_state) && +return intel_dsc_source_support (crtc_state) &&drm_dp_sink_supports_dsc (intel_dp->dsc_dpcd); }drivers/gpu/drm/i915/display/intel_vdsc.c +27
-58@@ -332,11 +332,10 @@ static const struct rc_parameters *get_rc_params(u16 compressed_bpp,return &rc_parameters[row_index][column_index]; } -bool intel_dsc_source_support (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +bool intel_dsc_source_support (const struct intel_crtc_state *crtc_state) {const struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct drm_i915_private *i915 =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;enum pipe pipe = crtc->pipe;@@ -490,11 +489,10 @@ intel_dsc_power_domain(const struct intel_crtc_state *crtc_state)return POWER_DOMAIN_TRANSCODER_VDSC_PW2 ; } -static void intel_dsc_pps_configure (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +static void intel_dsc_pps_configure (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;enum pipe pipe = crtc->pipe;u32 pps_val =0 ;@@ -503,6 +501,9 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder,u8 num_vdsc_instances = (crtc_state->dsc.dsc_split) ?2 :1 ;int i =0 ; +if (crtc_state->bigjoiner) + num_vdsc_instances *=2 ; +/* Populate PICTURE_PARAMETER_SET_0 registers */ pps_val =DSC_VER_MAJ | vdsc_cfg->dsc_version_minor << DSC_VER_MIN_SHIFT |@@ -973,55 +974,6 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } -void intel_dsc_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -enum pipe pipe = crtc->pipe; -enum intel_display_power_domain power_domain; -intel_wakeref_t wakeref; -u32 dss_ctl1, dss_ctl2, val; - -if (!intel_dsc_source_support (encoder, crtc_state)) -return ; - - power_domain =intel_dsc_power_domain (crtc_state); - - wakeref =intel_display_power_get_if_enabled (dev_priv, power_domain); -if (!wakeref) -return ; - -if (!is_pipe_dsc (crtc_state)) { - dss_ctl1 =intel_de_read (dev_priv,DSS_CTL1 ); - dss_ctl2 =intel_de_read (dev_priv,DSS_CTL2 ); - }else { - dss_ctl1 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL1 (pipe)); - dss_ctl2 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL2 (pipe)); - } - - crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; -if (!crtc_state->dsc.compression_enable) - goto out; - - crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && - (dss_ctl1 &JOINER_ENABLE ); - -/* FIXME: add more state readout as needed */ - -/* PPS1 */ -if (!is_pipe_dsc (crtc_state)) - val =intel_de_read (dev_priv,DSCA_PICTURE_PARAMETER_SET_1 ); -else - val =intel_de_read (dev_priv, -ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); - vdsc_cfg->bits_per_pixel = val; - crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; -out: -intel_display_power_put (dev_priv, power_domain, wakeref); -} -static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {@@ -1060,77 +1012,130 @@ static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, sizeof(dp_dsc_pps_sdp)); } +static i915_reg_t dss_ctl1_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL1 ; + +return ICL_PIPE_DSS_CTL1 (pipe); +} + +static i915_reg_t dss_ctl2_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL2 ; + +return ICL_PIPE_DSS_CTL2 (pipe); +} +void intel_dsc_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -enum pipe pipe = crtc->pipe; -i915_reg_t dss_ctl1_reg, dss_ctl2_reg;drivers/gpu/drm/i915/display/intel_vdsc.c static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, · line 1078
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +1
-3+struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);u32 dss_ctl1_val =0 ;u32 dss_ctl2_val =0 ;if (!crtc_state->dsc.compression_enable)return ; -/* Enable Power wells for VDSC/joining */ -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state));Why do we remove the power get for
dsc_power_domainshere? IMO this is causing the CI error since indsc_disableswe do try to put thedsc_power_domainsbut we error out saying on dsc disable:
Quoted 3 lines
"Use count on VDSC POWER DOMAIN already 0"
we need to get power domains here since for Pipe A/eDP on TGL, we do need a separate PW2 for VDSC.
It's the other way around, we need to remove it from dsc_disable.
get_crtc_power_domains() ensures we always have the dsc power domain correct, even when reading out from the original hw state. It had to be decoupled from the encoder as the slave pipe doesn't have an encoder, and we still want the DSC power domain in that case. :)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v6 06/11] drm/i915: Enable big joiner support in enable and disable sequences.
Quoted 956 lines · Maarten Lankhorst
Op 16-07-2020 om 21:27 schreef Manasi Navare:
Quoted 955 lines · Manasi Navare
Quoted 941 lines
From: Maarten Lankhorst <[email protected]>
Make vdsc work when no output is enabled. The big joiner needs VDSC on the slave, so enable it and set the appropriate bits. Also update timestamping constants, because slave crtc's are not updated in
drm_atomic_helper_update_legacy_modeset_state().This should be enough to bring up CRTC's in a big joiner configuration, without any plane configuration on the second pipe yet.
HOWEVER, we still bring up the crtc's in the wrong order. We need to make sure that the master crtc is brought up after the slave crtc. This is done correctly later in this series.
The next steps are to enable planes correctly, and make sure we enable and update both master and slave in the correct order.
v2:
* Manual rebase (Manasi)v3:
* Rebase (Manasi)v4:
* Rebase (Manasi)Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/i915/display/icl_dsi.c | 2 - drivers/gpu/drm/i915/display/intel_ddi.c | 68 +++- drivers/gpu/drm/i915/display/intel_display.c | 377 ++++++++++++------ .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 6 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 199 ++++----- drivers/gpu/drm/i915/display/intel_vdsc.h | 7 +- 7 files changed, 414 insertions(+), 246 deletions(-)drivers/gpu/drm/i915/display/icl_dsi.c +0
-2@@ -1454,8 +1454,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -intel_dsc_get_config (encoder, pipe_config); -/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =intel_dpll_get_freq (i915, pipe_config->shared_dpll);drivers/gpu/drm/i915/display/intel_ddi.c +51
-17@@ -28,6 +28,7 @@#include <drm/drm_scdc_helper.h> #include "i915_drv.h" +#include "i915_trace.h" #include "intel_audio.h" #include "intel_combo_phy.h" #include "intel_connector.h" @@ -2040,12 +2041,6 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,intel_display_power_get (dev_priv,intel_ddi_main_link_aux_domain (dig_port)); -/* -* VDSC power is needed when DSC is enabled -*/ -if (crtc_state->dsc.compression_enable) -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state)); } void intel_ddi_enable_pipe_clock(struct intel_encoder *encoder,@@ -3313,7 +3308,8 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,/* 7.l Configure and enable FEC if needed */ intel_ddi_enable_fec (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3384,7 +3380,8 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state,if (!is_mst)intel_ddi_enable_pipe_clock (encoder, crtc_state); -intel_dsc_enable (encoder, crtc_state); +if (!crtc_state->bigjoiner) +intel_dsc_enable (encoder, crtc_state); } static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state,@@ -3639,6 +3636,21 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state,ilk_pfit_disable (old_crtc_state); } +if (old_crtc_state->bigjoiner_linked_crtc) { +struct intel_atomic_state *state = +to_intel_atomic_state (old_crtc_state->uapi.state); +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; +const struct intel_crtc_state *old_slave_crtc_state = +intel_atomic_get_old_crtc_state (state, slave); + +intel_crtc_vblank_off (old_slave_crtc_state); +trace_intel_pipe_disable (slave); + +intel_dsc_disable (old_slave_crtc_state); +skl_scaler_disable (old_slave_crtc_state); + } +/* * When called from DP MST code: * - old_conn_state will be NULL @@ -3853,7 +3865,8 @@ static void intel_enable_ddi(struct intel_atomic_state *state, {drm_WARN_ON (state->base.dev, crtc_state->has_pch_encoder); -intel_ddi_enable_transcoder_func (encoder, crtc_state); +if (!crtc_state->bigjoiner_slave) +intel_ddi_enable_transcoder_func (encoder, crtc_state);intel_enable_pipe (crtc_state);@@ -4200,8 +4213,8 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) crtc_state->sync_mode_slaves_mask); } -void intel_ddi_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +static void intel_ddi_read_func_ctl (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->uapi.crtc);@@ -4209,13 +4222,10 @@ void intel_ddi_get_config(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (encoder);u32 temp, flags =0 ; -/* XXX: DSI transcoder paranoia */ -if (drm_WARN_ON (&dev_priv->drm,transcoder_is_dsi (cpu_transcoder))) + temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(temp &TRANS_DDI_FUNC_ENABLE ))return ; -intel_dsc_get_config (encoder, pipe_config); - - temp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder));if (temp &TRANS_DDI_PHSYNC ) flags |=DRM_MODE_FLAG_PHSYNC ;else @@ -4323,6 +4333,29 @@ void intel_ddi_get_config(struct intel_encoder *encoder, intel_dp->regs.dp_tp_ctl =TGL_DP_TP_CTL (transcoder); intel_dp->regs.dp_tp_status =TGL_DP_TP_STATUS (transcoder); } +} + +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); +enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; + +/* XXX: DSI transcoder paranoia */ +if (WARN_ON (transcoder_is_dsi (cpu_transcoder))) +return ; + +intel_ddi_read_func_ctl (encoder, pipe_config); +if (pipe_config->bigjoiner_slave) { +/* read out pipe settings from master */ +enum transcoder save = pipe_config->cpu_transcoder; + +/* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */ +WARN_ON (pipe_config->output_types); + pipe_config->cpu_transcoder = (enum transcoder )pipe_config->bigjoiner_linked_crtc->pipe; +intel_ddi_read_func_ctl (encoder, pipe_config); + pipe_config->cpu_transcoder = save; + } pipe_config->has_audio =intel_ddi_is_audio_enabled (dev_priv, cpu_transcoder);@@ -4348,7 +4381,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp; } -intel_ddi_clock_get (encoder, pipe_config); +if (!pipe_config->bigjoiner_slave) +intel_ddi_clock_get (encoder, pipe_config);if (IS_GEN9_LP (dev_priv)) pipe_config->lane_lat_optim_mask =drivers/gpu/drm/i915/display/intel_display.c +255
-122@@ -7023,6 +7023,45 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state)intel_de_write (dev_priv, reg, val); } +static void tgl_ddi_bigjoiner_pre_enable (struct intel_atomic_state *state, +const struct intel_crtc_state *crtc_state) +{ +struct intel_crtc *master =to_intel_crtc (crtc_state->uapi.crtc); +struct intel_crtc_state *master_crtc_state; +struct drm_connector_state *conn_state; +struct drm_connector *conn; +struct intel_encoder *encoder =NULL ; +int i; + +if (crtc_state->bigjoiner_slave) + master = crtc_state->bigjoiner_linked_crtc; + + master_crtc_state =intel_atomic_get_new_crtc_state (state, master); + +for_each_new_connector_in_state (&state->base, conn, conn_state, i) { +if (conn_state->crtc != &master->base) +continue ; + + encoder =to_intel_encoder (conn_state->best_encoder); +break ; + } + +if (!crtc_state->bigjoiner_slave) { +/* need to enable VDSC, which we skipped in pre-enable */ +intel_dsc_enable (encoder, crtc_state); + }else { +/* +* Enable sequence steps 1-7 on bigjoiner master +*/ +intel_encoders_pre_pll_enable (state, master); +intel_enable_shared_dpll (master_crtc_state); +intel_encoders_pre_enable (state, master); + +/* and DSC on slave */ +intel_dsc_enable (NULL , crtc_state); + } +} +static void hsw_crtc_enable (struct intel_atomic_state *state,struct intel_crtc *crtc) {@@ -7036,34 +7075,39 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (drm_WARN_ON (&dev_priv->drm, crtc->active))return ; -intel_encoders_pre_pll_enable (state, crtc); - -if (new_crtc_state->shared_dpll) -intel_enable_shared_dpll (new_crtc_state); +if (!new_crtc_state->bigjoiner) { +intel_encoders_pre_pll_enable (state, crtc); -intel_encoders_pre_enable (state, crtc); +if (new_crtc_state->shared_dpll) +intel_enable_shared_dpll (new_crtc_state); -if (!transcoder_is_dsi (cpu_transcoder)) -intel_set_transcoder_timings (new_crtc_state); +intel_encoders_pre_enable (state, crtc); + }else { +tgl_ddi_bigjoiner_pre_enable (state, new_crtc_state); + }intel_set_pipe_src_size (new_crtc_state); +if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) +bdw_set_pipemisc (new_crtc_state); -if (cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (cpu_transcoder)) -intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), - new_crtc_state->pixel_multiplier -1 ); +if (!new_crtc_state->bigjoiner_slave && !transcoder_is_dsi (cpu_transcoder)) { +if (!transcoder_is_dsi (cpu_transcoder)) +intel_set_transcoder_timings (new_crtc_state); -if (new_crtc_state->has_pch_encoder) -intel_cpu_transcoder_set_m_n (new_crtc_state, - &new_crtc_state->fdi_m_n,NULL ); +if (cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (cpu_transcoder)) +intel_de_write (dev_priv,PIPE_MULT (cpu_transcoder), + new_crtc_state->pixel_multiplier -1 ); + +if (new_crtc_state->has_pch_encoder) +intel_cpu_transcoder_set_m_n (new_crtc_state, + &new_crtc_state->fdi_m_n,NULL ); -if (!transcoder_is_dsi (cpu_transcoder)) {hsw_set_frame_start_delay (new_crtc_state); -hsw_set_pipeconf (new_crtc_state); } -if (INTEL_GEN (dev_priv) >=9 ||IS_BROADWELL (dev_priv)) -bdw_set_pipemisc (new_crtc_state); +if (!transcoder_is_dsi (cpu_transcoder)) +hsw_set_pipeconf (new_crtc_state); crtc->active = true;@@ -7099,6 +7143,11 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (crtc); +if (new_crtc_state->bigjoiner_slave) { +trace_intel_pipe_enable (crtc); +intel_crtc_vblank_on (new_crtc_state); + } +intel_encoders_enable (state, crtc);if (psl_clkgate_wa) {@@ -7381,6 +7430,9 @@ static u64 get_crtc_power_domains(struct intel_crtc_state *crtc_state)if (crtc_state->shared_dpll) mask |=BIT_ULL (POWER_DOMAIN_DISPLAY_CORE ); +if (crtc_state->dsc.compression_enable) + mask |=BIT_ULL (intel_dsc_power_domain (crtc_state)); +return mask; }@@ -7999,6 +8051,30 @@ static u32 ilk_pipe_pixel_rate(const struct intel_crtc_state *crtc_state) pfit_w * pfit_h); } +static void intel_encoder_get_config (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state) +{ +struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode; + + encoder->get_config (encoder, crtc_state); + + *pipe_mode = crtc_state->hw.adjusted_mode; +if (crtc_state->bigjoiner) { +/* +* transcoder is programmed to the full mode, +* but pipe timings are half of the transcoder mode +*/ + pipe_mode->crtc_hdisplay /=2 ; + pipe_mode->crtc_hblank_start /=2 ; + pipe_mode->crtc_hblank_end /=2 ; + pipe_mode->crtc_hsync_start /=2 ; + pipe_mode->crtc_hsync_end /=2 ; + pipe_mode->crtc_htotal /=2 ; + pipe_mode->crtc_hskew /=2 ; + pipe_mode->crtc_clock /=2 ; + } +} +static void intel_crtc_compute_pixel_rate (struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);@@ -8910,20 +8986,22 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,void intel_mode_from_pipe_config (struct drm_display_mode *mode,struct intel_crtc_state *pipe_config) { - mode->hdisplay = pipe_config->hw.adjusted_mode.crtc_hdisplay; - mode->htotal = pipe_config->hw.adjusted_mode.crtc_htotal; - mode->hsync_start = pipe_config->hw.adjusted_mode.crtc_hsync_start; - mode->hsync_end = pipe_config->hw.adjusted_mode.crtc_hsync_end; +struct drm_display_mode *hw_mode = &pipe_config->hw.adjusted_mode; - mode->vdisplay = pipe_config->hw.adjusted_mode.crtc_vdisplay; - mode->vtotal = pipe_config->hw.adjusted_mode.crtc_vtotal; - mode->vsync_start = pipe_config->hw.adjusted_mode.crtc_vsync_start; - mode->vsync_end = pipe_config->hw.adjusted_mode.crtc_vsync_end; + mode->hdisplay = hw_mode->crtc_hdisplay; + mode->htotal = hw_mode->crtc_htotal; + mode->hsync_start = hw_mode->crtc_hsync_start; + mode->hsync_end = hw_mode->crtc_hsync_end; - mode->flags = pipe_config->hw.adjusted_mode.flags; + mode->vdisplay = hw_mode->crtc_vdisplay; + mode->vtotal = hw_mode->crtc_vtotal; + mode->vsync_start = hw_mode->crtc_vsync_start; + mode->vsync_end = hw_mode->crtc_vsync_end; + + mode->flags = hw_mode->flags; mode->type =DRM_MODE_TYPE_DRIVER ; - mode->clock = pipe_config->hw.adjusted_mode.crtc_clock; + mode->clock = hw_mode->crtc_clock;drm_mode_set_name (mode); }@@ -11081,6 +11159,9 @@ static void hsw_get_ddi_port_state(struct intel_crtc *crtc, }else { tmp =intel_de_read (dev_priv,TRANS_DDI_FUNC_CTL (cpu_transcoder)); +if (!(tmp &TRANS_DDI_FUNC_ENABLE )) +return ; +if (INTEL_GEN (dev_priv) >=12 ) port =TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT (tmp);else @@ -11153,12 +11234,20 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,drm_WARN_ON (&dev_priv->drm, active); active = true; } +intel_dsc_get_config (pipe_config); -if (!active) - goto out; +if (!active) { +/* bigjoiner slave doesn't enable transcoder */ +if (!pipe_config->bigjoiner_slave) + goto out; -if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || -INTEL_GEN (dev_priv) >=11 ) { + active = true; + pipe_config->pixel_multiplier =1 ; + +/* we cannot read out most state, so don't bother.. */ + pipe_config->quirks |=PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE ; + }else if (!transcoder_is_dsi (pipe_config->cpu_transcoder) || +INTEL_GEN (dev_priv) >=11 ) {hsw_get_ddi_port_state (crtc, pipe_config);intel_get_transcoder_timings (crtc, pipe_config); }@@ -11244,8 +11333,11 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc, } } -if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && - !transcoder_is_dsi (pipe_config->cpu_transcoder)) { +if (pipe_config->bigjoiner_slave) { +/* Cannot be read out as a slave, set to 0. */ + pipe_config->pixel_multiplier =0 ; + }else if (pipe_config->cpu_transcoder !=TRANSCODER_EDP && + !transcoder_is_dsi (pipe_config->cpu_transcoder)) { pipe_config->pixel_multiplier =intel_de_read (dev_priv,PIPE_MULT (pipe_config->cpu_transcoder)) +1 ;@@ -12260,7 +12352,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)return NULL ; } - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state);intel_mode_from_pipe_config (mode, crtc_state);@@ -13252,10 +13344,12 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_atomic_state *state,static void intel_crtc_copy_hw_to_uapi_state (struct intel_crtc_state *crtc_state,struct drm_display_mode *user_mode) { - crtc_state->uapi.enable = crtc_state->hw.enable; - crtc_state->uapi.active = crtc_state->hw.active; -drm_WARN_ON (crtc_state->uapi.crtc->dev, -drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); +if (!crtc_state->bigjoiner_slave) { + crtc_state->uapi.enable = crtc_state->hw.enable; + crtc_state->uapi.active = crtc_state->hw.active; +drm_WARN_ON (crtc_state->uapi.crtc->dev, +drm_atomic_set_mode_for_crtc (&crtc_state->uapi, user_mode) <0 ); + } crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;@@ -13902,21 +13996,42 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (output_types); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); - -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); -PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); - -PIPE_CONF_CHECK_I (pixel_multiplier); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +/* bigjoiner mode = transcoder mode / 2, for calculations */ +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.pipe_mode.crtc_vtotal); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_htotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_hsync_end); + +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vdisplay); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vtotal); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vblank_end); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_start); +PIPE_CONF_CHECK_I (hw.adjusted_mode.crtc_vsync_end); + +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_INTERLACE ); + +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NHSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_PVSYNC ); +PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, +DRM_MODE_FLAG_NVSYNC ); + } +PIPE_CONF_CHECK_I (pixel_multiplier); + }PIPE_CONF_CHECK_I (output_format);PIPE_CONF_CHECK_BOOL (has_hdmi_sink); if ((INTEL_GEN(dev_priv) < 8 && !IS_HASWELL(dev_priv)) ||@@ -13926,24 +14041,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (hdmi_scrambling);PIPE_CONF_CHECK_BOOL (hdmi_high_tmds_clock_ratio);PIPE_CONF_CHECK_BOOL (has_infoframe); -PIPE_CONF_CHECK_BOOL (fec_enable); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_BOOL (fec_enable);PIPE_CONF_CHECK_BOOL_INCOMPLETE (has_audio); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_INTERLACE ); - -if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS )) { -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NHSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_PVSYNC ); -PIPE_CONF_CHECK_FLAGS (hw.adjusted_mode.flags, -DRM_MODE_FLAG_NVSYNC ); - } -PIPE_CONF_CHECK_X (gmch_pfit.control);/* pfit ratios are autocomputed by the hw on gen4+ */ if (INTEL_GEN (dev_priv) <4 )@@ -13969,7 +14071,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, }PIPE_CONF_CHECK_I (scaler_state.scaler_id); -PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) +PIPE_CONF_CHECK_CLOCK_FUZZY (pixel_rate);PIPE_CONF_CHECK_X (gamma_mode);if (IS_CHERRYVIEW (dev_priv))@@ -13990,48 +14093,51 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_BOOL (double_wide);PIPE_CONF_CHECK_P (shared_dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll); -PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); -PIPE_CONF_CHECK_X (dpll_hw_state.fp0); -PIPE_CONF_CHECK_X (dpll_hw_state.fp1); -PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); -PIPE_CONF_CHECK_X (dpll_hw_state.spll); -PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); -PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); -PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); -PIPE_CONF_CHECK_X (dpll_hw_state.pll0); -PIPE_CONF_CHECK_X (dpll_hw_state.pll1); -PIPE_CONF_CHECK_X (dpll_hw_state.pll2); -PIPE_CONF_CHECK_X (dpll_hw_state.pll3); -PIPE_CONF_CHECK_X (dpll_hw_state.pll6); -PIPE_CONF_CHECK_X (dpll_hw_state.pll8); -PIPE_CONF_CHECK_X (dpll_hw_state.pll9); -PIPE_CONF_CHECK_X (dpll_hw_state.pll10); -PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); -PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); - -PIPE_CONF_CHECK_X (dsi_pll.ctrl); -PIPE_CONF_CHECK_X (dsi_pll.div); - -if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) -PIPE_CONF_CHECK_I (pipe_bpp); - -PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); -PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); - -PIPE_CONF_CHECK_I (min_voltage_level); +if (!PIPE_CONF_QUIRK (PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE )) { +PIPE_CONF_CHECK_X (dpll_hw_state.dpll); +PIPE_CONF_CHECK_X (dpll_hw_state.dpll_md); +PIPE_CONF_CHECK_X (dpll_hw_state.fp0); +PIPE_CONF_CHECK_X (dpll_hw_state.fp1); +PIPE_CONF_CHECK_X (dpll_hw_state.wrpll); +PIPE_CONF_CHECK_X (dpll_hw_state.spll); +PIPE_CONF_CHECK_X (dpll_hw_state.ctrl1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr1); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr2); +PIPE_CONF_CHECK_X (dpll_hw_state.cfgcr0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb0); +PIPE_CONF_CHECK_X (dpll_hw_state.ebb4); +PIPE_CONF_CHECK_X (dpll_hw_state.pll0); +PIPE_CONF_CHECK_X (dpll_hw_state.pll1); +PIPE_CONF_CHECK_X (dpll_hw_state.pll2); +PIPE_CONF_CHECK_X (dpll_hw_state.pll3); +PIPE_CONF_CHECK_X (dpll_hw_state.pll6); +PIPE_CONF_CHECK_X (dpll_hw_state.pll8); +PIPE_CONF_CHECK_X (dpll_hw_state.pll9); +PIPE_CONF_CHECK_X (dpll_hw_state.pll10); +PIPE_CONF_CHECK_X (dpll_hw_state.pcsdw12); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_refclkin_ctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_coreclkctl1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_clktop2_hsclkctl); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div0); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_div1); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_lf); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_frac_lock); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_ssc); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_bias); +PIPE_CONF_CHECK_X (dpll_hw_state.mg_pll_tdc_coldst_bias); + +PIPE_CONF_CHECK_X (dsi_pll.ctrl); +PIPE_CONF_CHECK_X (dsi_pll.div); + +if (IS_G4X (dev_priv) ||INTEL_GEN (dev_priv) >=5 ) +PIPE_CONF_CHECK_I (pipe_bpp); + +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.adjusted_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (hw.pipe_mode.crtc_clock); +PIPE_CONF_CHECK_CLOCK_FUZZY (port_clock); + +PIPE_CONF_CHECK_I (min_voltage_level); + }PIPE_CONF_CHECK_X (infoframes.enable);PIPE_CONF_CHECK_X (infoframes.gcp);@@ -14043,11 +14149,12 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,PIPE_CONF_CHECK_X (sync_mode_slaves_mask);PIPE_CONF_CHECK_I (master_transcoder); - +PIPE_CONF_CHECK_BOOL (bigjoiner); +PIPE_CONF_CHECK_BOOL (bigjoiner_slave); +PIPE_CONF_CHECK_P (bigjoiner_linked_crtc);PIPE_CONF_CHECK_I (dsc.compression_enable);PIPE_CONF_CHECK_I (dsc.dsc_split);PIPE_CONF_CHECK_I (dsc.compressed_bpp); -PIPE_CONF_CHECK_I (mst_master_transcoder);#undef PIPE_CONF_CHECK_X@@ -14314,6 +14421,7 @@ verify_crtc_state(struct intel_crtc *crtc,struct intel_encoder *encoder;struct intel_crtc_state *pipe_config = old_crtc_state;struct drm_atomic_state *state = old_crtc_state->uapi.state; +struct intel_crtc *master = crtc;bool active;__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->uapi);@@ -14340,7 +14448,10 @@ verify_crtc_state(struct intel_crtc *crtc,"(expected %i, found %i)\n" , new_crtc_state->hw.active, crtc->active); -for_each_encoder_on_crtc (dev, &crtc->base, encoder) { +if (new_crtc_state->bigjoiner_slave) + master = new_crtc_state->bigjoiner_linked_crtc; + +for_each_encoder_on_crtc (dev, &master->base, encoder) {enum pipe pipe; active = encoder->get_hw_state (encoder, &pipe);@@ -14349,12 +14460,12 @@ verify_crtc_state(struct intel_crtc *crtc, encoder->base.base.id, active, new_crtc_state->hw.active); -I915_STATE_WARN (active && crtc->pipe != pipe, +I915_STATE_WARN (active && master->pipe != pipe,"Encoder connected to wrong pipe %c\n" ,pipe_name (pipe));if (active) - encoder->get_config (encoder, pipe_config); +intel_encoder_get_config (encoder, pipe_config); }intel_crtc_compute_pixel_rate (pipe_config);@@ -15376,7 +15487,12 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state, {struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +drm_WARN_ON (&dev_priv->drm, old_crtc_state->bigjoiner_slave); +intel_crtc_disable_planes (state, crtc); +if (old_crtc_state->bigjoiner) +intel_crtc_disable_planes (state, + old_crtc_state->bigjoiner_linked_crtc);/* * We need to disable pipe CRC before disabling the pipe, @@ -15406,7 +15522,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)/* Only disable port sync and MST slaves */ for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (new_crtc_state)) +if (!needs_modeset (new_crtc_state) || old_crtc_state->bigjoiner_slave)continue ;if (!old_crtc_state->hw.active)@@ -15421,7 +15537,6 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) !intel_dp_mst_is_slave_trans(old_crtc_state)) continue; -intel_pre_plane_update (state, crtc);intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc); handled |=BIT (crtc->pipe);@@ -15431,10 +15546,18 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {if (!needs_modeset (new_crtc_state) || - (handled &BIT (crtc->pipe))) + (handled &BIT (crtc->pipe)) || + old_crtc_state->bigjoiner_slave)continue ;intel_pre_plane_update (state, crtc); +if (old_crtc_state->bigjoiner) { +struct intel_crtc *slave = + old_crtc_state->bigjoiner_linked_crtc; + +intel_pre_plane_update (state, slave); + } +if (old_crtc_state->hw.active)intel_old_crtc_state_disables (state, old_crtc_state, new_crtc_state, crtc);@@ -18063,7 +18186,7 @@ int intel_modeset_init(struct drm_i915_private *i915)for_each_intel_crtc (dev, crtc) {struct intel_initial_plane_config plane_config = {}; -if (!crtc->active) +if (!to_intel_crtc_state (crtc->base.state)->uapi.active)continue ;/* @@ -18562,7 +18685,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc_state =to_intel_crtc_state (crtc->base.state); encoder->base.crtc = &crtc->base; - encoder->get_config (encoder, crtc_state); +intel_encoder_get_config (encoder, crtc_state); + +/* read out to slave crtc as well for bigjoiner */ +if (crtc_state->bigjoiner) { +/* encoder should read be linked to bigjoiner master */ +WARN_ON (crtc_state->bigjoiner_slave); + + crtc = crtc_state->bigjoiner_linked_crtc; + crtc_state =to_intel_crtc_state (crtc->base.state); +intel_encoder_get_config (encoder, crtc_state); + } }else { encoder->base.crtc =NULL ; }drivers/gpu/drm/i915/display/intel_display_types.h +1
-0@@ -826,6 +826,7 @@ struct intel_crtc_state {* accordingly. */ #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0)/* unreliable sync mode.flags */ +#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1)/* bigjoiner slave, partial readout */ unsigned long quirks;unsigned fb_bits;/* framebuffers to flip */ drivers/gpu/drm/i915/display/intel_dp.c +2
-4@@ -2004,12 +2004,10 @@ static bool intel_dp_supports_fec(struct intel_dp *intel_dp,static bool intel_dp_supports_dsc (struct intel_dp *intel_dp,const struct intel_crtc_state *crtc_state) { -struct intel_encoder *encoder = &dp_to_dig_port (intel_dp)->base; - -if (!intel_dp_is_edp (intel_dp) && !crtc_state->fec_enable) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DP ) && !crtc_state->fec_enable)return false; -return intel_dsc_source_support (encoder, crtc_state) && +return intel_dsc_source_support (crtc_state) &&drm_dp_sink_supports_dsc (intel_dp->dsc_dpcd); }drivers/gpu/drm/i915/display/intel_vdsc.c +27
-58@@ -332,11 +332,10 @@ static const struct rc_parameters *get_rc_params(u16 compressed_bpp,return &rc_parameters[row_index][column_index]; } -bool intel_dsc_source_support (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +bool intel_dsc_source_support (const struct intel_crtc_state *crtc_state) {const struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +struct drm_i915_private *i915 =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;enum pipe pipe = crtc->pipe;@@ -490,11 +489,10 @@ intel_dsc_power_domain(const struct intel_crtc_state *crtc_state)return POWER_DOMAIN_TRANSCODER_VDSC_PW2 ; } -static void intel_dsc_pps_configure (struct intel_encoder *encoder, -const struct intel_crtc_state *crtc_state) +static void intel_dsc_pps_configure (const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;enum pipe pipe = crtc->pipe;u32 pps_val =0 ;@@ -503,6 +501,9 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder,u8 num_vdsc_instances = (crtc_state->dsc.dsc_split) ?2 :1 ;int i =0 ; +if (crtc_state->bigjoiner) + num_vdsc_instances *=2 ; +/* Populate PICTURE_PARAMETER_SET_0 registers */ pps_val =DSC_VER_MAJ | vdsc_cfg->dsc_version_minor << DSC_VER_MIN_SHIFT |@@ -973,55 +974,6 @@ static void intel_dsc_pps_configure(struct intel_encoder *encoder, } } -void intel_dsc_get_config (struct intel_encoder *encoder, -struct intel_crtc_state *crtc_state) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -enum pipe pipe = crtc->pipe; -enum intel_display_power_domain power_domain; -intel_wakeref_t wakeref; -u32 dss_ctl1, dss_ctl2, val; - -if (!intel_dsc_source_support (encoder, crtc_state)) -return ; - - power_domain =intel_dsc_power_domain (crtc_state); - - wakeref =intel_display_power_get_if_enabled (dev_priv, power_domain); -if (!wakeref) -return ; - -if (!is_pipe_dsc (crtc_state)) { - dss_ctl1 =intel_de_read (dev_priv,DSS_CTL1 ); - dss_ctl2 =intel_de_read (dev_priv,DSS_CTL2 ); - }else { - dss_ctl1 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL1 (pipe)); - dss_ctl2 =intel_de_read (dev_priv,ICL_PIPE_DSS_CTL2 (pipe)); - } - - crtc_state->dsc.compression_enable = dss_ctl2 &LEFT_BRANCH_VDSC_ENABLE ; -if (!crtc_state->dsc.compression_enable) - goto out; - - crtc_state->dsc.dsc_split = (dss_ctl2 &RIGHT_BRANCH_VDSC_ENABLE ) && - (dss_ctl1 &JOINER_ENABLE ); - -/* FIXME: add more state readout as needed */ - -/* PPS1 */ -if (!is_pipe_dsc (crtc_state)) - val =intel_de_read (dev_priv,DSCA_PICTURE_PARAMETER_SET_1 ); -else - val =intel_de_read (dev_priv, -ICL_DSC0_PICTURE_PARAMETER_SET_1 (pipe)); - vdsc_cfg->bits_per_pixel = val; - crtc_state->dsc.compressed_bpp = vdsc_cfg->bits_per_pixel >>4 ; -out: -intel_display_power_put (dev_priv, power_domain, wakeref); -} -static void intel_dsc_dsi_pps_write (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {@@ -1060,77 +1012,130 @@ static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, sizeof(dp_dsc_pps_sdp)); } +static i915_reg_t dss_ctl1_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL1 ; + +return ICL_PIPE_DSS_CTL1 (pipe); +} + +static i915_reg_t dss_ctl2_reg (const struct intel_crtc_state *crtc_state) +{ +enum pipe pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe; + +if (crtc_state->cpu_transcoder ==TRANSCODER_EDP ) +return DSS_CTL2 ; + +return ICL_PIPE_DSS_CTL2 (pipe); +} +void intel_dsc_enable (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state) {struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -enum pipe pipe = crtc->pipe; -i915_reg_t dss_ctl1_reg, dss_ctl2_reg;drivers/gpu/drm/i915/display/intel_vdsc.c static void intel_dsc_dp_pps_write(struct intel_encoder *encoder, · line 1078
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_vdsc.c +1
-3+struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);u32 dss_ctl1_val =0 ;u32 dss_ctl2_val =0 ;if (!crtc_state->dsc.compression_enable)return ; -/* Enable Power wells for VDSC/joining */ -intel_display_power_get (dev_priv, -intel_dsc_power_domain (crtc_state));Why do we remove the power get for
dsc_power_domainshere? IMO this is causing the CI error since indsc_disableswe do try to put thedsc_power_domainsbut we error out saying on dsc disable:
Quoted 8 lines
Quoted 3 lines
"Use count on VDSC POWER DOMAIN already 0"
we need to get power domains here since for Pipe A/eDP on TGL, we do need a separate PW2 for VDSC.
It's the other way around, we need to remove it from
dsc_disable.
get_crtc_power_domains()ensures we always have the dsc power domain correct, even when reading out from the original hw state. It had to be decoupled from the encoder as the slave pipe doesn't have an encoder, and we still want the DSC power domain in that case. :)
Yes, I tried putting this power get call in intel_dsc_enable since I had put it originally while enabling DSC. But that didnt fix it, so yes may be removing the put call from dsc_disable makes sense.
I will change that and resend the patches. Lets hope that fixes this CI error.
Manasi
Quoted 1 line
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx