From 33246d9b5fb0347aabd62caac1da03440f9e1634 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Mar 2018 15:11:23 +0200 Subject: testpat: remove threaded drawing Threading causes easily issues with (at least) static linking. Let's just remove it as it's not really that important. Signed-off-by: Tomi Valkeinen --- kms++util/CMakeLists.txt | 2 +- kms++util/src/testpat.cpp | 28 +--------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'kms++util') diff --git a/kms++util/CMakeLists.txt b/kms++util/CMakeLists.txt index 2fc15e3..abee194 100644 --- a/kms++util/CMakeLists.txt +++ b/kms++util/CMakeLists.txt @@ -7,7 +7,7 @@ target_include_directories(kms++util PUBLIC $ PRIVATE src) -target_link_libraries(kms++util kms++ pthread) +target_link_libraries(kms++util kms++) set_target_properties(kms++util PROPERTIES PUBLIC_HEADER "${PUB_HDRS}") diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index cf43d00..fee8d8c 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include @@ -153,32 +152,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned static void draw_test_pattern_impl(IFramebuffer& fb, YUVType yuvt) { - if (fb.height() < 20) { - draw_test_pattern_part(fb, 0, fb.height(), yuvt); - return; - } - - // Create the mmaps before starting the threads - for (unsigned i = 0; i < fb.num_planes(); ++i) - fb.map(0); - - unsigned num_threads = thread::hardware_concurrency(); - vector workers; - - unsigned part = (fb.height() / num_threads) & ~1; - - for (unsigned n = 0; n < num_threads; ++n) { - unsigned start = n * part; - unsigned end = start + part; - - if (n == num_threads - 1) - end = fb.height(); - - workers.push_back(thread([&fb, start, end, yuvt]() { draw_test_pattern_part(fb, start, end, yuvt); })); - } - - for (thread& t : workers) - t.join(); + draw_test_pattern_part(fb, 0, fb.height(), yuvt); } void draw_test_pattern(IFramebuffer &fb, YUVType yuvt) -- cgit v1.2.3