summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2021-02-05 23:46:28 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-02-16 14:35:33 +0200
commitbe317ca0a338ab3976d7c74975458638d0cedf90 (patch)
tree587776489b8c9fcb531cc8322825f37ca45e5eb4
parent7815ed88c6cfba414a6ed5be6be2318fbe7e8b4e (diff)
drm/i915: Sprinkle a few missing locks around shared DDI clock registers
The current code attempts to protect the RMWs into global clock routing registers with a mutex, but forgets to do so in a few places. Let's remedy that. Note that at the moment we serialize all modesets onto single wq, so this shouldn't actually matter. But maybe one day we wish to attempt parallel modesets again... Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210205214634.19341-10-ville.syrjala@linux.intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_ddi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index ef759b148131..a14baea12800 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -1929,8 +1929,12 @@ static void cnl_ddi_disable_clock(struct intel_encoder *encoder)
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
enum port port = encoder->port;
+ mutex_lock(&i915->dpll.lock);
+
intel_de_rmw(i915, DPCLKA_CFGCR0,
0, DPCLKA_CFGCR0_DDI_CLK_OFF(port));
+
+ mutex_unlock(&i915->dpll.lock);
}
static void skl_ddi_enable_clock(struct intel_encoder *encoder,
@@ -1959,8 +1963,12 @@ static void skl_ddi_disable_clock(struct intel_encoder *encoder)
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
enum port port = encoder->port;
+ mutex_lock(&i915->dpll.lock);
+
intel_de_rmw(i915, DPLL_CTRL2,
0, DPLL_CTRL2_DDI_CLK_OFF(port));
+
+ mutex_unlock(&i915->dpll.lock);
}
void hsw_ddi_enable_clock(struct intel_encoder *encoder,