Lines Matching full:tunnel

24  * intel_dp_tunnel_disconnect - Disconnect a DP tunnel from a port
25 * @intel_dp: DP port object the tunnel is connected to
27 * Disconnect a DP tunnel from @intel_dp, destroying any related state. This
32 drm_dp_tunnel_destroy(intel_dp->tunnel); in intel_dp_tunnel_disconnect()
33 intel_dp->tunnel = NULL; in intel_dp_tunnel_disconnect()
37 * intel_dp_tunnel_destroy - Destroy a DP tunnel
38 * @intel_dp: DP port object the tunnel is connected to
40 * Destroy a DP tunnel connected to @intel_dp, after disabling the BW
41 * allocation mode on the tunnel. This should be called while destroying the
47 drm_dp_tunnel_disable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_destroy()
82 ret = drm_dp_tunnel_update_state(intel_dp->tunnel); in update_tunnel_state()
86 drm_dp_tunnel_name(intel_dp->tunnel), in update_tunnel_state()
94 !drm_dp_tunnel_bw_alloc_is_enabled(intel_dp->tunnel)) in update_tunnel_state()
108 drm_dp_tunnel_name(intel_dp->tunnel), in update_tunnel_state()
116 * Allocate the BW for a tunnel on a DP connector/port if the connector/port
117 * was already active when detecting the tunnel. The allocated BW must be
139 drm_dp_tunnel_name(intel_dp->tunnel), in allocate_initial_tunnel_bw_for_pipes()
146 err = drm_dp_tunnel_alloc_bw(intel_dp->tunnel, tunnel_bw); in allocate_initial_tunnel_bw_for_pipes()
150 drm_dp_tunnel_name(intel_dp->tunnel), in allocate_initial_tunnel_bw_for_pipes()
177 struct drm_dp_tunnel *tunnel; in detect_new_tunnel() local
180 tunnel = drm_dp_tunnel_detect(display->dp_tunnel_mgr, in detect_new_tunnel()
182 if (IS_ERR(tunnel)) in detect_new_tunnel()
183 return PTR_ERR(tunnel); in detect_new_tunnel()
185 intel_dp->tunnel = tunnel; in detect_new_tunnel()
187 ret = drm_dp_tunnel_enable_bw_alloc(intel_dp->tunnel); in detect_new_tunnel()
194 drm_dp_tunnel_name(intel_dp->tunnel), in detect_new_tunnel()
198 /* Keep the tunnel with BWA disabled */ in detect_new_tunnel()
210 * intel_dp_tunnel_detect - Detect a DP tunnel on a port
214 * Detect a DP tunnel on the @intel_dp port, enabling the BW allocation mode
219 * If @intel_dp has already a tunnel detected on it, update the tunnel's state
221 * tunnel. If the tunnel's state change requires this - for instance the
222 * tunnel's group ID has changed - the tunnel will be dropped and recreated.
224 * Return 0 in case of success - after any tunnel detected and added to
225 * @intel_dp - 1 in case the BW on an already existing tunnel has changed in a
235 if (intel_dp->tunnel) { in intel_dp_tunnel_detect()
240 /* Try to recreate the tunnel after an update error. */ in intel_dp_tunnel_detect()
248 * intel_dp_tunnel_bw_alloc_is_enabled - Query the BW allocation support on a tunnel
251 * Query whether a DP tunnel is connected on @intel_dp and the tunnel supports
258 return drm_dp_tunnel_bw_alloc_is_enabled(intel_dp->tunnel); in intel_dp_tunnel_bw_alloc_is_enabled()
262 * intel_dp_tunnel_suspend - Suspend a DP tunnel connected on a port
265 * Suspend a DP tunnel on @intel_dp with BW allocation mode enabled on it.
278 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_suspend()
282 drm_dp_tunnel_disable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_suspend()
288 * intel_dp_tunnel_resume - Resume a DP tunnel connected on a port
293 * Resume a DP tunnel on @intel_dp with BW allocation mode enabled on it.
313 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_resume()
328 drm_dp_tunnel_set_io_error(intel_dp->tunnel); in intel_dp_tunnel_resume()
333 err = drm_dp_tunnel_enable_bw_alloc(intel_dp->tunnel); in intel_dp_tunnel_resume()
353 …"[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s] Tunnel can't be resumed, will drop and reject it (err … in intel_dp_tunnel_resume()
354 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_resume()
366 return state->inherited_dp_tunnels->ref[crtc->pipe].tunnel; in get_inherited_tunnel()
371 struct drm_dp_tunnel *tunnel, in add_inherited_tunnel() argument
379 drm_WARN_ON(display->drm, old_tunnel != tunnel); in add_inherited_tunnel()
390 drm_dp_tunnel_ref_get(tunnel, &state->inherited_dp_tunnels->ref[crtc->pipe]); in add_inherited_tunnel()
407 * If a BWA tunnel gets detected only after the corresponding in check_inherited_tunnel_state()
408 * connector got enabled already without a BWA tunnel, or a different in check_inherited_tunnel_state()
409 * BWA tunnel (which was removed meanwhile) the old CRTC state won't in check_inherited_tunnel_state()
410 * contain the state of the current tunnel. This tunnel still has a in check_inherited_tunnel_state()
424 old_crtc_state->dp_tunnel_ref.tunnel == intel_dp->tunnel) in check_inherited_tunnel_state()
428 … "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s][CRTC:%d:%s] Adding state for inherited tunnel %p\n", in check_inherited_tunnel_state()
429 drm_dp_tunnel_name(intel_dp->tunnel), in check_inherited_tunnel_state()
433 intel_dp->tunnel); in check_inherited_tunnel_state()
435 return add_inherited_tunnel(state, intel_dp->tunnel, old_crtc); in check_inherited_tunnel_state()
439 * intel_dp_tunnel_atomic_cleanup_inherited_state - Free any inherited DP tunnel state
442 * Free the inherited DP tunnel state in @state.
453 if (state->inherited_dp_tunnels->ref[pipe].tunnel) in intel_dp_tunnel_atomic_cleanup_inherited_state()
461 struct drm_dp_tunnel *tunnel) in intel_dp_tunnel_atomic_add_group_state() argument
468 tunnel, &pipe_mask); in intel_dp_tunnel_atomic_add_group_state()
478 * intel_dp_tunnel_atomic_add_state_for_crtc - Add CRTC specific DP tunnel state
480 * @crtc: CRTC to add the tunnel state for
482 * Add the DP tunnel state for @crtc if the CRTC (aka DP tunnel stream) is enabled
483 * via a DP tunnel.
493 struct drm_dp_tunnel *tunnel = new_crtc_state->dp_tunnel_ref.tunnel; in intel_dp_tunnel_atomic_add_state_for_crtc() local
495 if (!tunnel) in intel_dp_tunnel_atomic_add_state_for_crtc()
498 tunnel_state = drm_dp_tunnel_atomic_get_state(&state->base, tunnel); in intel_dp_tunnel_atomic_add_state_for_crtc()
515 if (!crtc_state->dp_tunnel_ref.tunnel) in check_group_state()
519 "[DPTUN %s][CONNECTOR:%d:%s][ENCODER:%d:%s][CRTC:%d:%s] Adding group state for tunnel %p\n", in check_group_state()
520 drm_dp_tunnel_name(intel_dp->tunnel), in check_group_state()
524 crtc_state->dp_tunnel_ref.tunnel); in check_group_state()
526 return intel_dp_tunnel_atomic_add_group_state(state, crtc_state->dp_tunnel_ref.tunnel); in check_group_state()
530 * intel_dp_tunnel_atomic_check_state - Check a connector's DP tunnel specific state
535 * Check and add the DP tunnel atomic state for @intel_dp/@connector to
536 * @state, if there is a DP tunnel detected on @intel_dp with BW allocation
538 * DP tunnel.
571 * intel_dp_tunnel_atomic_compute_stream_bw - Compute the BW required by a DP tunnel stream
575 * @crtc_state: state of CRTC of the given DP tunnel stream
577 * Compute the required BW of CRTC (aka DP tunnel stream), storing this BW to
578 * the DP tunnel state containing the stream in @state. Before re-calculating a
600 drm_dp_tunnel_name(intel_dp->tunnel), in intel_dp_tunnel_atomic_compute_stream_bw()
607 ret = drm_dp_tunnel_atomic_set_stream_bw(&state->base, intel_dp->tunnel, in intel_dp_tunnel_atomic_compute_stream_bw()
612 drm_dp_tunnel_ref_get(intel_dp->tunnel, in intel_dp_tunnel_atomic_compute_stream_bw()
619 * intel_dp_tunnel_atomic_clear_stream_bw - Clear any DP tunnel stream BW requirement
621 * @crtc_state: state of CRTC of the given DP tunnel stream
623 * Clear any DP tunnel stream BW requirement set by
631 if (!crtc_state->dp_tunnel_ref.tunnel) in intel_dp_tunnel_atomic_clear_stream_bw()
635 crtc_state->dp_tunnel_ref.tunnel, in intel_dp_tunnel_atomic_clear_stream_bw()
641 * intel_dp_tunnel_atomic_check_link - Check the DP tunnel atomic state
670 failed_stream_mask, "DP tunnel link BW"); in intel_dp_tunnel_atomic_check_link()
684 struct drm_dp_tunnel *tunnel; in atomic_decrease_bw() local
691 tunnel = get_inherited_tunnel(state, crtc); in atomic_decrease_bw()
692 if (!tunnel) in atomic_decrease_bw()
693 tunnel = old_crtc_state->dp_tunnel_ref.tunnel; in atomic_decrease_bw()
695 if (!tunnel) in atomic_decrease_bw()
698 old_bw = drm_dp_tunnel_get_allocated_bw(tunnel); in atomic_decrease_bw()
700 new_tunnel_state = drm_dp_tunnel_atomic_get_new_state(&state->base, tunnel); in atomic_decrease_bw()
706 drm_dp_tunnel_alloc_bw(tunnel, new_bw); in atomic_decrease_bw()
711 struct drm_dp_tunnel *tunnel, in queue_retry_work() argument
724 drm_dp_tunnel_name(tunnel), in queue_retry_work()
739 struct drm_dp_tunnel *tunnel = crtc_state->dp_tunnel_ref.tunnel; in atomic_increase_bw() local
745 if (!tunnel) in atomic_increase_bw()
748 tunnel_state = drm_dp_tunnel_atomic_get_new_state(&state->base, tunnel); in atomic_increase_bw()
752 if (drm_dp_tunnel_alloc_bw(tunnel, bw) != 0) in atomic_increase_bw()
753 queue_retry_work(state, tunnel, crtc_state); in atomic_increase_bw()
770 * intel_dp_tunnel_mgr_init - Initialize the DP tunnel manager
773 * Initialize the DP tunnel manager. The tunnel manager will support the
805 * intel_dp_tunnel_mgr_cleanup - Clean up the DP tunnel manager state
808 * Clean up the DP tunnel manager state.