Commit da27bd41 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Reduce INTEL_DISPLAY_ENABLED to just removing the outputs

Having a mode where the display hardware is present but we try
to pretend it isn't just leads to massive headaches when trying
to reason what the fallout might be from skipping some random
bits of programming.

Let's just neuter INTEL_DISPLAY_ENABLED so that we treat the
hardware as fully present, except we just don't register any
outputs. That's still rather sketchy if the outputs are already
enabled when the driver is loaded. I think the simplest solution
would be to probe everything as normal and just return
disconnected" from all .detect() hooks. That would avoid anything
automagically enabling those outputs, but the driver could then
shut things down using the normal codepaths.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200909213824.12390-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent ac03de1f
...@@ -2133,7 +2133,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv) ...@@ -2133,7 +2133,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv)
INIT_LIST_HEAD(&dev_priv->vbt.display_devices); INIT_LIST_HEAD(&dev_priv->vbt.display_devices);
if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) { if (!HAS_DISPLAY(dev_priv)) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"Skipping VBT init due to disabled display.\n"); "Skipping VBT init due to disabled display.\n");
return; return;
......
...@@ -17882,7 +17882,7 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915) ...@@ -17882,7 +17882,7 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915)
if (i915_inject_probe_failure(i915)) if (i915_inject_probe_failure(i915))
return -ENODEV; return -ENODEV;
if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { if (HAS_DISPLAY(i915)) {
ret = drm_vblank_init(&i915->drm, ret = drm_vblank_init(&i915->drm,
INTEL_NUM_PIPES(i915)); INTEL_NUM_PIPES(i915));
if (ret) if (ret)
...@@ -17956,7 +17956,7 @@ int intel_modeset_init_nogem(struct drm_i915_private *i915) ...@@ -17956,7 +17956,7 @@ int intel_modeset_init_nogem(struct drm_i915_private *i915)
INTEL_NUM_PIPES(i915), INTEL_NUM_PIPES(i915),
INTEL_NUM_PIPES(i915) > 1 ? "s" : ""); INTEL_NUM_PIPES(i915) > 1 ? "s" : "");
if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { if (HAS_DISPLAY(i915)) {
for_each_pipe(i915, pipe) { for_each_pipe(i915, pipe) {
ret = intel_crtc_init(i915, pipe); ret = intel_crtc_init(i915, pipe);
if (ret) { if (ret) {
...@@ -18045,7 +18045,7 @@ int intel_modeset_init(struct drm_i915_private *i915) ...@@ -18045,7 +18045,7 @@ int intel_modeset_init(struct drm_i915_private *i915)
intel_overlay_setup(i915); intel_overlay_setup(i915);
if (!HAS_DISPLAY(i915) || !INTEL_DISPLAY_ENABLED(i915)) if (!HAS_DISPLAY(i915))
return 0; return 0;
ret = intel_fbdev_init(&i915->drm); ret = intel_fbdev_init(&i915->drm);
...@@ -19018,7 +19018,7 @@ intel_display_capture_error_state(struct drm_i915_private *dev_priv) ...@@ -19018,7 +19018,7 @@ intel_display_capture_error_state(struct drm_i915_private *dev_priv)
BUILD_BUG_ON(ARRAY_SIZE(transcoders) != ARRAY_SIZE(error->transcoder)); BUILD_BUG_ON(ARRAY_SIZE(transcoders) != ARRAY_SIZE(error->transcoder));
if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) if (!HAS_DISPLAY(dev_priv))
return NULL; return NULL;
error = kzalloc(sizeof(*error), GFP_ATOMIC); error = kzalloc(sizeof(*error), GFP_ATOMIC);
......
...@@ -451,8 +451,7 @@ int intel_fbdev_init(struct drm_device *dev) ...@@ -451,8 +451,7 @@ int intel_fbdev_init(struct drm_device *dev)
struct intel_fbdev *ifbdev; struct intel_fbdev *ifbdev;
int ret; int ret;
if (drm_WARN_ON(dev, !HAS_DISPLAY(dev_priv) || if (drm_WARN_ON(dev, !HAS_DISPLAY(dev_priv)))
!INTEL_DISPLAY_ENABLED(dev_priv)))
return -ENODEV; return -ENODEV;
ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL); ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
......
...@@ -834,7 +834,7 @@ int intel_gmbus_setup(struct drm_i915_private *dev_priv) ...@@ -834,7 +834,7 @@ int intel_gmbus_setup(struct drm_i915_private *dev_priv)
unsigned int pin; unsigned int pin;
int ret; int ret;
if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) if (!HAS_DISPLAY(dev_priv))
return 0; return 0;
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
......
...@@ -677,7 +677,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) ...@@ -677,7 +677,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
drm_err(&dev_priv->drm, drm_err(&dev_priv->drm,
"Failed to register driver for userspace access!\n"); "Failed to register driver for userspace access!\n");
if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) { if (HAS_DISPLAY(dev_priv)) {
/* Must be done after probing outputs */ /* Must be done after probing outputs */
intel_opregion_register(dev_priv); intel_opregion_register(dev_priv);
acpi_video_register(); acpi_video_register();
...@@ -700,7 +700,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) ...@@ -700,7 +700,7 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
* We need to coordinate the hotplugs with the asynchronous fbdev * We need to coordinate the hotplugs with the asynchronous fbdev
* configuration, for which we use the fbdev->async_cookie. * configuration, for which we use the fbdev->async_cookie.
*/ */
if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) if (HAS_DISPLAY(dev_priv))
drm_kms_helper_poll_init(dev); drm_kms_helper_poll_init(dev);
intel_power_domains_enable(dev_priv); intel_power_domains_enable(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