libkms: add 'ilace' param for Connector::get_mode()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 7 Dec 2015 18:06:09 +0000 (20:06 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 12 Jan 2016 12:52:37 +0000 (14:52 +0200)
libkms++/connector.cpp
libkms++/connector.h

index cdeb02aa166e65967d2bb10a6284c9d6069f10f7..325b610de036fec57421d09c2f523442d580a883 100644 (file)
@@ -112,7 +112,7 @@ Videomode Connector::get_mode(const string& mode) const
         throw invalid_argument(mode + ": mode not found");
 }
 
         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;
 
 {
        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 (refresh && m.vrefresh != refresh)
                        continue;
 
+               if (ilace != !!(m.flags & DRM_MODE_FLAG_INTERLACE))
+                       continue;
+
                return drm_mode_to_video_mode(c->modes[i]);
        }
 
                return drm_mode_to_video_mode(c->modes[i]);
        }
 
index cc04d522279e91941922c7e95ebdf0ce5193a95f..1759af1963becabcda17e59c83fed9468f3ad800 100644 (file)
@@ -17,7 +17,7 @@ public:
        Videomode get_default_mode() const;
 
        Videomode get_mode(const std::string& mode) const;
        Videomode get_default_mode() const;
 
        Videomode get_mode(const std::string& mode) const;
-       Videomode get_mode(unsigned xres, unsigned yres, unsigned refresh) const;
+       Videomode get_mode(unsigned xres, unsigned yres, unsigned refresh, bool ilace) const;
 
        Crtc* get_current_crtc() const;
        std::vector<Crtc*> get_possible_crtcs() const;
 
        Crtc* get_current_crtc() const;
        std::vector<Crtc*> get_possible_crtcs() const;