summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84e240f)
raw | patch | inline | side by side (parent: 84e240f)
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | |
Fri, 10 Mar 2017 09:35:24 +0000 (11:35 +0200) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Fri, 10 Mar 2017 13:29:31 +0000 (15:29 +0200) |
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
utils/kmstest.cpp | patch | blob | history |
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index cd0fc1a7bd43907f1ac49764189481be166018a6..32dcb69c00cecc39d765062462d1a8156d57f352 100644 (file)
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
static bool s_cvt;
static bool s_cvt_v2;
static bool s_cvt_vid_opt;
+static unsigned s_max_flips;
static set<Crtc*> s_used_crtcs;
static set<Plane*> s_used_planes;
" --dmt Search for the given mode from DMT tables\n"
" --cea Search for the given mode from CEA tables\n"
" --cvt=CVT Create videomode with CVT. CVT is 'v1', 'v2' or 'v2o'\n"
- " --flip Do page flipping for each output\n"
+ " --flip[=max] Do page flipping for each output with an optional maximum flips count\n"
" --sync Synchronize page flipping\n"
"\n"
"<connector>, <crtc> and <plane> can be given by index (<idx>) or id (<id>).\n"
{
s_use_cea = true;
}),
- Option("|flip", []()
+ Option("|flip?", [&](string s)
{
s_flip_mode = true;
s_num_buffers = 2;
+ if (!s.empty())
+ s_max_flips = stoi(s);
}),
Option("|sync", []()
{
set_crtcs_n_planes_legacy(card, outputs);
}
+static bool max_flips_reached;
+
class FlipState : private PageFlipHandlerBase
{
public:
void handle_page_flip(uint32_t frame, double time)
{
m_frame_num++;
+ if (s_max_flips && m_frame_num >= s_max_flips)
+ max_flips_reached = true;
auto now = std::chrono::steady_clock::now();
for (unique_ptr<FlipState>& fs : flipstates)
fs->start_flipping();
- while (true) {
+ while (!max_flips_reached) {
int r;
FD_SET(0, &fds);