drm/i915: separate display runtime info init
authorJani Nikula <jani.nikula@intel.com>
Tue, 3 Oct 2023 12:42:09 +0000 (15:42 +0300)
committerJani Nikula <jani.nikula@intel.com>
Wed, 4 Oct 2023 09:41:33 +0000 (12:41 +0300)
Move display related functionality from intel_device_info_runtime_init()
to intel_display_device_info_runtime_init() and call the latter from the
top level.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a2226a47a4450e75d867c2ac48665b387af0e42d.1696336887.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display_device.c
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/intel_device_info.c

index dea64c9..11f4a6c 100644 (file)
@@ -939,7 +939,7 @@ void intel_display_device_probe(struct drm_i915_private *i915)
        }
 }
 
-void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
+static void __intel_display_device_info_runtime_init(struct drm_i915_private *i915)
 {
        struct intel_display_runtime_info *display_runtime = DISPLAY_RUNTIME_INFO(i915);
        enum pipe pipe;
@@ -1071,6 +1071,23 @@ display_fused_off:
        memset(display_runtime, 0, sizeof(*display_runtime));
 }
 
+void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
+{
+       if (HAS_DISPLAY(i915))
+               __intel_display_device_info_runtime_init(i915);
+
+       /* Display may have been disabled by runtime init */
+       if (!HAS_DISPLAY(i915)) {
+               i915->drm.driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC);
+               i915->display.info.__device_info = &no_display;
+       }
+
+       /* Disable nuclear pageflip by default on pre-g4x */
+       if (!i915->params.nuclear_pageflip &&
+           DISPLAY_VER(i915) < 5 && !IS_G4X(i915))
+               i915->drm.driver_features &= ~DRIVER_ATOMIC;
+}
+
 void intel_display_device_info_print(const struct intel_display_device_info *info,
                                     const struct intel_display_runtime_info *runtime,
                                     struct drm_printer *p)
index d50347e..f30a086 100644 (file)
@@ -338,6 +338,7 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv)
        /* Try to make sure MCHBAR is enabled before poking at it */
        intel_gmch_bar_setup(dev_priv);
        intel_device_info_runtime_init(dev_priv);
+       intel_display_device_info_runtime_init(dev_priv);
 
        for_each_gt(gt, dev_priv, i) {
                ret = intel_gt_init_mmio(gt);
index 61d788c..f068777 100644 (file)
@@ -364,8 +364,6 @@ void intel_device_info_runtime_init_early(struct drm_i915_private *i915)
        intel_device_info_subplatform_init(i915);
 }
 
-static const struct intel_display_device_info no_display = {};
-
 /**
  * intel_device_info_runtime_init - initialize runtime info
  * @dev_priv: the i915 device
@@ -386,21 +384,6 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
 {
        struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv);
 
-       if (HAS_DISPLAY(dev_priv))
-               intel_display_device_info_runtime_init(dev_priv);
-
-       /* Display may have been disabled by runtime init */
-       if (!HAS_DISPLAY(dev_priv)) {
-               dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
-                                                  DRIVER_ATOMIC);
-               dev_priv->display.info.__device_info = &no_display;
-       }
-
-       /* Disable nuclear pageflip by default on pre-g4x */
-       if (!dev_priv->params.nuclear_pageflip &&
-           DISPLAY_VER(dev_priv) < 5 && !IS_G4X(dev_priv))
-               dev_priv->drm.driver_features &= ~DRIVER_ATOMIC;
-
        BUILD_BUG_ON(BITS_PER_TYPE(intel_engine_mask_t) < I915_NUM_ENGINES);
 
        if (GRAPHICS_VER(dev_priv) == 6 && i915_vtd_active(dev_priv)) {