From 6cf6e88715ac034f568603bce9a1b8f4a30c12ce Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Fri, 29 Nov 2024 02:04:12 +0000 Subject: Make gbm binary respect numframes --- kmscube/cube-gbm.cpp | 7 ++++++- kmscube/cube.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'kmscube') diff --git a/kmscube/cube-gbm.cpp b/kmscube/cube-gbm.cpp index d998f0b..034ae8a 100644 --- a/kmscube/cube-gbm.cpp +++ b/kmscube/cube-gbm.cpp @@ -11,6 +11,7 @@ #include #include +#include "cube.h" #include "cube-egl.h" #include "cube-gles2.h" @@ -250,6 +251,10 @@ private: if (m_plane) m_surface2->free_prev(); + if (s_num_frames && m_frame_num >= s_num_frames) { + s_need_exit = true; + } + if (s_need_exit) return; @@ -289,7 +294,7 @@ private: s_flip_pending++; } - int m_frame_num; + unsigned m_frame_num; chrono::steady_clock::time_point m_t1; Connector* m_connector; diff --git a/kmscube/cube.cpp b/kmscube/cube.cpp index 406bb8d..420c657 100644 --- a/kmscube/cube.cpp +++ b/kmscube/cube.cpp @@ -32,7 +32,7 @@ using namespace std; bool s_verbose; bool s_fullscreen; -unsigned s_num_frames; +unsigned s_num_frames = 0; int main(int argc, char* argv[]) { -- cgit v1.2.3