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

Commit c80ac854 authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Daniel Vetter
Browse files

drm/i915: FBC doesn't need struct_mutex anymore



Everything is covered either by fbc.lock or mm.stolen_lock, and
intel_fbc.c is already responsible for grabbing the appropriate locks
when it needs them.

Reviewed-by: default avatarChris wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b5e4b84d
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -1660,9 +1660,7 @@ static int i915_fbc_fc_get(void *data, u64 *val)
	if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev))
	if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev))
		return -ENODEV;
		return -ENODEV;


	drm_modeset_lock_all(dev);
	*val = dev_priv->fbc.false_color;
	*val = dev_priv->fbc.false_color;
	drm_modeset_unlock_all(dev);


	return 0;
	return 0;
}
}
@@ -1676,7 +1674,6 @@ static int i915_fbc_fc_set(void *data, u64 val)
	if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev))
	if (INTEL_INFO(dev)->gen < 7 || !HAS_FBC(dev))
		return -ENODEV;
		return -ENODEV;


	drm_modeset_lock_all(dev);
	mutex_lock(&dev_priv->fbc.lock);
	mutex_lock(&dev_priv->fbc.lock);


	reg = I915_READ(ILK_DPFC_CONTROL);
	reg = I915_READ(ILK_DPFC_CONTROL);
@@ -1687,7 +1684,6 @@ static int i915_fbc_fc_set(void *data, u64 val)
		   (reg & ~FBC_CTL_FALSE_COLOR));
		   (reg & ~FBC_CTL_FALSE_COLOR));


	mutex_unlock(&dev_priv->fbc.lock);
	mutex_unlock(&dev_priv->fbc.lock);
	drm_modeset_unlock_all(dev);
	return 0;
	return 0;
}
}


+3 −11
Original line number Original line Diff line number Diff line
@@ -4747,11 +4747,8 @@ static void intel_post_plane_update(struct intel_crtc *crtc)
	if (crtc->atomic.update_wm_post)
	if (crtc->atomic.update_wm_post)
		intel_update_watermarks(&crtc->base);
		intel_update_watermarks(&crtc->base);


	if (atomic->update_fbc) {
	if (atomic->update_fbc)
		mutex_lock(&dev->struct_mutex);
		intel_fbc_update(dev);
		intel_fbc_update(dev);
		mutex_unlock(&dev->struct_mutex);
	}


	if (atomic->post_enable_primary)
	if (atomic->post_enable_primary)
		intel_post_enable_primary(&crtc->base);
		intel_post_enable_primary(&crtc->base);
@@ -4783,11 +4780,8 @@ static void intel_pre_plane_update(struct intel_crtc *crtc)
	if (atomic->wait_for_flips)
	if (atomic->wait_for_flips)
		intel_crtc_wait_for_pending_flips(&crtc->base);
		intel_crtc_wait_for_pending_flips(&crtc->base);


	if (atomic->disable_fbc) {
	if (atomic->disable_fbc)
		mutex_lock(&dev->struct_mutex);
		intel_fbc_disable_crtc(crtc);
		intel_fbc_disable_crtc(crtc);
		mutex_unlock(&dev->struct_mutex);
	}


	if (crtc->atomic.disable_ips)
	if (crtc->atomic.disable_ips)
		hsw_disable_ips(crtc);
		hsw_disable_ips(crtc);
@@ -11473,9 +11467,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,


	i915_gem_track_fb(intel_fb_obj(work->old_fb), obj,
	i915_gem_track_fb(intel_fb_obj(work->old_fb), obj,
			  to_intel_plane(primary)->frontbuffer_bit);
			  to_intel_plane(primary)->frontbuffer_bit);
	mutex_unlock(&dev->struct_mutex);


	intel_fbc_disable(dev);
	intel_fbc_disable(dev);
	mutex_unlock(&dev->struct_mutex);
	intel_frontbuffer_flip_prepare(dev,
	intel_frontbuffer_flip_prepare(dev,
				       to_intel_plane(primary)->frontbuffer_bit);
				       to_intel_plane(primary)->frontbuffer_bit);


@@ -15605,9 +15599,7 @@ void intel_modeset_cleanup(struct drm_device *dev)


	intel_unregister_dsm_handler();
	intel_unregister_dsm_handler();


	mutex_lock(&dev->struct_mutex);
	intel_fbc_disable(dev);
	intel_fbc_disable(dev);
	mutex_unlock(&dev->struct_mutex);


	/* flush any delayed tasks or pending work */
	/* flush any delayed tasks or pending work */
	flush_scheduled_work();
	flush_scheduled_work();
+0 −2
Original line number Original line Diff line number Diff line
@@ -335,7 +335,6 @@ static void intel_fbc_work_fn(struct work_struct *__work)
	struct drm_device *dev = work->crtc->dev;
	struct drm_device *dev = work->crtc->dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_private *dev_priv = dev->dev_private;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev_priv->fbc.lock);
	mutex_lock(&dev_priv->fbc.lock);
	if (work == dev_priv->fbc.fbc_work) {
	if (work == dev_priv->fbc.fbc_work) {
		/* Double check that we haven't switched fb without cancelling
		/* Double check that we haven't switched fb without cancelling
@@ -352,7 +351,6 @@ static void intel_fbc_work_fn(struct work_struct *__work)
		dev_priv->fbc.fbc_work = NULL;
		dev_priv->fbc.fbc_work = NULL;
	}
	}
	mutex_unlock(&dev_priv->fbc.lock);
	mutex_unlock(&dev_priv->fbc.lock);
	mutex_unlock(&dev->struct_mutex);


	kfree(work);
	kfree(work);
}
}