[igt-dev] [PATCH i-g-t] tests: Use igt_display_require

Daniel Vetter
2018-11-06T22:18:36Z

Remaining tests that have been overlooked and don't need any
invasive changes to limit the skipping to only the relevant parts.

v2: [A rebase gone wrong]

v3: Move the misplaced hunk to the right patch (Antonio).

Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
lib/igt_chamelium.c | 2 +-
tests/kms_atomic_interruptible.c | 4 ++--
tests/kms_force_connector_basic.c | 2 +-
tests/kms_getfb.c | 2 +-
tests/kms_plane_alpha_blend.c | 2 +-
tests/perf_pmu.c | 2 +-
tests/pm_backlight.c | 2 +-
tests/prime_mmap_kms.c | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index a80ead163846..d136fb04c342 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -1547,7 +1547,7 @@ static void chamelium_exit_handler(int sig)
/**
* chamelium_init:
* @chamelium: The Chamelium instance to use
- * @drm_fd: a display initialized with #igt_display_init
+ * @drm_fd: a display initialized with #igt_display_require
*
* Sets up a connection with a chamelium, using the URL specified in the
* Chamelium configuration. This must be called first before trying to use the
diff --git a/tests/kms_atomic_interruptible.c b/tests/kms_atomic_interruptible.c
index 8e9d4cb69c4d..be688638973f 100644
--- a/tests/kms_atomic_interruptible.c
+++ b/tests/kms_atomic_interruptible.c
@@ -85,8 +85,8 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t

/*
* Make sure we start with everything disabled to force a real modeset.
- * igt_display_init only sets sw state, and assumes the first test doesn't care
- * about hw state.
+ * igt_display_require only sets sw state, and assumes the first test
+ * doesn't care about hw state.
*/
igt_display_commit2(display, COMMIT_ATOMIC);

diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index e9325dec9305..b8246e669939 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -217,7 +217,7 @@ int main(int argc, char **argv)

/* attempt to use the display */
kmstest_set_vt_graphics_mode();
- igt_display_init(&display, drm_fd);
+ igt_display_require(&display, drm_fd);
igt_display_commit(&display);
igt_display_fini(&display);

diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 07ffd79c4613..ca0b01c05e5c 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -116,7 +116,7 @@ static uint32_t get_any_prop_id(int fd)
{
igt_display_t display;

- igt_display_init(&display, fd);
+ igt_display_require(&display, fd);
for (int i = 0; i < display.n_outputs; i++) {
igt_output_t *output = &display.outputs[i];
if (output->props[IGT_CONNECTOR_DPMS] != 0)
diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index 3fab118ae0e1..1d9d8933d7e2 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -565,7 +565,7 @@ igt_main
igt_fixture {
data.gfx_fd = drm_open_driver(DRIVER_ANY);
igt_require_pipe_crc(data.gfx_fd);
- igt_display_init(&data.display, data.gfx_fd);
+ igt_display_require(&data.display, data.gfx_fd);
igt_require(data.display.is_atomic);
}

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index b34bc66ce2c4..21292bf3a2fe 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -811,7 +811,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));

kmstest_set_vt_graphics_mode();
- igt_display_init(&data.display, gem_fd);
+ igt_display_require(&data.display, gem_fd);

/**
* We will use the display to render event forwarind so need to
diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
index 32808cdf6ca4..054300f6e2e1 100644
--- a/tests/pm_backlight.c
+++ b/tests/pm_backlight.c
@@ -214,7 +214,7 @@ igt_main
* try to enable all.
*/
kmstest_set_vt_graphics_mode();
- igt_display_init(&display, drm_open_driver(DRIVER_INTEL));
+ igt_display_require(&display, drm_open_driver(DRIVER_INTEL));

/* should be ../../cardX-$output */
igt_assert_lt(12, readlink(BACKLIGHT_PATH "/device", full_name, sizeof(full_name) - 1));
diff --git a/tests/prime_mmap_kms.c b/tests/prime_mmap_kms.c
index faace4afd478..fdc37214d96d 100644
--- a/tests/prime_mmap_kms.c
+++ b/tests/prime_mmap_kms.c
@@ -248,7 +248,7 @@ igt_main

igt_require_pipe_crc(gpu.drm_fd);

- igt_display_init(&gpu.display, gpu.drm_fd);
+ igt_display_require(&gpu.display, gpu.drm_fd);
}

igt_subtest("buffer-sharing")
--
2.19.1