diff options
author | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2022-09-21 18:35:45 -0400 |
---|---|---|
committer | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2022-09-27 05:35:22 +0900 |
commit | a8cf122960eb44be1cffb654934d1aef5cf4ad69 (patch) | |
tree | 1b944c51998ddf1989fe9b18938774bbcd990036 | |
parent | 88cbd73ba10a589734cf126b64e74a6f42a5d5a7 (diff) |
lease-manager: Check that DRM device is viable for modesetting
Don't try to create leases from any DRM device that doesn't have
at least one connector, CRTC, and encoder. This allows any such
devices to be skipped when looking for a viable device when one
is not provided on the command line.
Bug-AGL: SPEC-4573
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Change-Id: Ia8cf27127e4d61c13c6d8dfc633282776da74060
-rw-r--r-- | drm-lease-manager/lease-manager.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drm-lease-manager/lease-manager.c b/drm-lease-manager/lease-manager.c index 885ca29..51a4613 100644 --- a/drm-lease-manager/lease-manager.c +++ b/drm-lease-manager/lease-manager.c @@ -532,6 +532,13 @@ static struct lm *drm_device_get_resources(const char *device) goto err; } + if (lm->drm_resource->count_connectors <= 0 || + lm->drm_resource->count_crtcs <= 0 || + lm->drm_resource->count_encoders <= 0) { + DEBUG_LOG("Insufficient DRM resources on device(%s)\n", device); + goto err; + } + lm->drm_plane_resource = drmModeGetPlaneResources(lm->drm_fd); if (!lm->drm_plane_resource) { DEBUG_LOG("drmModeGetPlaneResources failed: %s\n", |