Skip to content

Commit a4efae8

Browse files
committed
drm/i915/dp: Compute DP tunnel BW during encoder state computation
Compute the BW required through a DP tunnel on links with such tunnels detected and add the corresponding atomic state during a modeset. v2: - Fix error check of intel_dp_tunnel_compute_stream_bw(). (Ville) - Move intel_dp_tunnel_atomic_cleanup_inherited_state() to this patch. (Ville) - Move intel_dp_tunnel_atomic_clear_stream_bw() to this patch. Reviewed-by: Uma Shankar <uma.shankar@intel.com> (v1) Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240220211841.448846-16-imre.deak@intel.com
1 parent 259e2e0 commit a4efae8

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

drivers/gpu/drm/i915/display/intel_atomic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ void intel_atomic_state_clear(struct drm_atomic_state *s)
352352
/* state->internal not reset on purpose */
353353

354354
state->dpll_set = state->modeset = false;
355+
356+
intel_dp_tunnel_atomic_cleanup_inherited_state(state);
355357
}
356358

357359
struct intel_crtc_state *

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,6 +4541,8 @@ intel_crtc_prepare_cleared_state(struct intel_atomic_state *state,
45414541
/* free the old crtc_state->hw members */
45424542
intel_crtc_free_hw_state(crtc_state);
45434543

4544+
intel_dp_tunnel_atomic_clear_stream_bw(state, crtc_state);
4545+
45444546
/* FIXME: before the switch to atomic started, a new pipe_config was
45454547
* kzalloc'd. Code that depends on any field being zero should be
45464548
* fixed, so that the crtc_state can be safely duplicated. For now,

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
28752875
struct drm_connector_state *conn_state)
28762876
{
28772877
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
2878+
struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
28782879
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
28792880
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
28802881
const struct drm_display_mode *fixed_mode;
@@ -2975,7 +2976,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
29752976
intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
29762977
intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state);
29772978

2978-
return 0;
2979+
return intel_dp_tunnel_atomic_compute_stream_bw(state, intel_dp, connector,
2980+
pipe_config);
29792981
}
29802982

29812983
void intel_dp_set_link_params(struct intel_dp *intel_dp,
@@ -6066,16 +6068,22 @@ static int intel_dp_connector_atomic_check(struct drm_connector *conn,
60666068
return ret;
60676069
}
60686070

6071+
if (!intel_connector_needs_modeset(state, conn))
6072+
return 0;
6073+
6074+
ret = intel_dp_tunnel_atomic_check_state(state,
6075+
intel_dp,
6076+
intel_conn);
6077+
if (ret)
6078+
return ret;
6079+
60696080
/*
60706081
* We don't enable port sync on BDW due to missing w/as and
60716082
* due to not having adjusted the modeset sequence appropriately.
60726083
*/
60736084
if (DISPLAY_VER(dev_priv) < 9)
60746085
return 0;
60756086

6076-
if (!intel_connector_needs_modeset(state, conn))
6077-
return 0;
6078-
60796087
if (conn->has_tile) {
60806088
ret = intel_modeset_tile_group(state, conn->tile_group->id);
60816089
if (ret)

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "intel_dp.h"
4343
#include "intel_dp_hdcp.h"
4444
#include "intel_dp_mst.h"
45+
#include "intel_dp_tunnel.h"
4546
#include "intel_dpio_phy.h"
4647
#include "intel_hdcp.h"
4748
#include "intel_hotplug.h"
@@ -523,6 +524,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
523524
struct drm_connector_state *conn_state)
524525
{
525526
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
527+
struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
526528
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
527529
struct intel_dp *intel_dp = &intel_mst->primary->dp;
528530
const struct intel_connector *connector =
@@ -619,7 +621,8 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
619621

620622
intel_psr_compute_config(intel_dp, pipe_config, conn_state);
621623

622-
return 0;
624+
return intel_dp_tunnel_atomic_compute_stream_bw(state, intel_dp, connector,
625+
pipe_config);
623626
}
624627

625628
/*
@@ -876,6 +879,14 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,
876879
if (ret)
877880
return ret;
878881

882+
if (intel_connector_needs_modeset(state, connector)) {
883+
ret = intel_dp_tunnel_atomic_check_state(state,
884+
intel_connector->mst_port,
885+
intel_connector);
886+
if (ret)
887+
return ret;
888+
}
889+
879890
return drm_dp_atomic_release_time_slots(&state->base,
880891
&intel_connector->mst_port->mst_mgr,
881892
intel_connector->port);

0 commit comments

Comments
 (0)