summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f32b82c)
raw | patch | inline | side by side (parent: f32b82c)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Fri, 20 Oct 2017 08:32:18 +0000 (11:32 +0300) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Fri, 20 Oct 2017 08:32:18 +0000 (11:32 +0300) |
kms++/inc/kms++/videomode.h | patch | blob | history | |
kms++/src/videomode.cpp | patch | blob | history |
index 39e56395c91193c1043ab6c4062a38f13b38d9ae..d7f5258c039dfbff3f640d2d975786d882ca971e 100644 (file)
void set_interlace(bool ilace);
void set_hsync(SyncPolarity pol);
void set_vsync(SyncPolarity pol);
void set_interlace(bool ilace);
void set_hsync(SyncPolarity pol);
void set_vsync(SyncPolarity pol);
+
+ std::string to_string() const;
};
struct Videomode videomode_from_timings(uint32_t clock_khz,
};
struct Videomode videomode_from_timings(uint32_t clock_khz,
index 4964a577573c4ca7200e4e33970f4e62bbc37c5d..b8bd797107600c5c886875c816ca6814a9ece921 100644 (file)
--- a/kms++/src/videomode.cpp
+++ b/kms++/src/videomode.cpp
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <math.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <math.h>
+#include <sstream>
#include <kms++/kms++.h>
#include "helpers.h"
#include <kms++/kms++.h>
#include "helpers.h"
}
}
}
}
+string Videomode::to_string() const
+{
+ std::stringstream ss;
+ ss << hdisplay << "x" << vdisplay;
+ if (interlace())
+ ss << "i";
+ ss << "@" << calculated_vrefresh();
+ return ss.str();
+}
+
Videomode videomode_from_timings(uint32_t clock_khz,
uint16_t hact, uint16_t hfp, uint16_t hsw, uint16_t hbp,
uint16_t vact, uint16_t vfp, uint16_t vsw, uint16_t vbp)
Videomode videomode_from_timings(uint32_t clock_khz,
uint16_t hact, uint16_t hfp, uint16_t hsw, uint16_t hbp,
uint16_t vact, uint16_t vfp, uint16_t vsw, uint16_t vbp)