diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-08-25 09:08:34 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-08-25 11:28:39 +0200 |
commit | e511fab23723b66844a010101d6ed08a29698a23 (patch) | |
tree | bd7c3dfeb4f0d1b029e26487339953912f506daf /lib/igt_kms.c | |
parent | 3a3c0fa74ed40d544f16d4c32b9db0081fbf02ce (diff) |
igt_kms: Populate more members of connectors.
It's possible to make use of disconnected connectors, for example
when overriding the mode or testing connector properties that don't
need it to be connected. Support this by zeroing the mode in that
case. We still return false, but this is ignored by commit.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index e9c89617..7d533603 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -865,16 +865,6 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, if (!connector) goto err2; - if (connector->connection != DRM_MODE_CONNECTED) - goto err3; - - if (!connector->count_modes) { - igt_warn("connector %d/%s-%d has no modes\n", connector_id, - kmstest_connector_type_str(connector->connector_type), - connector->connector_type_id); - goto err3; - } - if (connector->connector_id != connector_id) { igt_warn("connector id doesn't match (%d != %d)\n", connector->connector_id, connector_id); @@ -888,8 +878,10 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, */ _kmstest_connector_config_crtc_mask(drm_fd, connector, config); - if (!kmstest_get_connector_default_mode(drm_fd, connector, - &config->default_mode)) + if (!connector->count_modes) + memset(&config->default_mode, 0, sizeof(config->default_mode)); + else if (!kmstest_get_connector_default_mode(drm_fd, connector, + &config->default_mode)) goto err3; config->connector = connector; @@ -904,8 +896,17 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id, config->encoder = _kmstest_connector_config_find_encoder(drm_fd, connector, config->pipe); config->crtc = drmModeGetCrtc(drm_fd, resources->crtcs[config->pipe]); - drmModeFreeResources(resources); + if (connector->connection != DRM_MODE_CONNECTED) + goto err2; + + if (!connector->count_modes) { + igt_warn("connector %d/%s-%d has no modes\n", connector_id, + kmstest_connector_type_str(connector->connector_type), + connector->connector_type_id); + goto err2; + } + drmModeFreeResources(resources); return true; err3: drmModeFreeConnector(connector); |