summaryrefslogtreecommitdiff
path: root/v4l2-drm-example
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-02-24 08:46:41 +0100
committerTomasz Stanislawski <t.stanislaws@samsung.com>2013-03-13 10:49:34 +0100
commitba2ab4d78e7ae87b323a918b129a1cd6b2722f2f (patch)
treed45fad6aed32a85df21dda7067b51d5ab832532a /v4l2-drm-example
parent0a2635f3a5e79c5438e2afaedbbb5e3ac5595f3d (diff)
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 <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'v4l2-drm-example')
-rw-r--r--v4l2-drm-example/dmabuf-sharing.c9
1 files changed, 2 insertions, 7 deletions
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;