mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-07 06:14:24 +08:00
drm/i915: pass i915 to intel_modeset_driver_remove()
In general, prefer struct drm_i915_private * over struct drm_device * when either will do. Rename the local variable to i915. Also propagate to intel_hpd_poll_fini(). No functional changes. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190920185421.17822-3-jani.nikula@intel.com
This commit is contained in:
parent
5bcd53aa39
commit
9980c3c110
@ -17114,13 +17114,13 @@ void intel_display_resume(struct drm_device *dev)
|
||||
drm_atomic_state_put(state);
|
||||
}
|
||||
|
||||
static void intel_hpd_poll_fini(struct drm_device *dev)
|
||||
static void intel_hpd_poll_fini(struct drm_i915_private *i915)
|
||||
{
|
||||
struct intel_connector *connector;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
|
||||
/* Kill all the work that may have been queued by hpd. */
|
||||
drm_connector_list_iter_begin(dev, &conn_iter);
|
||||
drm_connector_list_iter_begin(&i915->drm, &conn_iter);
|
||||
for_each_intel_connector_iter(connector, &conn_iter) {
|
||||
if (connector->modeset_retry_work.func)
|
||||
cancel_work_sync(&connector->modeset_retry_work);
|
||||
@ -17132,51 +17132,49 @@ static void intel_hpd_poll_fini(struct drm_device *dev)
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
}
|
||||
|
||||
void intel_modeset_driver_remove(struct drm_device *dev)
|
||||
void intel_modeset_driver_remove(struct drm_i915_private *i915)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
flush_workqueue(i915->flip_wq);
|
||||
flush_workqueue(i915->modeset_wq);
|
||||
|
||||
flush_workqueue(dev_priv->flip_wq);
|
||||
flush_workqueue(dev_priv->modeset_wq);
|
||||
|
||||
flush_work(&dev_priv->atomic_helper.free_work);
|
||||
WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
|
||||
flush_work(&i915->atomic_helper.free_work);
|
||||
WARN_ON(!llist_empty(&i915->atomic_helper.free_list));
|
||||
|
||||
/*
|
||||
* Interrupts and polling as the first thing to avoid creating havoc.
|
||||
* Too much stuff here (turning of connectors, ...) would
|
||||
* experience fancy races otherwise.
|
||||
*/
|
||||
intel_irq_uninstall(dev_priv);
|
||||
intel_irq_uninstall(i915);
|
||||
|
||||
/*
|
||||
* Due to the hpd irq storm handling the hotplug work can re-arm the
|
||||
* poll handlers. Hence disable polling after hpd handling is shut down.
|
||||
*/
|
||||
intel_hpd_poll_fini(dev);
|
||||
intel_hpd_poll_fini(i915);
|
||||
|
||||
/* poll work can call into fbdev, hence clean that up afterwards */
|
||||
intel_fbdev_fini(dev_priv);
|
||||
intel_fbdev_fini(i915);
|
||||
|
||||
intel_unregister_dsm_handler();
|
||||
|
||||
intel_fbc_global_disable(dev_priv);
|
||||
intel_fbc_global_disable(i915);
|
||||
|
||||
/* flush any delayed tasks or pending work */
|
||||
flush_scheduled_work();
|
||||
|
||||
intel_hdcp_component_fini(dev_priv);
|
||||
intel_hdcp_component_fini(i915);
|
||||
|
||||
drm_mode_config_cleanup(dev);
|
||||
drm_mode_config_cleanup(&i915->drm);
|
||||
|
||||
intel_overlay_cleanup(dev_priv);
|
||||
intel_overlay_cleanup(i915);
|
||||
|
||||
intel_gmbus_teardown(dev_priv);
|
||||
intel_gmbus_teardown(i915);
|
||||
|
||||
destroy_workqueue(dev_priv->flip_wq);
|
||||
destroy_workqueue(dev_priv->modeset_wq);
|
||||
destroy_workqueue(i915->flip_wq);
|
||||
destroy_workqueue(i915->modeset_wq);
|
||||
|
||||
intel_fbc_cleanup_cfb(dev_priv);
|
||||
intel_fbc_cleanup_cfb(i915);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -578,7 +578,7 @@ void intel_display_print_error_state(struct drm_i915_error_state_buf *e,
|
||||
/* modesetting */
|
||||
void intel_modeset_init_hw(struct drm_device *dev);
|
||||
int intel_modeset_init(struct drm_device *dev);
|
||||
void intel_modeset_driver_remove(struct drm_device *dev);
|
||||
void intel_modeset_driver_remove(struct drm_i915_private *i915);
|
||||
int intel_modeset_vga_set_state(struct drm_i915_private *dev_priv, bool state);
|
||||
void intel_display_resume(struct drm_device *dev);
|
||||
void i915_redisable_vga(struct drm_i915_private *dev_priv);
|
||||
|
@ -407,7 +407,7 @@ cleanup_gem:
|
||||
i915_gem_driver_remove(i915);
|
||||
i915_gem_driver_release(i915);
|
||||
cleanup_modeset:
|
||||
intel_modeset_driver_remove(&i915->drm);
|
||||
intel_modeset_driver_remove(i915);
|
||||
cleanup_irq:
|
||||
intel_irq_uninstall(i915);
|
||||
intel_gmbus_teardown(i915);
|
||||
@ -450,7 +450,7 @@ static void i915_driver_modeset_remove(struct drm_i915_private *i915)
|
||||
{
|
||||
struct pci_dev *pdev = i915->drm.pdev;
|
||||
|
||||
intel_modeset_driver_remove(&i915->drm);
|
||||
intel_modeset_driver_remove(i915);
|
||||
|
||||
intel_bios_driver_remove(i915);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user