drm/fb-helper: Drop locking from the vsync wait ioctl code
authorDaniel Vetter <[email protected]>
Tue, 4 Jul 2017 15:18:25 +0000 (17:18 +0200)
committerDaniel Vetter <[email protected]>
Thu, 6 Jul 2017 08:01:19 +0000 (10:01 +0200)
Like with the drm-native vblank wait ioctl we can entirely rely on the
spinlocks in drm_vblank.c, no need at all to take expensive mutexes.
The only reason we had to take mode_config.mutex was to protect the
fbdev helper's data-structures, but that's now done by
fb_helper->lock.

Cc: John Stultz <[email protected]>
Cc: Thierry Reding <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_fb_helper.c

index 08a5e0d23a4288a84cc0f404ca7d5d84ebd546f6..9efb17c3cbe8ccf1b758ad7e3932335b98066bff 100644 (file)
@@ -1328,7 +1328,6 @@ int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
                goto unlock;
        }
 
-       mutex_lock(&dev->mode_config.mutex);
        switch (cmd) {
        case FBIO_WAITFORVSYNC:
                /*
@@ -1368,7 +1367,6 @@ int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
        }
 
 unlock:
-       mutex_unlock(&dev->mode_config.mutex);
        mutex_unlock(&fb_helper->lock);
        return ret;
 }