Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200909213824.12390-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

+9 -10
+1 -1
drivers/gpu/drm/i915/display/intel_bios.c
··· 2133 2133 2134 2134 INIT_LIST_HEAD(&dev_priv->vbt.display_devices); 2135 2135 2136 - if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) { 2136 + if (!HAS_DISPLAY(dev_priv)) { 2137 2137 drm_dbg_kms(&dev_priv->drm, 2138 2138 "Skipping VBT init due to disabled display.\n"); 2139 2139 return;
+4 -4
drivers/gpu/drm/i915/display/intel_display.c
··· 17882 17882 if (i915_inject_probe_failure(i915)) 17883 17883 return -ENODEV; 17884 17884 17885 - if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { 17885 + if (HAS_DISPLAY(i915)) { 17886 17886 ret = drm_vblank_init(&i915->drm, 17887 17887 INTEL_NUM_PIPES(i915)); 17888 17888 if (ret) ··· 17956 17956 INTEL_NUM_PIPES(i915), 17957 17957 INTEL_NUM_PIPES(i915) > 1 ? "s" : ""); 17958 17958 17959 - if (HAS_DISPLAY(i915) && INTEL_DISPLAY_ENABLED(i915)) { 17959 + if (HAS_DISPLAY(i915)) { 17960 17960 for_each_pipe(i915, pipe) { 17961 17961 ret = intel_crtc_init(i915, pipe); 17962 17962 if (ret) { ··· 18045 18045 18046 18046 intel_overlay_setup(i915); 18047 18047 18048 - if (!HAS_DISPLAY(i915) || !INTEL_DISPLAY_ENABLED(i915)) 18048 + if (!HAS_DISPLAY(i915)) 18049 18049 return 0; 18050 18050 18051 18051 ret = intel_fbdev_init(&i915->drm); ··· 19018 19018 19019 19019 BUILD_BUG_ON(ARRAY_SIZE(transcoders) != ARRAY_SIZE(error->transcoder)); 19020 19020 19021 - if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) 19021 + if (!HAS_DISPLAY(dev_priv)) 19022 19022 return NULL; 19023 19023 19024 19024 error = kzalloc(sizeof(*error), GFP_ATOMIC);
+1 -2
drivers/gpu/drm/i915/display/intel_fbdev.c
··· 451 451 struct intel_fbdev *ifbdev; 452 452 int ret; 453 453 454 - if (drm_WARN_ON(dev, !HAS_DISPLAY(dev_priv) || 455 - !INTEL_DISPLAY_ENABLED(dev_priv))) 454 + if (drm_WARN_ON(dev, !HAS_DISPLAY(dev_priv))) 456 455 return -ENODEV; 457 456 458 457 ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
+1 -1
drivers/gpu/drm/i915/display/intel_gmbus.c
··· 834 834 unsigned int pin; 835 835 int ret; 836 836 837 - if (!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)) 837 + if (!HAS_DISPLAY(dev_priv)) 838 838 return 0; 839 839 840 840 if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
+2 -2
drivers/gpu/drm/i915/i915_drv.c
··· 677 677 drm_err(&dev_priv->drm, 678 678 "Failed to register driver for userspace access!\n"); 679 679 680 - if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) { 680 + if (HAS_DISPLAY(dev_priv)) { 681 681 /* Must be done after probing outputs */ 682 682 intel_opregion_register(dev_priv); 683 683 acpi_video_register(); ··· 700 700 * We need to coordinate the hotplugs with the asynchronous fbdev 701 701 * configuration, for which we use the fbdev->async_cookie. 702 702 */ 703 - if (HAS_DISPLAY(dev_priv) && INTEL_DISPLAY_ENABLED(dev_priv)) 703 + if (HAS_DISPLAY(dev_priv)) 704 704 drm_kms_helper_poll_init(dev); 705 705 706 706 intel_power_domains_enable(dev_priv);