summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-10-02 16:25:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-10-03 09:28:01 +0100
commitc5c0dd2e0b6fb2deb2b3e11212250e685177f8ac (patch)
tree33b1cfd7b5ae9db290e87e3529aded56ba3e5be4 /lib/igt_kms.c
parentebf6a1dd1795e2f014ff3c47fe2eb4d5255845bd (diff)
lib/kms: Handle no connectors for igt_enable_connectors()
Take the device fd from the caller as to which card we should try and enable connectors for (or else we may not enable the right connectors for the test!) and fail gracefully if there is no kms support on the device. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3894eeaf..b2cbaa11 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3905,15 +3905,13 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
* An exit handler is installed to ensure connectors are reset when the test
* exits.
*/
-void igt_enable_connectors(void)
+void igt_enable_connectors(int drm_fd)
{
drmModeRes *res;
- int drm_fd;
-
- drm_fd = drm_open_driver(DRIVER_ANY);
res = drmModeGetResources(drm_fd);
- igt_assert(res != NULL);
+ if (!res)
+ return;
for (int i = 0; i < res->count_connectors; i++) {
drmModeConnector *c;
@@ -3940,8 +3938,6 @@ void igt_enable_connectors(void)
drmModeFreeConnector(c);
}
-
- close(drm_fd);
}
/**