summaryrefslogtreecommitdiff
path: root/tests/kms_plane_multiple.c
diff options
context:
space:
mode:
authorMika Kahola <mika.kahola@intel.com>2017-08-02 16:20:55 +0300
committerMika Kahola <mika.kahola@intel.com>2017-08-03 10:26:51 +0300
commit8d4ddaee1371ef4f027466031cc5dd0d65593651 (patch)
tree3bb13dd35db2c5cbc963f758b942b269d29eaa47 /tests/kms_plane_multiple.c
parent0fbe924227529c05712daaac78a028673b4396b2 (diff)
tests/kms_plane_multiple: Fix reference CRC
kms_plane_multiple wrongly expected that igt lib function would modify the passed igt_crc_t* object. You should use igt_crc_t** instead. This patch fixes this anomaly in the test. While at it, remove unnecesary struct for test data as we only need reference CRC here. The problem was caught by CI system and at least affects on HSW platform. V2: Don't change function that collects CRC for reference CRC Fix CRC pointers Remove unnecessary struct for holding test data Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101907 Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
Diffstat (limited to 'tests/kms_plane_multiple.c')
-rw-r--r--tests/kms_plane_multiple.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index f6c62235..4bc26b73 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -51,11 +51,6 @@ typedef struct {
struct igt_fb *fb;
} data_t;
-typedef struct {
- data_t *data;
- igt_crc_t reference_crc;
-} test_position_t;
-
/* Command line parameters. */
struct {
int iterations;
@@ -106,7 +101,7 @@ static void test_fini(data_t *data, igt_output_t *output, int n_planes)
static void
test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic,
- color_t *color, uint64_t tiling, igt_crc_t *crc /* out */)
+ color_t *color, uint64_t tiling, igt_crc_t **crc /* out */)
{
drmModeModeInfo *mode;
igt_plane_t *primary;
@@ -132,7 +127,7 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic,
igt_skip_on(ret != 0);
igt_pipe_crc_start(data->pipe_crc);
- n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, &crc);
+ n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, crc);
igt_assert_eq(n, 1);
}
@@ -251,8 +246,8 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
{
char buf[256];
struct drm_event *e = (void *)buf;
- test_position_t test = { .data = data };
color_t blue = { 0.0f, 0.0f, 1.0f };
+ igt_crc_t *ref = NULL;
igt_crc_t *crc = NULL;
unsigned int vblank_start, vblank_stop;
int i, n, ret;
@@ -275,8 +270,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
test_init(data, pipe, n_planes);
- test_grab_crc(data, output, pipe, true, &blue, tiling,
- &test.reference_crc);
+ test_grab_crc(data, output, pipe, true, &blue, tiling, &ref);
i = 0;
while (i < iterations || loop_forever) {
@@ -303,7 +297,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
igt_assert(vblank_stop - vblank_start <= MAX_CRCS);
igt_assert_eq(n, vblank_stop - vblank_start);
- igt_assert_crc_equal(&test.reference_crc, crc);
+ igt_assert_crc_equal(ref, crc);
i++;
}
@@ -318,9 +312,9 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,
igt_output_t *output, int n_planes,
uint64_t tiling)
{
- test_position_t test = { .data = data };
color_t blue = { 0.0f, 0.0f, 1.0f };
- igt_crc_t *crc;
+ igt_crc_t *ref = NULL;
+ igt_crc_t *crc = NULL;
int i, n;
int iterations = opt.iterations < 1 ? 1 : opt.iterations;
bool loop_forever;
@@ -341,8 +335,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,
test_init(data, pipe, n_planes);
- test_grab_crc(data, output, pipe, false, &blue, tiling,
- &test.reference_crc);
+ test_grab_crc(data, output, pipe, false, &blue, tiling, &ref);
i = 0;
while (i < iterations || loop_forever) {
@@ -354,7 +347,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe,
igt_assert_eq(n, MAX_CRCS);
- igt_assert_crc_equal(&test.reference_crc, crc);
+ igt_assert_crc_equal(ref, crc);
i++;
}