Commit b8eed6a4 authored by Jani Nikula's avatar Jani Nikula

drm/i915: separate display runtime info init

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: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a2226a47a4450e75d867c2ac48665b387af0e42d.1696336887.git.jani.nikula@intel.com
parent 5e72e75d
...@@ -939,7 +939,7 @@ void intel_display_device_probe(struct drm_i915_private *i915) ...@@ -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); struct intel_display_runtime_info *display_runtime = DISPLAY_RUNTIME_INFO(i915);
enum pipe pipe; enum pipe pipe;
...@@ -1071,6 +1071,23 @@ void intel_display_device_info_runtime_init(struct drm_i915_private *i915) ...@@ -1071,6 +1071,23 @@ void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
memset(display_runtime, 0, sizeof(*display_runtime)); 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, void intel_display_device_info_print(const struct intel_display_device_info *info,
const struct intel_display_runtime_info *runtime, const struct intel_display_runtime_info *runtime,
struct drm_printer *p) struct drm_printer *p)
......
...@@ -338,6 +338,7 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv) ...@@ -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 */ /* Try to make sure MCHBAR is enabled before poking at it */
intel_gmch_bar_setup(dev_priv); intel_gmch_bar_setup(dev_priv);
intel_device_info_runtime_init(dev_priv); intel_device_info_runtime_init(dev_priv);
intel_display_device_info_runtime_init(dev_priv);
for_each_gt(gt, dev_priv, i) { for_each_gt(gt, dev_priv, i) {
ret = intel_gt_init_mmio(gt); ret = intel_gt_init_mmio(gt);
......
...@@ -364,8 +364,6 @@ void intel_device_info_runtime_init_early(struct drm_i915_private *i915) ...@@ -364,8 +364,6 @@ void intel_device_info_runtime_init_early(struct drm_i915_private *i915)
intel_device_info_subplatform_init(i915); intel_device_info_subplatform_init(i915);
} }
static const struct intel_display_device_info no_display = {};
/** /**
* intel_device_info_runtime_init - initialize runtime info * intel_device_info_runtime_init - initialize runtime info
* @dev_priv: the i915 device * @dev_priv: the i915 device
...@@ -386,21 +384,6 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv) ...@@ -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); 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); BUILD_BUG_ON(BITS_PER_TYPE(intel_engine_mask_t) < I915_NUM_ENGINES);
if (GRAPHICS_VER(dev_priv) == 6 && i915_vtd_active(dev_priv)) { if (GRAPHICS_VER(dev_priv) == 6 && i915_vtd_active(dev_priv)) {
......
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