diff options
authorLaurent Pinchart <>2013-02-24 07:46:41 (GMT)
committerTomasz Stanislawski <>2013-03-13 09:49:34 (GMT)
commitba2ab4d78e7ae87b323a918b129a1cd6b2722f2f (patch)
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 <>
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;

Privacy Policy