lib: extract igt_open_forcewake_handle

... and I immediately regret that I've killed the return value
for igt_debugfs_init, since we have callers which need to work
without the forcewake stuff, e.g. the reg dumper needs to work
without i915 loaded.

Put this new helper to good use in the mmio code and the pm_pc8
testcase.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2014-03-14 16:00:22 +01:00
parent 553d594b6e
commit ea18fc16cd
4 changed files with 45 additions and 58 deletions
+3 -2
View File
@@ -46,6 +46,7 @@
#include "intel_gpu_tools.h"
#include "i915_drm.h"
#include "igt_kms.h"
#include "igt_debugfs.h"
#define MSR_PC8_RES 0x630
#define MSR_PC9_RES 0x631
@@ -1009,8 +1010,8 @@ static void debugfs_forcewake_user_subtest(void)
disable_all_screens(&ms_data);
igt_assert(wait_for_suspended());
fd = open("/sys/kernel/debug/dri/0/i915_forcewake_user", O_RDONLY);
igt_require(fd);
fd = igt_open_forcewake_handle();
igt_require(fd >= 0);
if (has_runtime_pm) {
igt_assert(wait_for_active());