]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Handle cdclk crawling flag in standard manner
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 7 Jul 2021 23:42:06 +0000 (16:42 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 8 Jul 2021 14:42:57 +0000 (07:42 -0700)
The 'has_cdclk_crawl' field in our device info structure is a boolean
flag and doesn't need a whole u8.  Add it as another 1-bit feature flag
and move it to the display section.  While we're at it, replace the
has_cdclk_crawl() function with a macro for consistency with our
handling of other feature flags.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210707234206.2002849-1-matthew.d.roper@intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/intel_device_info.h

index 613ffcc68eba8bcd427c7cc4363e1f75dca2a825..df2d8ce4a12f6ce0866fb1e04c95b38578377e07 100644 (file)
@@ -1548,11 +1548,6 @@ static void cnl_cdclk_pll_enable(struct drm_i915_private *dev_priv, int vco)
        dev_priv->cdclk.hw.vco = vco;
 }
 
-static bool has_cdclk_crawl(struct drm_i915_private *i915)
-{
-       return INTEL_INFO(i915)->has_cdclk_crawl;
-}
-
 static void adlp_cdclk_pll_crawl(struct drm_i915_private *dev_priv, int vco)
 {
        int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref);
@@ -1649,7 +1644,7 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
                return;
        }
 
-       if (has_cdclk_crawl(dev_priv) && dev_priv->cdclk.hw.vco > 0 && vco > 0) {
+       if (HAS_CDCLK_CRAWL(dev_priv) && dev_priv->cdclk.hw.vco > 0 && vco > 0) {
                if (dev_priv->cdclk.hw.vco != vco)
                        adlp_cdclk_pll_crawl(dev_priv, vco);
        } else if (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) {
@@ -1857,7 +1852,7 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
 {
        int a_div, b_div;
 
-       if (!has_cdclk_crawl(dev_priv))
+       if (!HAS_CDCLK_CRAWL(dev_priv))
                return false;
 
        /*
index 02f68f32322fe44d61d4c08001d562965f592295..c4a310af13d4e80ceb6057c9b63cd747abab6546 100644 (file)
@@ -1630,6 +1630,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 
 #define HAS_DP_MST(dev_priv)   (INTEL_INFO(dev_priv)->display.has_dp_mst)
 
+#define HAS_CDCLK_CRAWL(dev_priv)       (INTEL_INFO(dev_priv)->display.has_cdclk_crawl)
 #define HAS_DDI(dev_priv)               (INTEL_INFO(dev_priv)->display.has_ddi)
 #define HAS_FPGA_DBG_UNCLAIMED(dev_priv) (INTEL_INFO(dev_priv)->display.has_fpga_dbg)
 #define HAS_PSR(dev_priv)               (INTEL_INFO(dev_priv)->display.has_psr)
index 7030e563985c637eed469835d2df7b5780b62198..0c11c0e92cea9468cb1f0b64eb7af84c3a7ee0a8 100644 (file)
@@ -984,8 +984,8 @@ static const struct intel_device_info adl_p_info = {
        GEN12_FEATURES,
        XE_LPD_FEATURES,
        PLATFORM(INTEL_ALDERLAKE_P),
-       .has_cdclk_crawl = 1,
        .require_force_probe = 1,
+       .display.has_cdclk_crawl = 1,
        .display.has_modular_fia = 1,
        .display.has_psr_hw_tracking = 0,
        .platform_engine_mask =
index b326aff65cd6add3e58404c1546722aebe514fbe..3582253ee05bc51c1b4a586a9f8261cf9df4d4c8 100644 (file)
@@ -141,6 +141,7 @@ enum intel_ppgtt_type {
 #define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \
        /* Keep in alphabetical order */ \
        func(cursor_needs_physical); \
+       func(has_cdclk_crawl); \
        func(has_dmc); \
        func(has_ddi); \
        func(has_dp_mst); \
@@ -185,8 +186,6 @@ struct intel_device_info {
 
        u8 abox_mask;
 
-       u8 has_cdclk_crawl;  /* does support CDCLK crawling */
-
 #define DEFINE_FLAG(name) u8 name:1
        DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
 #undef DEFINE_FLAG