Commit 949ab9d2 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/i915: Guard debugfs against invalid access without display

Do not create the display debugfs files when we don't have display.

Based on previous patch by José Souza.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201027044618.719064-1-lucas.demarchi@intel.com
parent b18c1eb9
...@@ -671,7 +671,8 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) ...@@ -671,7 +671,8 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
/* Reveal our presence to userspace */ /* Reveal our presence to userspace */
if (drm_dev_register(dev, 0) == 0) { if (drm_dev_register(dev, 0) == 0) {
i915_debugfs_register(dev_priv); i915_debugfs_register(dev_priv);
intel_display_debugfs_register(dev_priv); if (HAS_DISPLAY(dev_priv))
intel_display_debugfs_register(dev_priv);
i915_setup_sysfs(dev_priv); i915_setup_sysfs(dev_priv);
/* Depends on sysfs having been initialized */ /* Depends on sysfs having been initialized */
......
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