Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 109fc2ad authored by Daniel Vetter's avatar Daniel Vetter
Browse files

drm/i915: More checks for psr.enabled



We need to make sure that no one else is using this in the
enable function and also that the work item hasn't raced
with the disabled function.

v2: Improve bisectability by moving one hunk to an earlier patch.

v3: added missing dev_priv declaration (Rodrigo)

Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 3638379c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1850,6 +1850,7 @@ static void intel_edp_psr_do_enable(struct intel_dp *intel_dp)
void intel_edp_psr_enable(struct intel_dp *intel_dp)
void intel_edp_psr_enable(struct intel_dp *intel_dp)
{
{
	struct drm_device *dev = intel_dp_to_dev(intel_dp);
	struct drm_device *dev = intel_dp_to_dev(intel_dp);
	struct drm_i915_private *dev_priv = dev->dev_private;


	if (!HAS_PSR(dev)) {
	if (!HAS_PSR(dev)) {
		DRM_DEBUG_KMS("PSR not supported on this platform\n");
		DRM_DEBUG_KMS("PSR not supported on this platform\n");
@@ -1861,6 +1862,11 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp)
		return;
		return;
	}
	}


	if (dev_priv->psr.enabled) {
		DRM_DEBUG_KMS("PSR already in use\n");
		return;
	}

	/* Setup PSR once */
	/* Setup PSR once */
	intel_edp_psr_setup(intel_dp);
	intel_edp_psr_setup(intel_dp);