summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-12-03 15:03:02 -0200
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2013-12-11 13:36:02 -0200
commit36f017dfd1a12bcdf03f928ca02e9053f3622efc (patch)
treed31ddd9dd884dc79abc262585b5bb4b66fea8868 /tests
parent13ef9e8d5453f0902e3025981b9cfd68558ff7e1 (diff)
tests/kms_setmode: avoid 2 connectors on the same encoder
Don't try to set modes on two connectors that share the same encoder. That will just fail. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68463 Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_setmode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 3d18fc7b..e1c9c5a6 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -275,6 +275,7 @@ static void setup_crtcs(drmModeRes *resources, struct connector_config *cconf,
int crtc_count;
bool config_valid;
int i;
+ int encoder_usage_count[resources->count_encoders];
i = 0;
crtc_count = 0;
@@ -337,6 +338,20 @@ static void setup_crtcs(drmModeRes *resources, struct connector_config *cconf,
crtc++;
}
+ memset(encoder_usage_count, 0, sizeof(encoder_usage_count));
+ for (i = 0; i < connector_count; i++) {
+ drmModeConnector *connector = cconf[i].connector;
+ drmModeEncoder *encoder;
+
+ igt_assert(connector->count_encoders == 1);
+ encoder = drmModeGetEncoder(drm_fd, connector->encoders[0]);
+ encoder_usage_count[get_encoder_idx(resources, encoder)]++;
+ drmModeFreeEncoder(encoder);
+ }
+ for (i = 0; i < resources->count_encoders; i++)
+ if (encoder_usage_count[i] > 1)
+ config_valid = false;
+
*crtc_count_ret = crtc_count;
*config_valid_ret = config_valid;
}