Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915: remove the extra modeset init layer
Date: Wed, 2 Sep 2020 19:19:21 +0300	[thread overview]
Message-ID: <20200902161921.GT6112@intel.com> (raw)
In-Reply-To: <62c32c35683b843ecdc2eca2bd2d3e62cb705e96.1599056955.git.jani.nikula@intel.com>

On Wed, Sep 02, 2020 at 05:30:23PM +0300, Jani Nikula wrote:
> Streamline the modeset init by removing the extra init layer.
> 
> No functional changes, which means the cleanup path looks hideous.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 63 +++++++++++----------------------
>  1 file changed, 20 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index e332b6fd701d..4d9b61b1a115 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -215,46 +215,6 @@ intel_teardown_mchbar(struct drm_i915_private *dev_priv)
>  		release_resource(&dev_priv->mch_res);
>  }
>  
> -/* part #1: call before irq install */
> -static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915)
> -{
> -	return intel_modeset_init_noirq(i915);
> -}
> -
> -/* part #2: call after irq install */
> -static int i915_driver_modeset_probe(struct drm_i915_private *i915)
> -{
> -	int ret;
> -
> -	/* Important: The output setup functions called by modeset_init need
> -	 * working irqs for e.g. gmbus and dp aux transfers. */
> -	ret = intel_modeset_init_nogem(i915);
> -	if (ret)
> -		goto out;
> -
> -	ret = i915_gem_init(i915);
> -	if (ret)
> -		goto cleanup_modeset;
> -
> -	ret = intel_modeset_init(i915);
> -	if (ret)
> -		goto cleanup_gem;
> -
> -	return 0;
> -
> -cleanup_gem:
> -	i915_gem_suspend(i915);
> -	i915_gem_driver_remove(i915);
> -	i915_gem_driver_release(i915);
> -cleanup_modeset:
> -	/* FIXME */
> -	intel_modeset_driver_remove(i915);
> -	intel_irq_uninstall(i915);
> -	intel_modeset_driver_remove_noirq(i915);
> -out:
> -	return ret;
> -}
> -
>  static void intel_init_dpio(struct drm_i915_private *dev_priv)
>  {
>  	/*
> @@ -923,7 +883,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret < 0)
>  		goto out_cleanup_mmio;
>  
> -	ret = i915_driver_modeset_probe_noirq(i915);
> +	ret = intel_modeset_init_noirq(i915);
>  	if (ret < 0)
>  		goto out_cleanup_hw;
>  
> @@ -931,10 +891,18 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret)
>  		goto out_cleanup_modeset;
>  
> -	ret = i915_driver_modeset_probe(i915);
> -	if (ret < 0)
> +	ret = intel_modeset_init_nogem(i915);
> +	if (ret)
>  		goto out_cleanup_irq;
>  
> +	ret = i915_gem_init(i915);
> +	if (ret)
> +		goto out_cleanup_modeset2;
> +
> +	ret = intel_modeset_init(i915);
> +	if (ret)
> +		goto out_cleanup_gem;
> +
>  	i915_driver_register(i915);
>  
>  	enable_rpm_wakeref_asserts(&i915->runtime_pm);
> @@ -945,6 +913,15 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	return 0;
>  
> +out_cleanup_gem:
> +	i915_gem_suspend(i915);
> +	i915_gem_driver_remove(i915);
> +	i915_gem_driver_release(i915);
> +out_cleanup_modeset2:
> +	intel_modeset_driver_remove(i915);
> +	intel_irq_uninstall(i915);
> +	intel_modeset_driver_remove_noirq(i915);
> +	goto out_cleanup_modeset;

Looks like we used to do the intel_irq_uninstall() twice? We even
have a FIXME in there stating as much. With this goto we only do
it the once I guess. So seems like a slight change in behaviour.
Though the comment says it gets called twice during driver remove
as well, which does not seem to be true (at least anymore).

Anyways, fixing that properly likely requires some axctual thought
wrt. hpd vs. irq vs. other stuff.

Series is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  out_cleanup_irq:
>  	intel_irq_uninstall(i915);
>  out_cleanup_modeset:
> -- 
> 2.20.1

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-09-02 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 14:30 [Intel-gfx] [PATCH 0/4] drm/i915: modeset probe cleanup Jani Nikula
2020-09-02 14:30 ` [Intel-gfx] [PATCH 1/4] drm/i915: split intel_modeset_init() pre/post gem init Jani Nikula
2020-09-02 14:30 ` [Intel-gfx] [PATCH 2/4] drm/i915: move more display related probe to intel_modeset_init_noirq() Jani Nikula
2020-09-02 14:30 ` [Intel-gfx] [PATCH 3/4] drm/i915: split out intel_modeset_driver_remove_nogem() and simplify Jani Nikula
2020-09-02 14:30 ` [Intel-gfx] [PATCH 4/4] drm/i915: remove the extra modeset init layer Jani Nikula
2020-09-02 16:19   ` Ville Syrjälä [this message]
2020-09-04 11:00     ` Jani Nikula
2020-09-02 14:42 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: modeset probe cleanup Patchwork
2020-09-02 14:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-03 17:04 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200902161921.GT6112@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox