summaryrefslogtreecommitdiff
path: root/tests/gem_mocs_settings.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2017-03-02 10:37:11 +0100
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2017-03-21 15:50:54 +0100
commit301ad44cdf1b868b1ab89096721da91fa8541fdc (patch)
treeef18781db6cadae7f8f49f1fc449dc56b33448ec /tests/gem_mocs_settings.c
parente7a0d06730f77842998368660fb45fe5c1738fda (diff)
lib: Open debugfs files for the given DRM device
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_mocs_settings.c')
-rw-r--r--tests/gem_mocs_settings.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/gem_mocs_settings.c b/tests/gem_mocs_settings.c
index 9faf6c54..a96aa66d 100644
--- a/tests/gem_mocs_settings.c
+++ b/tests/gem_mocs_settings.c
@@ -383,7 +383,7 @@ static void default_context_tests(unsigned mode)
switch (mode) {
case NONE: break;
- case RESET: igt_force_gpu_reset(); break;
+ case RESET: igt_force_gpu_reset(fd); break;
case SUSPEND: igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_NONE); break;
case HIBERNATE: igt_system_suspend_autoresume(SUSPEND_STATE_DISK,
@@ -424,7 +424,7 @@ static void default_dirty_tests(unsigned mode)
switch (mode) {
case NONE: break;
- case RESET: igt_force_gpu_reset(); break;
+ case RESET: igt_force_gpu_reset(fd); break;
case SUSPEND: igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_NONE); break;
case HIBERNATE: igt_system_suspend_autoresume(SUSPEND_STATE_DISK,
@@ -449,7 +449,7 @@ static void context_save_restore_test(unsigned mode)
switch (mode) {
case NONE: break;
- case RESET: igt_force_gpu_reset(); break;
+ case RESET: igt_force_gpu_reset(fd); break;
case SUSPEND: igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_NONE); break;
case HIBERNATE: igt_system_suspend_autoresume(SUSPEND_STATE_DISK,
@@ -494,7 +494,7 @@ static void context_dirty_test(unsigned mode)
switch (mode) {
case NONE: break;
- case RESET: igt_force_gpu_reset(); break;
+ case RESET: igt_force_gpu_reset(fd); break;
case SUSPEND: igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_NONE); break;
case HIBERNATE: igt_system_suspend_autoresume(SUSPEND_STATE_DISK,
@@ -514,10 +514,14 @@ static void context_dirty_test(unsigned mode)
static void run_tests(unsigned mode)
{
struct pci_device *pci_dev;
+ int fd;
pci_dev = intel_get_pci_device();
igt_require(pci_dev);
- intel_register_access_init(pci_dev, 0);
+
+ fd = drm_open_driver_master(DRIVER_INTEL);
+ intel_register_access_init(pci_dev, 0, fd);
+ close(fd);
default_context_tests(mode);
default_dirty_tests(mode);