From ba2ab4d78e7ae87b323a918b129a1cd6b2722f2f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 24 Feb 2013 08:46:41 +0100 Subject: v4l2-drm-example: Use connector IDs instead of connector indices Specify the requested connector on the command line by its KMS ID instead of the connector index in the connectors array. This makes command line arguments match the information returned by KMS test tools such as modetest. Signed-off-by: Laurent Pinchart --- v4l2-drm-example/dmabuf-sharing.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'v4l2-drm-example') diff --git a/v4l2-drm-example/dmabuf-sharing.c b/v4l2-drm-example/dmabuf-sharing.c index d19d219..3fe8f9c 100644 --- a/v4l2-drm-example/dmabuf-sharing.c +++ b/v4l2-drm-example/dmabuf-sharing.c @@ -71,7 +71,7 @@ static inline int warn(const char *file, int line, const char *fmt, ...) struct setup { char module[32]; - uint32_t conId; + int conId; uint32_t crtId; char modestr[32]; char video[32]; @@ -258,13 +258,8 @@ static int find_mode(drmModeModeInfo *m, int drmfd, struct setup *s, if (WARN_ON(res->count_connectors <= 0, "drm: no connectors\n")) goto fail_res; - if (WARN_ON(s->conId >= res->count_connectors, "connector %d " - "is not supported\n", s->conId)) - goto fail_res; - drmModeConnector *c; - c = drmModeGetConnector(drmfd, res->connectors[s->conId]); - + c = drmModeGetConnector(drmfd, s->conId); if (WARN_ON(!c, "drmModeGetConnector failed: %s\n", ERRSTR)) goto fail_res; -- cgit v1.2.3