fix race issue in threaded test pattern draw
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 10 Feb 2017 04:56:39 +0000 (06:56 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 10 Feb 2017 05:04:02 +0000 (07:04 +0200)
kms++util/src/testpat.cpp

index 519f960ec700bc8470404c9d98f22dc8e27e135b..6cb5d857b97f30f919cec85fa224bd76495e0f36 100644 (file)
@@ -155,6 +155,10 @@ static void draw_test_pattern_impl(IMappedFramebuffer& fb)
                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<thread> workers;