linux/drivers/gpu/drm/i915/intel_psr.c
/**
 * intel_psr_enable - Enable PSR
 * @intel_dp: Intel DP
 * @crtc_state: new CRTC state
 *
 * This function can only be called after the pipe is fully trained and enabled.
 */
Enable PSR
@intel_dp: Intel DP
@crtc_state: new CRTC state

This function can only be called after the pipe is fully trained and enabled.
Enable PSR @intel_dp : Intel DP @crtc_state : new CRTC state This function can only be called after the pipe is fully trained and enabled .
void intel_psr_enable(struct intel_dp *intel_dp,
		      const struct intel_crtc_state *crtc_state)
{
	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
	struct drm_device *dev = intel_dig_port->base.base.dev;
	struct drm_i915_private *dev_priv = to_i915(dev);
	if (!crtc_state->has_psr)
		return;
	if (WARN_ON(!CAN_PSR(dev_priv)))
		return;
	WARN_ON(dev_priv->drrs.dp);
	mutex_lock(&dev_priv->psr.lock);
	if (dev_priv->psr.enabled) {
		DRM_DEBUG_KMS("PSR already in use\n");
		goto unlock;
	}
	dev_priv->psr.psr2_enabled = crtc_state->has_psr2;
	dev_priv->psr.busy_frontbuffer_bits = 0;
	intel_psr_setup_vsc(intel_dp, crtc_state);
	intel_psr_enable_sink(intel_dp);
	intel_psr_enable_source(intel_dp, crtc_state);
	dev_priv->psr.enabled = intel_dp;
	intel_psr_activate(intel_dp);
unlock:
	mutex_unlock(&dev_priv->psr.lock);
}
void intel_psr_enable ( struct intel_dp * intel_dp , const struct intel_crtc_state * crtc_state ) { struct intel_digital_port * intel_dig_port = dp_to_dig_port ( intel_dp ) ; struct drm_device * dev = intel_dig_port -> base . base . dev ; struct drm_i915_private * dev_priv = to_i915 ( dev ) ; if ( ! crtc_state -> has_psr ) return ; if ( WARN_ON ( ! CAN_PSR ( dev_priv ) ) ) return ; WARN_ON ( dev_priv -> drrs . dp ) ; mutex_lock ( & dev_priv -> psr . lock ) ; if ( dev_priv -> psr . enabled ) { DRM_DEBUG_KMS ( " \n " ) ; goto unlock ; } dev_priv -> psr . psr2_enabled = crtc_state -> has_psr2 ; dev_priv -> psr . busy_frontbuffer_bits = 0 ; intel_psr_setup_vsc ( intel_dp , crtc_state ) ; intel_psr_enable_sink ( intel_dp ) ; intel_psr_enable_source ( intel_dp , crtc_state ) ; dev_priv -> psr . enabled = intel_dp ; intel_psr_activate ( intel_dp ) ; unlock : mutex_unlock ( & dev_priv -> psr . lock ) ; }
intel_psr_enable - Enable PSR
 @intel_dp: Intel DP
 @crtc_state: new CRTC state
intel_psr_enable - Enable PSR @intel_dp : Intel DP @crtc_state : new CRTC state