drm/debugfs: Fix framebuffer debugfs file init

The introduction of: drm/framebuffer: Add framebuffer debugfs file
broke vgem. That patch assumed that all drivers had initialized the
dev->mode_config.fb_lock mutex which happens in drm_mode_config_init().
vgem doesn't need to call drm_mode_config_init().

Fix this by only creating the framebuffer debugfs file for modesetting
drivers.

Fixes: 45d58b4029 ("drm/framebuffer: Add framebuffer debugfs file")
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171113231201.26177-1-noralf@tronnes.org
This commit is contained in:
Noralf Trønnes 2017-11-14 00:12:01 +01:00 committed by Jani Nikula
parent 5d276a1aca
commit 0c51ef8684

View file

@ -158,10 +158,12 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
}
}
ret = drm_framebuffer_debugfs_init(minor);
if (ret) {
DRM_ERROR("Failed to create framebuffer debugfs file\n");
return ret;
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = drm_framebuffer_debugfs_init(minor);
if (ret) {
DRM_ERROR("Failed to create framebuffer debugfs file\n");
return ret;
}
}
if (dev->driver->debugfs_init) {