summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-01 11:24:19 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-04 10:49:11 +0100
commitdb4f83ca5da29673ab9210e4322156518047130d (patch)
tree0f0ae42c3d3d6c8e66fa84ffaff84769590f65ed /lib
parentcdb398b5b9a6a1895bbc8213f88bc9e45795db23 (diff)
lib/kms+tests: Use cached connector state
Speeds up testcases except for those where we want to exercise the probing itself. The only exceptions left where we do a full probe are - pm_rpm: We use it to make sure the kernel doesn't get things wrong with power domains, so we really want to exercise the full probe paths. And there the only place really is the specific validation done with the data gathered by get_drm_info. - kmstest_force_ functions: Newer kernels should be better at re-probing state when the force sysfs fields change, but better safe than sorry. v2: I also consolidated the start_n_modes and start_connectors while at it - move one of the fixup hunks to this patch that accidentally got misplaced (Thomas). Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 52816449..fd4f05e8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -393,6 +393,7 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector,
char *path, **tmp;
const char *value;
int debugfs_fd, ret, len;
+ drmModeConnector *temp;
uint32_t devid;
devid = intel_get_drm_devid(drm_fd);
@@ -459,6 +460,11 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector,
igt_install_exit_handler(reset_connectors_at_exit);
+ /* To allow callers to always use GetConnectorCurrent we need to force a
+ * redetection here. */
+ temp = drmModeGetConnector(drm_fd, connector->connector_id);
+ drmModeFreeConnector(temp);
+
igt_assert(ret != -1);
return (ret == -1) ? false : true;
}
@@ -480,6 +486,7 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
{
char *path;
int debugfs_fd, ret;
+ drmModeConnector *temp;
igt_assert_neq(asprintf(&path, "%s-%d/edid_override", kmstest_connector_type_str(connector->connector_type), connector->connector_type_id),
-1);
@@ -494,6 +501,11 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
ret = write(debugfs_fd, edid, length);
close(debugfs_fd);
+ /* To allow callers to always use GetConnectorCurrent we need to force a
+ * redetection here. */
+ temp = drmModeGetConnector(drm_fd, connector->connector_id);
+ drmModeFreeConnector(temp);
+
igt_assert(ret != -1);
}
@@ -556,7 +568,7 @@ bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
}
/* First, find the connector & mode */
- connector = drmModeGetConnector(drm_fd, connector_id);
+ connector = drmModeGetConnectorCurrent(drm_fd, connector_id);
if (!connector)
goto err2;
@@ -1979,7 +1991,7 @@ void igt_enable_connectors(void)
for (int i = 0; i < res->count_connectors; i++) {
- c = drmModeGetConnector(drm_fd, res->connectors[i]);
+ c = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]);
/* don't attempt to force connectors that are already connected
*/