tests/drv_suspend: new forcewake subtest
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Mar 2014 15:07:28 +0000 (16:07 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Mar 2014 15:13:09 +0000 (16:13 +0100)
I suspect that currently we have an issue in there with the runtime PM
refcounting, but silly me developed this on a machine with runtime PM
support ...

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/drv_suspend.c

index 9b3df2b..400c34b 100644 (file)
@@ -37,6 +37,7 @@
 #include "drm.h"
 #include "i915_drm.h"
 #include "drmtest.h"
+#include "igt_debugfs.h"
 
 #define OBJECT_SIZE (16*1024*1024)
 
@@ -145,6 +146,17 @@ test_sysfs_reader(void)
        igt_stop_helper(&reader);
 }
 
+static void
+test_forcewake(void)
+{
+       int fw_fd;
+
+       fw_fd = igt_open_forcewake_handle();
+       igt_assert(fw_fd >= 0);
+       igt_system_suspend_autoresume();
+       close (fw_fd);
+}
+
 int fd;
 
 igt_main
@@ -166,6 +178,9 @@ igt_main
        igt_subtest("sysfs-reader")
                test_sysfs_reader();
 
+       igt_subtest("forcewake")
+               test_forcewake();
+
        igt_fixture
                close(fd);
 }