Skip to content

Commit 39818c0

Browse files
committed
drm/i915/dp: Add DP tunnel atomic state and check BW limit
Add the atomic state during a modeset required to enable the DP tunnel BW allocation mode on links where such a tunnel was detected. This state applies to an already enabled output, the state added for a newly enabled output will be computed and added/cleared to/from the atomic state in a follow-up patch. v2: - s/old_crtc_state/crtc_state in intel_crtc_duplicate_state(). - Move intel_dp_tunnel_atomic_cleanup_inherited_state() to a follow-up patch adding the corresponding state. (Ville) - Move intel_dp_tunnel_atomic_clear_stream_bw() to a follow-up patch adding the corresponding state. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> 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-14-imre.deak@intel.com
1 parent 91888b5 commit 39818c0

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
260260
if (crtc_state->post_csc_lut)
261261
drm_property_blob_get(crtc_state->post_csc_lut);
262262

263+
if (crtc_state->dp_tunnel_ref.tunnel)
264+
drm_dp_tunnel_ref_get(crtc_state->dp_tunnel_ref.tunnel,
265+
&crtc_state->dp_tunnel_ref);
266+
263267
crtc_state->update_pipe = false;
264268
crtc_state->update_m_n = false;
265269
crtc_state->update_lrr = false;
@@ -311,6 +315,8 @@ intel_crtc_destroy_state(struct drm_crtc *crtc,
311315

312316
__drm_atomic_helper_crtc_destroy_state(&crtc_state->uapi);
313317
intel_crtc_free_hw_state(crtc_state);
318+
if (crtc_state->dp_tunnel_ref.tunnel)
319+
drm_dp_tunnel_ref_put(&crtc_state->dp_tunnel_ref);
314320
kfree(crtc_state);
315321
}
316322

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <linux/string_helpers.h>
3434

3535
#include <drm/display/drm_dp_helper.h>
36+
#include <drm/display/drm_dp_tunnel.h>
3637
#include <drm/drm_atomic.h>
3738
#include <drm/drm_atomic_helper.h>
3839
#include <drm/drm_atomic_uapi.h>
@@ -73,6 +74,7 @@
7374
#include "intel_dp.h"
7475
#include "intel_dp_link_training.h"
7576
#include "intel_dp_mst.h"
77+
#include "intel_dp_tunnel.h"
7678
#include "intel_dpll.h"
7779
#include "intel_dpll_mgr.h"
7880
#include "intel_dpt.h"
@@ -4490,6 +4492,8 @@ copy_bigjoiner_crtc_state_modeset(struct intel_atomic_state *state,
44904492
saved_state->crc_enabled = slave_crtc_state->crc_enabled;
44914493

44924494
intel_crtc_free_hw_state(slave_crtc_state);
4495+
if (slave_crtc_state->dp_tunnel_ref.tunnel)
4496+
drm_dp_tunnel_ref_put(&slave_crtc_state->dp_tunnel_ref);
44934497
memcpy(slave_crtc_state, saved_state, sizeof(*slave_crtc_state));
44944498
kfree(saved_state);
44954499

@@ -4505,6 +4509,10 @@ copy_bigjoiner_crtc_state_modeset(struct intel_atomic_state *state,
45054509
&master_crtc_state->hw.adjusted_mode);
45064510
slave_crtc_state->hw.scaling_filter = master_crtc_state->hw.scaling_filter;
45074511

4512+
if (master_crtc_state->dp_tunnel_ref.tunnel)
4513+
drm_dp_tunnel_ref_get(master_crtc_state->dp_tunnel_ref.tunnel,
4514+
&slave_crtc_state->dp_tunnel_ref);
4515+
45084516
copy_bigjoiner_crtc_state_nomodeset(state, slave_crtc);
45094517

45104518
slave_crtc_state->uapi.mode_changed = master_crtc_state->uapi.mode_changed;
@@ -5366,6 +5374,10 @@ static int intel_modeset_pipe(struct intel_atomic_state *state,
53665374
if (ret)
53675375
return ret;
53685376

5377+
ret = intel_dp_tunnel_atomic_add_state_for_crtc(state, crtc);
5378+
if (ret)
5379+
return ret;
5380+
53695381
ret = intel_dp_mst_add_topology_state_for_crtc(state, crtc);
53705382
if (ret)
53715383
return ret;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "intel_crtc.h"
1010
#include "intel_display_types.h"
1111
#include "intel_dp_mst.h"
12+
#include "intel_dp_tunnel.h"
1213
#include "intel_fdi.h"
1314
#include "intel_link_bw.h"
1415

@@ -163,6 +164,10 @@ static int check_all_link_config(struct intel_atomic_state *state,
163164
if (ret)
164165
return ret;
165166

167+
ret = intel_dp_tunnel_atomic_check_link(state, limits);
168+
if (ret)
169+
return ret;
170+
166171
ret = intel_fdi_atomic_check_link(state, limits);
167172
if (ret)
168173
return ret;

0 commit comments

Comments
 (0)