Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testpat: Fix memory mapping in threaded drawing
The IFramebuffer::map() function is not thread-safe, which is why the threaded implementation of draw_test_pattern_impl() maps all planes before starting to draw. A typo slipped in the code, resulting in only plane 0 being mapped. This didn't result in an immediate segfault, as drawing operations in the worker threads map the remaining planes. However, due to the implementation of DumbFramebuffer::map(), this can result in the same plane being mapped multiple times, with only one of the mapping recorded in the mapping cache. The other mappings are then leaked, leading not only to extra memory consumption, but also to the DRM device never being released even after the destruction of the Card object. Fix this. Fixes: 40d9606 ("Revert "testpat: remove threaded drawing"") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
- Loading branch information