linux/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
/**
 * @dpu_core_perf_crtc_release_bw() - request zero bandwidth
 * @crtc - pointer to a crtc
 *
 * Function checks a state variable for the crtc, if all pending commit
 * requests are done, meaning no more bandwidth is needed, release
 * bandwidth request.
 */
@dpu_core_perf_crtc_release_bw() - request zero bandwidth
@crtc - pointer to a crtc

Function checks a state variable for the crtc, if all pending commit
requests are done, meaning no more bandwidth is needed, release
bandwidth request.
@dpu_core_perf_crtc_release_bw () - request zero bandwidth @crtc - pointer to a crtc Function checks a state variable for the crtc if all pending commit requests are done meaning no more bandwidth is needed release bandwidth request .
void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc)
{
	struct drm_crtc *tmp_crtc;
	struct dpu_crtc *dpu_crtc;
	struct dpu_crtc_state *dpu_cstate;
	struct dpu_kms *kms;
	int i;
	if (!crtc) {
		DPU_ERROR("invalid crtc\n");
		return;
	}
	kms = _dpu_crtc_get_kms(crtc);
	if (!kms || !kms->catalog) {
		DPU_ERROR("invalid kms\n");
		return;
	}
	dpu_crtc = to_dpu_crtc(crtc);
	dpu_cstate = to_dpu_crtc_state(crtc->state);
	if (dpu_crtc_get_intf_mode(crtc) != INTF_MODE_CMD)
		return;
	if (dpu_crtc_get_intf_mode(crtc) == INTF_MODE_CMD)
		drm_for_each_crtc(tmp_crtc, crtc->dev) {
			if (_dpu_core_perf_crtc_is_power_on(tmp_crtc) &&
				dpu_crtc_get_intf_mode(tmp_crtc) ==
						INTF_MODE_VIDEO)
				return;
		}
	if (kms->perf.enable_bw_release) {
		trace_dpu_cmd_release_bw(crtc->base.id);
		DPU_DEBUG("Release BW crtc=%d\n", crtc->base.id);
		for (i = 0; i < DPU_POWER_HANDLE_DBUS_ID_MAX; i++) {
			dpu_crtc->cur_perf.bw_ctl[i] = 0;
			_dpu_core_perf_crtc_update_bus(kms, crtc, i);
		}
	}
}
void dpu_core_perf_crtc_release_bw ( struct drm_crtc * crtc ) { struct drm_crtc * tmp_crtc ; struct dpu_crtc * dpu_crtc ; struct dpu_crtc_state * dpu_cstate ; struct dpu_kms * kms ; int i ; if ( ! crtc ) { DPU_ERROR ( " \n " ) ; return ; } kms = _dpu_crtc_get_kms ( crtc ) ; if ( ! kms || ! kms -> catalog ) { DPU_ERROR ( " \n " ) ; return ; } dpu_crtc = to_dpu_crtc ( crtc ) ; dpu_cstate = to_dpu_crtc_state ( crtc -> state ) ; if ( dpu_crtc_get_intf_mode ( crtc ) != INTF_MODE_CMD ) return ; if ( dpu_crtc_get_intf_mode ( crtc ) == INTF_MODE_CMD ) drm_for_each_crtc ( tmp_crtc , crtc -> dev ) { if ( _dpu_core_perf_crtc_is_power_on ( tmp_crtc ) && dpu_crtc_get_intf_mode ( tmp_crtc ) == INTF_MODE_VIDEO ) return ; } if ( kms -> perf . enable_bw_release ) { trace_dpu_cmd_release_bw ( crtc -> base . id ) ; DPU_DEBUG ( " \n " , crtc -> base . id ) ; for ( i = 0 ; i < DPU_POWER_HANDLE_DBUS_ID_MAX ; i ++ ) { dpu_crtc -> cur_perf . bw_ctl [ i ] = 0 ; _dpu_core_perf_crtc_update_bus ( kms , crtc , i ) ; } } }
@dpu_core_perf_crtc_release_bw() - request zero bandwidth
 @crtc - pointer to a crtc
@dpu_core_perf_crtc_release_bw () - request zero bandwidth @crtc - pointer to a crtc
/* only do this for command mode rt client */ /*
	 * If video interface present, cmd panel bandwidth cannot be
	 * released.
	 */ /* Release the bandwidth */