drm/debugfs: Fix framebuffer debugfs file init
authorNoralf Trønnes <noralf@tronnes.org>
Mon, 13 Nov 2017 23:12:01 +0000 (00:12 +0100)
committerJani Nikula <jani.nikula@intel.com>
Tue, 14 Nov 2017 09:08:17 +0000 (11:08 +0200)
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
drivers/gpu/drm/drm_debugfs.c

index 550f29de6c1fc0e2ebfcb1bb5831576545e9b940..b2482818fee8c22c125c5f725d5d2fb6db1fdc91 100644 (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) {