Bypass DRM interlace mode suppport

The drm backend has problems supporting HDMI interlaced mode. Bypassing
those modes while creating the mode list.

Bug: 158218464

Change-Id: I5b6e27dc21bce0334181df10ce9f8a950f246c8c
diff --git a/debian/patches/0010-drm-bypass-interlace-modes.patch b/debian/patches/0010-drm-bypass-interlace-modes.patch
new file mode 100644
index 0000000..dd1a89e
--- /dev/null
+++ b/debian/patches/0010-drm-bypass-interlace-modes.patch
@@ -0,0 +1,55 @@
+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);
+--
diff --git a/debian/patches/series b/debian/patches/series
index 1bab16b..1354c52 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@
 0008-PATCH-weston-add-surface-overlay-assignment-interfac.patch
 0009-force-weston-to-use-card0.patch
 0001-add-switch_config.patch
+0010-drm-bypass-interlace-modes.patch