drm/i915: Initialize dkl_phy spin lock from display code path

drm/i915: Initialize dkl_phy spin lock from display code path

Start moving the initialization of display locks from
i915_driver_early_probe().
Display locks should be initialized from display-only code paths.

It was also agreed that if a variable is only used in one file, it
should be initialized only in that file, so intel_dkl_phy_init() was
added.

v2:
- added intel_display_locks_init()

v3:
- rebased

v4:
- dropped intel_display_locks_init()

v5:
- moved intel_dkl_phy_init() to the beginning of file

Cc: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230420170558.35398-1-jose.souza@intel.com
parent 20dfae3c
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "intel_display_driver.h" #include "intel_display_driver.h"
#include "intel_display_power.h" #include "intel_display_power.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dkl_phy.h"
#include "intel_dmc.h" #include "intel_dmc.h"
#include "intel_dp.h" #include "intel_dp.h"
#include "intel_dpll.h" #include "intel_dpll.h"
...@@ -175,6 +176,7 @@ void intel_display_driver_early_probe(struct drm_i915_private *i915) ...@@ -175,6 +176,7 @@ void intel_display_driver_early_probe(struct drm_i915_private *i915)
if (!HAS_DISPLAY(i915)) if (!HAS_DISPLAY(i915))
return; return;
intel_dkl_phy_init(i915);
intel_color_init_hooks(i915); intel_color_init_hooks(i915);
intel_init_cdclk_hooks(i915); intel_init_cdclk_hooks(i915);
intel_audio_hooks_init(i915); intel_audio_hooks_init(i915);
......
...@@ -11,6 +11,15 @@ ...@@ -11,6 +11,15 @@
#include "intel_dkl_phy.h" #include "intel_dkl_phy.h"
#include "intel_dkl_phy_regs.h" #include "intel_dkl_phy_regs.h"
/**
* intel_dkl_phy_init - initialize Dekel PHY
* @i915: i915 device instance
*/
void intel_dkl_phy_init(struct drm_i915_private *i915)
{
spin_lock_init(&i915->display.dkl.phy_lock);
}
static void static void
dkl_phy_set_hip_idx(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg) dkl_phy_set_hip_idx(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg)
{ {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
struct drm_i915_private; struct drm_i915_private;
void intel_dkl_phy_init(struct drm_i915_private *i915);
u32 u32
intel_dkl_phy_read(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg); intel_dkl_phy_read(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg);
void void
......
...@@ -223,7 +223,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv) ...@@ -223,7 +223,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
mutex_init(&dev_priv->display.wm.wm_mutex); mutex_init(&dev_priv->display.wm.wm_mutex);
mutex_init(&dev_priv->display.pps.mutex); mutex_init(&dev_priv->display.pps.mutex);
mutex_init(&dev_priv->display.hdcp.comp_mutex); mutex_init(&dev_priv->display.hdcp.comp_mutex);
spin_lock_init(&dev_priv->display.dkl.phy_lock);
i915_memcpy_init_early(dev_priv); i915_memcpy_init_early(dev_priv);
intel_runtime_pm_init_early(&dev_priv->runtime_pm); intel_runtime_pm_init_early(&dev_priv->runtime_pm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment