All of 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 12/12] drm/i915/fbc: switch to intel_de_* register accessors in display code
Date: Thu, 24 Nov 2022 12:52:53 +0200	[thread overview]
Message-ID: <Y39NBXNDDwwq4sKj@intel.com> (raw)
In-Reply-To: <6d9653c249d4a863b4bec71b66ddb5718dd3c8c3.1669238194.git.jani.nikula@intel.com>

On Wed, Nov 23, 2022 at 11:18:25PM +0200, Jani Nikula wrote:
> Avoid direct uncore use in display code. Use the new
> intel_de_rewrite_fw().
> 
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index b5ee5ea0d010..6066ac412e6f 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -323,10 +323,7 @@ static void i8xx_fbc_nuke(struct intel_fbc *fbc)
>  	enum i9xx_plane_id i9xx_plane = fbc_state->plane->i9xx_plane;
>  	struct drm_i915_private *dev_priv = fbc->i915;
>  
> -	spin_lock_irq(&dev_priv->uncore.lock);
> -	intel_de_write_fw(dev_priv, DSPADDR(i9xx_plane),
> -			  intel_de_read_fw(dev_priv, DSPADDR(i9xx_plane)));
> -	spin_unlock_irq(&dev_priv->uncore.lock);
> +	intel_de_rewrite_fw(dev_priv, DSPADDR(i9xx_plane));

intel_de_rewrite_fw() seems to imply some kind of atomicicity guarantee
here. But that entirely depends on whether the other writers of this
register also protect it with unore.lock. So just a misleading illusion.

That said, this locking stuff shouldn't even be needed since 
commit de5bd083d247 ("drm/i915/fbc: Skip nuke when flip is pending")
commit 7cfd1a18c5f9 ("drm/i915: Remove remaining locks from i9xx plane udpates")

>  }
>  
>  static void i8xx_fbc_program_cfb(struct intel_fbc *fbc)
> @@ -359,10 +356,7 @@ static void i965_fbc_nuke(struct intel_fbc *fbc)
>  	enum i9xx_plane_id i9xx_plane = fbc_state->plane->i9xx_plane;
>  	struct drm_i915_private *dev_priv = fbc->i915;
>  
> -	spin_lock_irq(&dev_priv->uncore.lock);
> -	intel_de_write_fw(dev_priv, DSPSURF(i9xx_plane),
> -			  intel_de_read_fw(dev_priv, DSPSURF(i9xx_plane)));
> -	spin_unlock_irq(&dev_priv->uncore.lock);
> +	intel_de_rewrite_fw(dev_priv, DSPSURF(i9xx_plane));
>  }
>  
>  static const struct intel_fbc_funcs i965_fbc_funcs = {
> -- 
> 2.34.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-11-24 10:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 21:18 [Intel-gfx] [PATCH 00/12] drm/i915/display: switch to intel_de_* register accessors Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 01/12] drm/i915/de: Add more macros to remove all direct calls to uncore Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 02/12] drm/i915/de: return the old register value from intel_de_rmw() Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 03/12] drm/i915/crt: drop a bunch of unnecessary register variables Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 04/12] drm/i915/crt: switch to intel_de_* register accessors in display code Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 05/12] drm/i915/power: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 06/12] drm/i915/dmc: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 07/12] drm/i915/dp-aux: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 08/12] drm/i915/gmbus: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 09/12] drm/i915/wm: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 10/12] drm/i915/snps: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 11/12] drm/i915/tc: " Jani Nikula
2022-11-23 21:18 ` [Intel-gfx] [PATCH 12/12] drm/i915/fbc: " Jani Nikula
2022-11-24 10:52   ` Ville Syrjälä [this message]
2022-11-25 10:44     ` Jani Nikula
2022-11-23 22:37 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/display: switch to intel_de_* register accessors Patchwork
2022-11-23 23:06 ` [Intel-gfx] ✓ Fi.CI.BAT: success " 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=Y39NBXNDDwwq4sKj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.