drm/i915: Remove locks around skl+ scaler programming
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Feb 2022 16:51:00 +0000 (18:51 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 29 Mar 2022 13:35:33 +0000 (16:35 +0300)
All the skl+ scaler registers are suitably confined to their own
cachelines so we don't need the uncore.lock to globally serialize
access to these registers. We actually already dropped some of this
in commit 14ad15296d1f ("drm/i915: Make skl+ universal plane
registers unlocked") as the plane scaler enabling/reconfiguration
became lockless. So let's complete that and remove the rest of
the locks from the scaler programming as well.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-2-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
drivers/gpu/drm/i915/display/skl_scaler.c

index 998128bac8c0a77861d89d0e7c12fe71ea68243c..4092679be21ec988b6858a284ae06799461b50c0 100644 (file)
@@ -409,7 +409,6 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
        int x = dst->x1;
        int y = dst->y1;
        int hscale, vscale;
-       unsigned long irqflags;
        struct drm_rect src;
        int id;
        u32 ps_ctrl;
@@ -436,8 +435,6 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
        ps_ctrl = skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, 0);
        ps_ctrl |=  PS_SCALER_EN | scaler_state->scalers[id].mode;
 
-       spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
-
        skl_scaler_setup_filter(dev_priv, pipe, id, 0,
                                crtc_state->hw.scaling_filter);
 
@@ -451,8 +448,6 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
                          x << 16 | y);
        intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(pipe, id),
                          width << 16 | height);
-
-       spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
 void
@@ -521,15 +516,10 @@ static void skl_detach_scaler(struct intel_crtc *crtc, int id)
 {
        struct drm_device *dev = crtc->base.dev;
        struct drm_i915_private *dev_priv = to_i915(dev);
-       unsigned long irqflags;
-
-       spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
        intel_de_write_fw(dev_priv, SKL_PS_CTRL(crtc->pipe, id), 0);
        intel_de_write_fw(dev_priv, SKL_PS_WIN_POS(crtc->pipe, id), 0);
        intel_de_write_fw(dev_priv, SKL_PS_WIN_SZ(crtc->pipe, id), 0);
-
-       spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
 /*