From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH IGT] tests/kms_setmode: avoid 2 connectors on the same encoder
Date: Tue, 3 Dec 2013 15:38:18 -0200 [thread overview]
Message-ID: <1386092298-13113-1-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <CA+gsUGRZgg-Y5-tj5xhWVHW0=WFdvkVBxGaKZFLApssW=a-cwg@mail.gmail.com>
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
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
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
tests/kms_setmode.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 3d18fc7..e1c9c5a 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;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-12-03 17:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 20:31 Modeset without a detected monitor on DDI platforms v2.5 Damien Lespiau
2013-11-29 20:31 ` [PATCH 1/2] drm/i915: Introduce new intel_output_name() Damien Lespiau
2013-12-03 17:30 ` Paulo Zanoni
2013-11-29 20:31 ` [PATCH 2/2] drm/i915: Set the digital port encoder personality during modeset Damien Lespiau
2013-12-03 17:33 ` Paulo Zanoni
2013-12-03 17:36 ` Paulo Zanoni
2013-12-03 21:05 ` Daniel Vetter
2013-12-05 12:38 ` Paulo Zanoni
2013-12-05 12:48 ` Daniel Vetter
2014-01-07 16:54 ` Paulo Zanoni
2013-12-03 17:38 ` Paulo Zanoni [this message]
2013-12-09 20:52 ` [PATCH IGT] tests/kms_setmode: avoid 2 connectors on the same encoder Imre Deak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386092298-13113-1-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox