blob: dd1a89eaeedbb93e9f944a8bc30f2ecfdd0af7ea [file] [log] [blame]
Bypass interlace modes
The drm backend has problems supporting HDMI interlace mode. Bypassing
those modes while creating the mode list.
---
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 5374e509..96a665ec 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -4959,6 +4959,7 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
{
char hsync[16];
char vsync[16];
+ char interlace[16] = {0};
float fclock;
memset(mode, 0, sizeof *mode);
@@ -4969,7 +4970,7 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
mode->vrefresh = 0;
mode->flags = 0;
- if (sscanf(s, "%f %hd %hd %hd %hd %hd %hd %hd %hd %15s %15s",
+ if (sscanf(s, "%f %hd %hd %hd %hd %hd %hd %hd %hd %15s %15s %15s",
&fclock,
&mode->hdisplay,
&mode->hsync_start,
@@ -4978,9 +4979,14 @@ parse_modeline(const char *s, drmModeModeInfo *mode)
&mode->vdisplay,
&mode->vsync_start,
&mode->vsync_end,
- &mode->vtotal, hsync, vsync) != 11)
+ &mode->vtotal, hsync, vsync, interlace) < 11)
return -1;
+ if (strcasecmp(interlace, "interlace") == 0) {
+ weston_log("Interlace mode is not supported\n");
+ return -1;
+ }
+
mode->clock = fclock * 1000;
if (strcasecmp(hsync, "+hsync") == 0)
mode->flags |= DRM_MODE_FLAG_PHSYNC;
@@ -5163,6 +5169,10 @@ drm_output_try_add_mode(struct drm_output *output, const drmModeModeInfo *info)
assert(info);
+ if (info->flags & DRM_MODE_FLAG_INTERLACE) {
+ return 0;
+ }
+
wl_list_for_each(base, &output->base.mode_list, link) {
mode = to_drm_mode(base);
chosen = drm_mode_pick_equivalent(&mode->mode_info, info);
--