Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 20:19:02 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194759 - head/sys/dev/drm
Message-ID:  <200906232019.n5NKJ2IY088834@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Tue Jun 23 20:19:02 2009
New Revision: 194759
URL: http://svn.freebsd.org/changeset/base/194759

Log:
  Add some sysctl info so that we can see what is going on with vblanks.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_sysctl.c

Modified: head/sys/dev/drm/drm_sysctl.c
==============================================================================
--- head/sys/dev/drm/drm_sysctl.c	Tue Jun 23 20:17:24 2009	(r194758)
+++ head/sys/dev/drm/drm_sysctl.c	Tue Jun 23 20:19:02 2009	(r194759)
@@ -38,6 +38,7 @@ static int	   drm_name_info DRM_SYSCTL_H
 static int	   drm_vm_info DRM_SYSCTL_HANDLER_ARGS;
 static int	   drm_clients_info DRM_SYSCTL_HANDLER_ARGS;
 static int	   drm_bufs_info DRM_SYSCTL_HANDLER_ARGS;
+static int	   drm_vblank_info DRM_SYSCTL_HANDLER_ARGS;
 
 struct drm_sysctl_list {
 	const char *name;
@@ -47,6 +48,7 @@ struct drm_sysctl_list {
 	{"vm",	    drm_vm_info},
 	{"clients", drm_clients_info},
 	{"bufs",    drm_bufs_info},
+	{"vblank",    drm_vblank_info},
 };
 #define DRM_SYSCTL_ENTRIES (sizeof(drm_sysctl_list)/sizeof(drm_sysctl_list[0]))
 
@@ -313,3 +315,25 @@ done:
 	free(tempprivs, DRM_MEM_DRIVER);
 	return retcode;
 }
+
+static int drm_vblank_info DRM_SYSCTL_HANDLER_ARGS
+{
+	struct drm_device *dev = arg1;
+	char buf[128];
+	int retcode;
+	int i;
+
+	DRM_SYSCTL_PRINT("\ncrtc ref count    last     enabled inmodeset\n");
+	for(i = 0 ; i < dev->num_crtcs ; i++) {
+		DRM_SYSCTL_PRINT("  %02d  %02d %08d %08d %02d      %02d\n",
+		    i, atomic_load_acq_32(&dev->vblank[i].refcount),
+		    atomic_load_acq_32(&dev->vblank[i].count),
+		    atomic_load_acq_32(&dev->vblank[i].last),
+		    atomic_load_acq_int(&dev->vblank[i].enabled),
+		    atomic_load_acq_int(&dev->vblank[i].inmodeset));
+	}
+
+	SYSCTL_OUT(req, "", -1);
+done:
+	return retcode;
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906232019.n5NKJ2IY088834>