compositor-drm: ignore case of {h,v}sync flags in modeline

Some modeline generators put out e.g. +HSync instead of +hsync. Accept
that too since it's not ambigous.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Guido Günther 7 years ago committed by Pekka Paalanen
parent 352804488a
commit 92278e0806
  1. 8
      libweston/compositor-drm.c

@ -4341,16 +4341,16 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
return -1; return -1;
mode->clock = fclock * 1000; mode->clock = fclock * 1000;
if (strcmp(hsync, "+hsync") == 0) if (strcasecmp(hsync, "+hsync") == 0)
mode->flags |= DRM_MODE_FLAG_PHSYNC; mode->flags |= DRM_MODE_FLAG_PHSYNC;
else if (strcmp(hsync, "-hsync") == 0) else if (strcasecmp(hsync, "-hsync") == 0)
mode->flags |= DRM_MODE_FLAG_NHSYNC; mode->flags |= DRM_MODE_FLAG_NHSYNC;
else else
return -1; return -1;
if (strcmp(vsync, "+vsync") == 0) if (strcasecmp(vsync, "+vsync") == 0)
mode->flags |= DRM_MODE_FLAG_PVSYNC; mode->flags |= DRM_MODE_FLAG_PVSYNC;
else if (strcmp(vsync, "-vsync") == 0) else if (strcasecmp(vsync, "-vsync") == 0)
mode->flags |= DRM_MODE_FLAG_NVSYNC; mode->flags |= DRM_MODE_FLAG_NVSYNC;
else else
return -1; return -1;

Loading…
Cancel
Save