From f26d8a04c3938845d4db07cf6587b29e287dc2dc Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 27 Feb 2015 15:05:39 -0300 Subject: tests/pm_rpm: I2C VGA detection is unreliable We fail to detect some VGA monitors using our I2C method, leading to bug reports from QA. If you look at the dmesg of these cases, you'll see the Kernel complaining about EDID reading mostly FFs and then disabling bit-mangling. Since we don't want to reimplement everything the Kernel does, let's just accept the fact that some VGA outputs won't be properly detected. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84273 Signed-off-by: Paulo Zanoni --- tests/pm_rpm.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index c2847d01..db8f4277 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -636,12 +636,35 @@ static int count_i2c_valid_edids(void) return ret; } +static int count_vga_outputs(struct mode_set_data *data) +{ + int i, count = 0; + + for (i = 0; i < data->res->count_connectors; i++) + if (data->connectors[i]->connector_type == + DRM_MODE_CONNECTOR_VGA) + count++; + + return count; +} + static void test_i2c(struct mode_set_data *data) { int i2c_edids = count_i2c_valid_edids(); int drm_edids = count_drm_valid_edids(data); - - igt_assert_eq(i2c_edids, drm_edids); + int vga_outputs = count_vga_outputs(data); + int diff; + + igt_debug("i2c edids:%d drm edids:%d vga outputs:%d\n", + i2c_edids, drm_edids, vga_outputs); + + /* We fail to detect some VGA monitors using our i2c method. If you look + * at the dmesg of these cases, you'll see the Kernel complaining about + * the EDID reading mostly FFs and then disabling bit-banging. Since we + * don't want to reimplement everything the Kernel does, let's just + * accept the fact that some VGA outputs won't be properly detected. */ + diff = drm_edids - i2c_edids; + igt_assert(diff <= vga_outputs && diff >= 0); } static void setup_pc8(void) -- cgit v1.2.3