libkms: add 'ilace' param for Connector::get_mode()
[android/external-libkmsxx.git] / libkms++ / connector.cpp
index cdeb02aa166e65967d2bb10a6284c9d6069f10f7..325b610de036fec57421d09c2f523442d580a883 100644 (file)
@@ -112,7 +112,7 @@ Videomode Connector::get_mode(const string& mode) const
         throw invalid_argument(mode + ": mode not found");
 }
 
-Videomode Connector::get_mode(unsigned xres, unsigned yres, unsigned refresh) const
+Videomode Connector::get_mode(unsigned xres, unsigned yres, unsigned refresh, bool ilace) const
 {
        auto c = m_priv->drm_connector;
 
@@ -125,6 +125,9 @@ Videomode Connector::get_mode(unsigned xres, unsigned yres, unsigned refresh) co
                if (refresh && m.vrefresh != refresh)
                        continue;
 
+               if (ilace != !!(m.flags & DRM_MODE_FLAG_INTERLACE))
+                       continue;
+
                return drm_mode_to_video_mode(c->modes[i]);
        }