On Wed, 08 Feb 2023, Imre Deak <imre.deak@xxxxxxxxx> wrote: > Determining whether the display engine is present on a platform happens > only in intel_device_info_runtime_init(). Initializing the display power > functionality depends on this condition, so move > intel_power_domains_init() later after the runtime init function has > been called. > > The next patch fixing platforms without display, depends on this patch. > It's pretty hard to review we aren't using any of the power domain stuff before the intel_power_domains_init() call. What happens if we do? I approve of the change, but I can't in good faith claim I checked this. Acked-by: Jani Nikula <jani.nikula@xxxxxxxxx> > Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx> > --- > drivers/gpu/drm/i915/display/intel_display.c | 5 +++++ > drivers/gpu/drm/i915/i915_driver.c | 7 ------- > 2 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index 166662ade593c..b3e7ed3866cde 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -8634,6 +8634,10 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915) > goto cleanup_bios; > > /* FIXME: completely on the wrong abstraction layer */ > + ret = intel_power_domains_init(i915); > + if (ret < 0) > + goto cleanup_vga; > + > intel_power_domains_init_hw(i915, false); > > if (!HAS_DISPLAY(i915)) > @@ -8676,6 +8680,7 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915) > cleanup_vga_client_pw_domain_dmc: > intel_dmc_ucode_fini(i915); > intel_power_domains_driver_remove(i915); > +cleanup_vga: > intel_vga_unregister(i915); > cleanup_bios: > intel_bios_driver_remove(i915); > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c > index 13bf4fe52f9fe..fe2870a6ae631 100644 > --- a/drivers/gpu/drm/i915/i915_driver.c > +++ b/drivers/gpu/drm/i915/i915_driver.c > @@ -251,9 +251,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv) > intel_detect_pch(dev_priv); > > intel_pm_setup(dev_priv); > - ret = intel_power_domains_init(dev_priv); > - if (ret < 0) > - goto err_gem; > intel_irq_init(dev_priv); > intel_init_display_hooks(dev_priv); > intel_init_clock_gating_hooks(dev_priv); > @@ -262,10 +259,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv) > > return 0; > > -err_gem: > - i915_gem_cleanup_early(dev_priv); > - intel_gt_driver_late_release_all(dev_priv); > - i915_drm_clients_fini(&dev_priv->clients); > err_rootgt: > intel_region_ttm_device_fini(dev_priv); > err_ttm: -- Jani Nikula, Intel Open Source Graphics Center