Add some sysctl info so that we can see what is going on with vblanks.
authorHasso Tepper <hasso@estpak.ee>
Tue, 23 Jun 2009 22:12:05 +0000 (01:12 +0300)
committerHasso Tepper <hasso@estpak.ee>
Wed, 24 Jun 2009 20:05:06 +0000 (23:05 +0300)
Obtained-from: FreeBSD

sys/dev/drm/drm_sysctl.c

index 4f4aeb1..e825003 100644 (file)
@@ -35,6 +35,7 @@ static int       drm_name_info DRM_SYSCTL_HANDLER_ARGS;
 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;
@@ -44,6 +45,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]))
 
@@ -310,3 +312,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;
+}