Commit 356b9409 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler Committed by Petri Latvala

tests/kms_plane: Print count of mismatched colors

Currently we are printing one igt_warn for each CRC mismatch, which gets
quite overwhelming with having to see the same error 8 times for each
color tested:

WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3
WARNING: CRC mismatch with format NV12 (0x3231564e) on A.3

Since the most interesting information here is which format on which
pipe/plane is broken we can skip igt_warn just once.

For those weirder and rarer case where just certain colors would fail we
still provide the count and the mask of color array indices that failed:

WARNING: CRC mismatches with format NV12 (0x3231564e) on A.3 with 8/8 solid colors tested (0xFF)

v2 (Petri): Print a mask so it's possible to know which colors failed.

Cc: Martin Peres <martin.peres@linux.intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: 's avatarMartin Peres <martin.peres@linux.intel.com>
Signed-off-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
Acked-by: Dhinakaran Pandiyan's avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
parent 71ad19eb
......@@ -547,6 +547,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
}
for (int i = 0; i < plane->drm_plane->count_formats; i++) {
int crc_mismatch_count = 0;
int crc_mismatch_mask = 0;
igt_crc_t crc;
format = plane->drm_plane->formats[i];
......@@ -562,21 +564,22 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
kmstest_pipe_name(pipe), plane->index);
for (int j = 0; j < ARRAY_SIZE(colors); j++) {
bool crc_equal;
test_format_plane_color(data, pipe, plane,
format, width, height,
dst_w, dst_h,
j, &crc, &fb);
crc_equal = igt_check_crc_equal(&crc, &ref_crc[j]);
result &= crc_equal;
if (!crc_equal)
igt_warn("CRC mismatch with format " IGT_FORMAT_FMT " on %s.%u\n",
IGT_FORMAT_ARGS(format),
kmstest_pipe_name(pipe), plane->index);
if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
crc_mismatch_count++;
crc_mismatch_mask |= (1 << j);
result = false;
}
}
if (crc_mismatch_count)
igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
}
igt_pipe_crc_stop(data->pipe_crc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment