From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init()
Date: Mon, 26 Mar 2018 13:22:06 +0200 [thread overview]
Message-ID: <20180326112206.52222-1-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180326110614.7434.37672@emeril.freedesktop.org>
Only do a full probe when the initial connector status is unknown, and
otherwise skip it. This should speed up kms tests ever so slightly.
Also set pipe to PIPE_NONE for igt_output_refresh(), to make the
connector info slightly more accurate.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
lib/igt_kms.c | 17 +++++++++++++----
lib/igt_kms.h | 2 +-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d8f69d3db9ca..f47c32a79222 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -974,7 +974,7 @@ _kmstest_connector_config_find_encoder(int drm_fd, drmModeConnector *connector,
static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id,
unsigned long crtc_idx_mask,
struct kmstest_connector_config *config,
- bool probe)
+ int probe)
{
drmModeRes *resources;
drmModeConnector *connector;
@@ -988,11 +988,19 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id,
}
/* First, find the connector & mode */
- if (probe)
+ if (probe > 0)
connector = drmModeGetConnector(drm_fd, connector_id);
- else
+ else {
connector = drmModeGetConnectorCurrent(drm_fd, connector_id);
+ if (probe < 0 && connector &&
+ connector->connection == DRM_MODE_UNKNOWNCONNECTION) {
+ drmModeFreeConnector(connector);
+
+ connector = drmModeGetConnector(drm_fd, connector_id);
+ }
+ }
+
if (!connector)
goto err2;
@@ -2028,7 +2036,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
* We don't assign each output a pipe unless
* a pipe is set with igt_output_set_pipe().
*/
- output->force_reprobe = true;
+ output->force_reprobe = -1;
+ output->pending_pipe = PIPE_NONE;
output->id = resources->connectors[i];
output->display = display;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6f16dc8cf85e..9e734ab1a5b8 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -340,7 +340,7 @@ typedef struct {
uint32_t id; /* KMS id */
struct kmstest_connector_config config;
char *name;
- bool force_reprobe;
+ int force_reprobe;
enum pipe pending_pipe;
bool use_override_mode;
drmModeModeInfo override_mode;
--
2.16.3
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-03-26 11:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 10:40 [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init() Maarten Lankhorst
2018-03-26 11:06 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-03-26 11:22 ` Maarten Lankhorst [this message]
2018-03-27 13:28 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2018-03-28 8:37 ` [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init(), v2 Maarten Lankhorst
2018-03-28 9:20 ` Arkadiusz Hiler
2018-03-28 11:50 ` Maarten Lankhorst
2018-03-26 11:41 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Improve connector probing in igt_display_init() (rev2) Patchwork
2018-03-26 13:41 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-03-28 9:04 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Improve connector probing in igt_display_init() (rev3) Patchwork
2018-03-28 13:58 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20180326112206.52222-1-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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