summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a5b08d)
raw | patch | inline | side by side (parent: 7a5b08d)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 12 Jan 2016 12:54:26 +0000 (14:54 +0200) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 12 Jan 2016 12:54:26 +0000 (14:54 +0200) |
tests/testpat.cpp | patch | blob | history |
diff --git a/tests/testpat.cpp b/tests/testpat.cpp
index 56ad7a5830289d398d9ffdd02a89393595dbb97e..37e19b1d9af0856f84679038d9ee73116b360f0e 100644 (file)
--- a/tests/testpat.cpp
+++ b/tests/testpat.cpp
@@ -476,24 +476,25 @@ static vector<OutputInfo> setups_to_outputs(Card& card, const vector<Arg>& outpu
static std::string videomode_to_string(const Videomode& mode)
{
- unsigned hfp, hsw, hbp;
- unsigned vfp, vsw, vbp;
+ unsigned hfp = mode.hsync_start - mode.hdisplay;
+ unsigned hsw = mode.hsync_end - mode.hsync_start;
+ unsigned hbp = mode.htotal - mode.hsync_end;
- hfp = mode.hsync_start - mode.hdisplay;
- hsw = mode.hsync_end - mode.hsync_start;
- hbp = mode.htotal - mode.hsync_end;
+ unsigned vfp = mode.vsync_start - mode.vdisplay;
+ unsigned vsw = mode.vsync_end - mode.vsync_start;
+ unsigned vbp = mode.vtotal - mode.vsync_end;
- vfp = mode.vsync_start - mode.vdisplay;
- vsw = mode.vsync_end - mode.vsync_start;
- vbp = mode.vtotal - mode.vsync_end;
+ float hz = (mode.clock * 1000.0) / (mode.htotal * mode.vtotal);
+ if (mode.flags & (1<<4)) // XXX interlace
+ hz *= 2;
char buf[256];
- sprintf(buf, "%.2f MHz %u/%u/%u/%u %u/%u/%u/%u %uHz",
+ sprintf(buf, "%.2f MHz %u/%u/%u/%u %u/%u/%u/%u %uHz (%.2fHz)",
mode.clock / 1000.0,
mode.hdisplay, hfp, hsw, hbp,
mode.vdisplay, vfp, vsw, vbp,
- mode.vrefresh);
+ mode.vrefresh, hz);
return std::string(buf);
}