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>
This commit is contained in:
Daniel Vetter
2015-12-01 11:24:19 +01:00
parent cdb398b5b9
commit db4f83ca5d
11 changed files with 54 additions and 28 deletions
+14 -2
View File
@@ -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
*/