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

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: 45d58b40292b ("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

authored by

Noralf Trønnes and committed by
Jani Nikula
0c51ef86 5d276a1a

+6 -4
+6 -4
drivers/gpu/drm/drm_debugfs.c
··· 158 158 } 159 159 } 160 160 161 - ret = drm_framebuffer_debugfs_init(minor); 162 - if (ret) { 163 - DRM_ERROR("Failed to create framebuffer debugfs file\n"); 164 - return ret; 161 + if (drm_core_check_feature(dev, DRIVER_MODESET)) { 162 + ret = drm_framebuffer_debugfs_init(minor); 163 + if (ret) { 164 + DRM_ERROR("Failed to create framebuffer debugfs file\n"); 165 + return ret; 166 + } 165 167 } 166 168 167 169 if (dev->driver->debugfs_init) {