Commit 848a4e5c authored by Luca Coelho's avatar Luca Coelho Committed by Jani Nikula
Browse files

drm/i915: add a dedicated workqueue inside drm_i915_private

In order to avoid flush_scheduled_work() usage, add a dedicated
workqueue in the drm_i915_private structure.  In this way, we don't
need to use the system queue anymore.

This change is mostly mechanical and based on Tetsuo's original
patch[1].

v6 by Jani:
- Also create unordered_wq for mock device

Link: https://patchwork.freedesktop.org/series/114608/

 [1]
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c816ebe17ef08d363981942a096a586a7658a65e.1686231190.git.jani.nikula@intel.com
parent 8d208a5e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -7180,11 +7180,12 @@ intel_atomic_commit_ready(struct i915_sw_fence *fence,
		break;
	case FENCE_FREE:
		{
			struct drm_i915_private *i915 = to_i915(state->base.dev);
			struct intel_atomic_helper *helper =
				&to_i915(state->base.dev)->display.atomic_helper;
				&i915->display.atomic_helper;

			if (llist_add(&state->freed, &helper->free_list))
				schedule_work(&helper->free_work);
				queue_work(i915->unordered_wq, &helper->free_work);
			break;
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ void intel_display_driver_remove_noirq(struct drm_i915_private *i915)
	intel_unregister_dsm_handler();

	/* flush any delayed tasks or pending work */
	flush_scheduled_work();
	flush_workqueue(i915->unordered_wq);

	intel_hdcp_component_fini(i915);

+1 −1
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ void intel_dmc_init(struct drm_i915_private *i915)
	i915->display.dmc.dmc = dmc;

	drm_dbg_kms(&i915->drm, "Loading %s\n", dmc->fw_path);
	schedule_work(&dmc->work);
	queue_work(i915->unordered_wq, &dmc->work);

	return;

+1 −1
Original line number Diff line number Diff line
@@ -5251,7 +5251,7 @@ static void intel_dp_oob_hotplug_event(struct drm_connector *connector)
	spin_lock_irq(&i915->irq_lock);
	i915->display.hotplug.event_bits |= BIT(encoder->hpd_pin);
	spin_unlock_irq(&i915->irq_lock);
	queue_delayed_work(system_wq, &i915->display.hotplug.hotplug_work, 0);
	queue_delayed_work(i915->unordered_wq, &i915->display.hotplug.hotplug_work, 0);
}

static const struct drm_connector_funcs intel_dp_connector_funcs = {
+2 −1
Original line number Diff line number Diff line
@@ -1064,6 +1064,7 @@ static void intel_dp_schedule_fallback_link_training(struct intel_dp *intel_dp,
						     const struct intel_crtc_state *crtc_state)
{
	struct intel_connector *intel_connector = intel_dp->attached_connector;
	struct drm_i915_private *i915 = dp_to_i915(intel_dp);

	if (!intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base)) {
		lt_dbg(intel_dp, DP_PHY_DPRX, "Link Training failed on disconnected sink.\n");
@@ -1081,7 +1082,7 @@ static void intel_dp_schedule_fallback_link_training(struct intel_dp *intel_dp,
	}

	/* Schedule a Hotplug Uevent to userspace to start modeset */
	schedule_work(&intel_connector->modeset_retry_work);
	queue_work(i915->unordered_wq, &intel_connector->modeset_retry_work);
}

/* Perform the link training on all LTTPRs and the DPRX on a link. */
Loading