Commit 80f286a5 authored by Jani Nikula's avatar Jani Nikula

drm/i915: split intel_modeset_init() to pre/post irq install

Split inte_modeset_init() to parts before and after irq install, to
facilitate further cleanup. The error paths are a mess, otherwise no
functional changes.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200224120828.22105-1-jani.nikula@intel.com
parent cf9bfa3c
...@@ -17778,11 +17778,9 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config) ...@@ -17778,11 +17778,9 @@ static void plane_config_fini(struct intel_initial_plane_config *plane_config)
i915_vma_put(plane_config->vma); i915_vma_put(plane_config->vma);
} }
int intel_modeset_init(struct drm_i915_private *i915) /* part #1: call before irq install */
int intel_modeset_init_noirq(struct drm_i915_private *i915)
{ {
struct drm_device *dev = &i915->drm;
enum pipe pipe;
struct intel_crtc *crtc;
int ret; int ret;
i915->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0); i915->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
...@@ -17807,6 +17805,17 @@ int intel_modeset_init(struct drm_i915_private *i915) ...@@ -17807,6 +17805,17 @@ int intel_modeset_init(struct drm_i915_private *i915)
intel_fbc_init(i915); intel_fbc_init(i915);
return 0;
}
/* part #2: call after irq install */
int intel_modeset_init(struct drm_i915_private *i915)
{
struct drm_device *dev = &i915->drm;
enum pipe pipe;
struct intel_crtc *crtc;
int ret;
intel_init_pm(i915); intel_init_pm(i915);
intel_panel_sanitize_ssc(i915); intel_panel_sanitize_ssc(i915);
......
...@@ -614,6 +614,7 @@ intel_format_info_is_yuv_semiplanar(const struct drm_format_info *info, ...@@ -614,6 +614,7 @@ intel_format_info_is_yuv_semiplanar(const struct drm_format_info *info,
/* modesetting */ /* modesetting */
void intel_modeset_init_hw(struct drm_i915_private *i915); void intel_modeset_init_hw(struct drm_i915_private *i915);
int intel_modeset_init_noirq(struct drm_i915_private *i915);
int intel_modeset_init(struct drm_i915_private *i915); int intel_modeset_init(struct drm_i915_private *i915);
void intel_modeset_driver_remove(struct drm_i915_private *i915); void intel_modeset_driver_remove(struct drm_i915_private *i915);
void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915); void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915);
......
...@@ -238,8 +238,14 @@ static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915) ...@@ -238,8 +238,14 @@ static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915)
intel_csr_ucode_init(i915); intel_csr_ucode_init(i915);
ret = intel_modeset_init_noirq(i915);
if (ret)
goto cleanup_vga_client;
return 0; return 0;
cleanup_vga_client:
intel_vga_unregister(i915);
out: out:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment