summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorMark Yacoub <markyacoub@google.com>2021-11-10 14:53:02 -0500
committerMark Yacoub <markyacoub@google.com>2021-11-11 17:37:08 +0000
commitda501a6e8f9776b52312774bfb239b058ce96c77 (patch)
tree0ac603ab0b41280de24693fe00b26a5c9e1884fe /tests/kms_rotation_crc.c
parent93e3cdbea55741ddbd92c54ffbe07d40c743483e (diff)
tests: Remove restrictions on tests running only DRIVER_INTEL and DRIVER_AMDGPU
[Why] Drivers such as MSM are able to run tests that are made generic through supporting another driver that's not i915. Removing the restriction that enables the test on a 2 drivers only allow the tests to run on other drivers. [How] 1. Replace DRIVER_INTEL | DRIVER_AMDGPU by DRIVER_ANY 2. Make the checks more broad to allow intel generic implementation to work on all drivers while keeping special amdgpu's quirks. Tested on Trogdor (MSM) Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index ae477b60..37f6abe9 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -300,15 +300,15 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_plane_set_position(plane, data->pos_x, data->pos_y);
igt_display_commit2(display, COMMIT_ATOMIC);
- if (is_i915_device(data->gfx_fd)) {
+ if (is_amdgpu_device(data->gfx_fd)) {
+ igt_pipe_crc_collect_crc(
+ data->pipe_crc,
+ &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
+ } else {
igt_pipe_crc_get_current(
display->drm_fd, data->pipe_crc,
&data->crc_rect[data->output_crc_in_use][rect].flip_crc);
igt_remove_fb(data->gfx_fd, &data->fb_flip);
- } else if (is_amdgpu_device(data->gfx_fd)) {
- igt_pipe_crc_collect_crc(
- data->pipe_crc,
- &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
}
/*
@@ -323,13 +323,15 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_plane_set_position(plane, data->pos_x, data->pos_y);
igt_display_commit2(display, COMMIT_ATOMIC);
- if (is_i915_device(data->gfx_fd)) {
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
- &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
- } else if (is_amdgpu_device(data->gfx_fd)) {
- igt_pipe_crc_collect_crc(data->pipe_crc,
- &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
+ if (is_amdgpu_device(data->gfx_fd)) {
+ igt_pipe_crc_collect_crc(
+ data->pipe_crc,
+ &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
igt_remove_fb(data->gfx_fd, &data->fb_flip);
+ } else {
+ igt_pipe_crc_get_current(
+ display->drm_fd, data->pipe_crc,
+ &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
}
data->crc_rect[data->output_crc_in_use][rect].valid = true;
}
@@ -388,12 +390,15 @@ static void test_single_case(data_t *data, enum pipe pipe,
igt_assert_eq(ret, 0);
/* Check CRC */
- if (is_i915_device(data->gfx_fd))
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
- else if (is_amdgpu_device(data->gfx_fd))
+ if (is_amdgpu_device(data->gfx_fd)) {
igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
- igt_assert_crc_equal(&data->crc_rect[data->output_crc_in_use][rect].ref_crc,
- &crc_output);
+ } else {
+ igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+ &crc_output);
+ }
+ igt_assert_crc_equal(
+ &data->crc_rect[data->output_crc_in_use][rect].ref_crc,
+ &crc_output);
/*
* If flips are requested flip to a different fb and
@@ -415,10 +420,13 @@ static void test_single_case(data_t *data, enum pipe pipe,
igt_assert_eq(ret, 0);
}
kmstest_wait_for_pageflip(data->gfx_fd);
- if (is_i915_device(data->gfx_fd))
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
- else if (is_amdgpu_device(data->gfx_fd))
+
+ if (is_amdgpu_device(data->gfx_fd)) {
igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
+ } else {
+ igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+ &crc_output);
+ }
igt_assert_crc_equal(&data->crc_rect[data->output_crc_in_use][rect].flip_crc,
&crc_output);
}
@@ -524,7 +532,9 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
/* Only support partial covering primary plane on gen9+ */
if (is_amdgpu_device(data->gfx_fd) ||
(plane_type == DRM_PLANE_TYPE_PRIMARY &&
- intel_display_ver(intel_get_drm_devid(data->gfx_fd)) < 9)) {
+ is_i915_device(data->gfx_fd) &&
+ intel_display_ver(
+ intel_get_drm_devid(data->gfx_fd)) < 9)) {
if (i != rectangle)
continue;
else
@@ -1038,7 +1048,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
int gen = 0;
igt_fixture {
- data.gfx_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_AMDGPU);
+ data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
if (is_i915_device(data.gfx_fd)) {
data.devid = intel_get_drm_devid(data.gfx_fd);
gen = intel_display_ver(data.devid);