Lines Matching full:tunnel
23 * intel_dp_tunnel_disconnect - Disconnect a DP tunnel from a port
24 * @intel_dp: DP port object the tunnel is connected to
26 * Disconnect a DP tunnel from @intel_dp, destroying any related state. This
31 drm_dp_tunnel_destroy(intel_dp->tunnel); in intel_dp_tunnel_disconnect()
32 intel_dp->tunnel = NULL; in intel_dp_tunnel_disconnect()
36 * intel_dp_tunnel_destroy - Destroy a DP tunnel
37 * @intel_dp: DP port object the tunnel is connected to
39 * Destroy a DP tunnel connected to @intel_dp, after disabling the BW
40 * allocation mode on the tunnel. This should be called while destroying the
46 drm_dp_tunnel_disable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_destroy()
81 ret = drm_dp_tunnel_update_state(intel_dp->tunnel); in update_tunnel_state()
85 drm_dp_tunnel_name(intel_dp->tunnel), in update_tunnel_state()
93 !drm_dp_tunnel_bw_alloc_is_enabled(intel_dp->tunnel)) in update_tunnel_state()
107 drm_dp_tunnel_name(intel_dp->tunnel), in update_tunnel_state()
115 * Allocate the BW for a tunnel on a DP connector/port if the connector/port
116 * was already active when detecting the tunnel. The allocated BW must be
138 drm_dp_tunnel_name(intel_dp->tunnel), in allocate_initial_tunnel_bw_for_pipes()
145 err = drm_dp_tunnel_alloc_bw(intel_dp->tunnel, tunnel_bw); in allocate_initial_tunnel_bw_for_pipes()
149 drm_dp_tunnel_name(intel_dp->tunnel), in allocate_initial_tunnel_bw_for_pipes()
176 struct drm_dp_tunnel *tunnel; in detect_new_tunnel() local
179 tunnel = drm_dp_tunnel_detect(display->dp_tunnel_mgr, in detect_new_tunnel()
181 if (IS_ERR(tunnel)) in detect_new_tunnel()
182 return PTR_ERR(tunnel); in detect_new_tunnel()
184 intel_dp->tunnel = tunnel; in detect_new_tunnel()
186 ret = drm_dp_tunnel_enable_bw_alloc(intel_dp->tunnel); in detect_new_tunnel()
193 drm_dp_tunnel_name(intel_dp->tunnel), in detect_new_tunnel()
197 /* Keep the tunnel with BWA disabled */ in detect_new_tunnel()
209 * intel_dp_tunnel_detect - Detect a DP tunnel on a port
213 * Detect a DP tunnel on the @intel_dp port, enabling the BW allocation mode
218 * If @intel_dp has already a tunnel detected on it, update the tunnel's state
220 * tunnel. If the tunnel's state change requires this - for instance the
221 * tunnel's group ID has changed - the tunnel will be dropped and recreated.
223 * Return 0 in case of success - after any tunnel detected and added to
224 * @intel_dp - 1 in case the BW on an already existing tunnel has changed in a
234 if (intel_dp->tunnel) { in intel_dp_tunnel_detect()
239 /* Try to recreate the tunnel after an update error. */ in intel_dp_tunnel_detect()
247 * intel_dp_tunnel_bw_alloc_is_enabled - Query the BW allocation support on a tunnel
250 * Query whether a DP tunnel is connected on @intel_dp and the tunnel supports
257 return drm_dp_tunnel_bw_alloc_is_enabled(intel_dp->tunnel); in intel_dp_tunnel_bw_alloc_is_enabled()
261 * intel_dp_tunnel_suspend - Suspend a DP tunnel connected on a port
264 * Suspend a DP tunnel on @intel_dp with BW allocation mode enabled on it.
277 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_suspend()
281 drm_dp_tunnel_disable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_suspend()
287 * intel_dp_tunnel_resume - Resume a DP tunnel connected on a port
292 * Resume a DP tunnel on @intel_dp with BW allocation mode enabled on it.
312 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_resume()
327 drm_dp_tunnel_set_io_error(intel_dp->tunnel); in intel_dp_tunnel_resume()
332 err = drm_dp_tunnel_enable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_resume()
352 …"[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s] Tunnel can't be resumed, will drop and reject it (err … in intel_dp_tunnel_resume()
353 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_resume()
365 return state->inherited_dp_tunnels->ref[crtc->pipe].tunnel; in get_inherited_tunnel()
370 struct drm_dp_tunnel *tunnel, in add_inherited_tunnel() argument
378 drm_WARN_ON(display->drm, old_tunnel != tunnel); in add_inherited_tunnel()
389 drm_dp_tunnel_ref_get(tunnel, &state->inherited_dp_tunnels->ref[crtc->pipe]); in add_inherited_tunnel()
406 * If a BWA tunnel gets detected only after the corresponding in check_inherited_tunnel_state()
407 * connector got enabled already without a BWA tunnel, or a different in check_inherited_tunnel_state()
408 * BWA tunnel (which was removed meanwhile) the old CRTC state won't in check_inherited_tunnel_state()
409 * contain the state of the current tunnel. This tunnel still has a in check_inherited_tunnel_state()
423 old_crtc_state->dp_tunnel_ref.tunnel == intel_dp->tunnel) in check_inherited_tunnel_state()
427 … "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s][CRTC:%d:%s] Adding state for inherited tunnel %p\n", in check_inherited_tunnel_state()
428 drm_dp_tunnel_name(intel_dp->tunnel), in check_inherited_tunnel_state()
432 intel_dp->tunnel); in check_inherited_tunnel_state()
434 return add_inherited_tunnel(state, intel_dp->tunnel, old_crtc); in check_inherited_tunnel_state()
438 * intel_dp_tunnel_atomic_cleanup_inherited_state - Free any inherited DP tunnel state
441 * Free the inherited DP tunnel state in @state.
452 if (state->inherited_dp_tunnels->ref[pipe].tunnel) in intel_dp_tunnel_atomic_cleanup_inherited_state()
460 struct drm_dp_tunnel *tunnel) in intel_dp_tunnel_atomic_add_group_state() argument
467 tunnel, &pipe_mask); in intel_dp_tunnel_atomic_add_group_state()
477 * intel_dp_tunnel_atomic_add_state_for_crtc - Add CRTC specific DP tunnel state
479 * @crtc: CRTC to add the tunnel state for
481 * Add the DP tunnel state for @crtc if the CRTC (aka DP tunnel stream) is enabled
482 * via a DP tunnel.
492 struct drm_dp_tunnel *tunnel = new_crtc_state->dp_tunnel_ref.tunnel; in intel_dp_tunnel_atomic_add_state_for_crtc() local
494 if (!tunnel) in intel_dp_tunnel_atomic_add_state_for_crtc()
497 tunnel_state = drm_dp_tunnel_atomic_get_state(&state->base, tunnel); in intel_dp_tunnel_atomic_add_state_for_crtc()
514 if (!crtc_state->dp_tunnel_ref.tunnel) in check_group_state()
518 "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s][CRTC:%d:%s] Adding group state for tunnel %p\n", in check_group_state()
519 drm_dp_tunnel_name(intel_dp->tunnel), in check_group_state()
523 crtc_state->dp_tunnel_ref.tunnel); in check_group_state()
525 return intel_dp_tunnel_atomic_add_group_state(state, crtc_state->dp_tunnel_ref.tunnel); in check_group_state()
529 * intel_dp_tunnel_atomic_check_state - Check a connector's DP tunnel specific state
534 * Check and add the DP tunnel atomic state for @intel_dp/@connector to
535 * @state, if there is a DP tunnel detected on @intel_dp with BW allocation
537 * DP tunnel.
570 * intel_dp_tunnel_atomic_compute_stream_bw - Compute the BW required by a DP tunnel stream
574 * @crtc_state: state of CRTC of the given DP tunnel stream
576 * Compute the required BW of CRTC (aka DP tunnel stream), storing this BW to
577 * the DP tunnel state containing the stream in @state. Before re-calculating a
599 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_atomic_compute_stream_bw()
606 ret = drm_dp_tunnel_atomic_set_stream_bw(&state->base, intel_dp->tunnel, in intel_dp_tunnel_atomic_compute_stream_bw()
611 drm_dp_tunnel_ref_get(intel_dp->tunnel, in intel_dp_tunnel_atomic_compute_stream_bw()
618 * intel_dp_tunnel_atomic_clear_stream_bw - Clear any DP tunnel stream BW requirement
620 * @crtc_state: state of CRTC of the given DP tunnel stream
622 * Clear any DP tunnel stream BW requirement set by
630 if (!crtc_state->dp_tunnel_ref.tunnel) in intel_dp_tunnel_atomic_clear_stream_bw()
634 crtc_state->dp_tunnel_ref.tunnel, in intel_dp_tunnel_atomic_clear_stream_bw()
640 * intel_dp_tunnel_atomic_check_link - Check the DP tunnel atomic state
669 failed_stream_mask, "DP tunnel link BW"); in intel_dp_tunnel_atomic_check_link()
683 struct drm_dp_tunnel *tunnel; in atomic_decrease_bw() local
690 tunnel = get_inherited_tunnel(state, crtc); in atomic_decrease_bw()
691 if (!tunnel) in atomic_decrease_bw()
692 tunnel = old_crtc_state->dp_tunnel_ref.tunnel; in atomic_decrease_bw()
694 if (!tunnel) in atomic_decrease_bw()
697 old_bw = drm_dp_tunnel_get_allocated_bw(tunnel); in atomic_decrease_bw()
699 new_tunnel_state = drm_dp_tunnel_atomic_get_new_state(&state->base, tunnel); in atomic_decrease_bw()
705 drm_dp_tunnel_alloc_bw(tunnel, new_bw); in atomic_decrease_bw()
710 struct drm_dp_tunnel *tunnel, in queue_retry_work() argument
723 drm_dp_tunnel_name(tunnel), in queue_retry_work()
738 struct drm_dp_tunnel *tunnel = crtc_state->dp_tunnel_ref.tunnel; in atomic_increase_bw() local
744 if (!tunnel) in atomic_increase_bw()
747 tunnel_state = drm_dp_tunnel_atomic_get_new_state(&state->base, tunnel); in atomic_increase_bw()
751 if (drm_dp_tunnel_alloc_bw(tunnel, bw) != 0) in atomic_increase_bw()
752 queue_retry_work(state, tunnel, crtc_state); in atomic_increase_bw()
769 * intel_dp_tunnel_mgr_init - Initialize the DP tunnel manager
772 * Initialize the DP tunnel manager. The tunnel manager will support the
804 * intel_dp_tunnel_mgr_cleanup - Clean up the DP tunnel manager state
807 * Clean up the DP tunnel manager state.