svn commit: r258323 - user/ed/newcons/sys/dev/drm2

Aleksandr Rybalko ray at FreeBSD.org
Mon Nov 18 22:35:02 UTC 2013


Author: ray
Date: Mon Nov 18 22:35:02 2013
New Revision: 258323
URL: http://svnweb.freebsd.org/changeset/base/258323

Log:
  Move mode_config up one level. DRM drivers call drm_fb_helper_restore_fbdev_mode
  	with that lock already held.
  
  Suggested by:	avg
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/ed/newcons/sys/dev/drm2/drm_fb_helper.c

Modified: user/ed/newcons/sys/dev/drm2/drm_fb_helper.c
==============================================================================
--- user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Mon Nov 18 22:18:07 2013	(r258322)
+++ user/ed/newcons/sys/dev/drm2/drm_fb_helper.c	Mon Nov 18 22:35:02 2013	(r258323)
@@ -49,10 +49,14 @@ static void vt_restore_fbdev_mode(void *
 static void
 vt_restore_fbdev_mode(void *arg, int pending)
 {
+	struct drm_fb_helper *fb_helper;
 	struct vt_kms_softc *sc;
 
 	sc = (struct vt_kms_softc *)arg;
-	drm_fb_helper_restore_fbdev_mode(sc->fb_helper);
+	fb_helper = sc->fb_helper;
+	sx_xlock(&fb_helper->dev->mode_config.mutex);
+	drm_fb_helper_restore_fbdev_mode(fb_helper);
+	sx_xunlock(&fb_helper->dev->mode_config.mutex);
 }
 
 static int
@@ -385,9 +389,7 @@ bool drm_fb_helper_restore_fbdev_mode(st
 	int i, ret;
 	for (i = 0; i < fb_helper->crtc_count; i++) {
 		struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
-		sx_xlock(&fb_helper->dev->mode_config.mutex);
 		ret = drm_crtc_helper_set_config(mode_set);
-		sx_xunlock(&fb_helper->dev->mode_config.mutex);
 		if (ret)
 			error = true;
 	}


More information about the svn-src-user mailing list