udlfb: introduce a rendering mutex
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 1 Apr 2019 15:46:57 +0000 (17:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 May 2019 16:23:30 +0000 (18:23 +0200)
commit42f59b83f0cf547a2236b0e1e4d0c785db9af6e8
tree62aaeb349e190b8a65d1009dd7dc3ea2bea03ea7
parentfb36a97654a7950b617f3ba261b4939fe281c6b9
udlfb: introduce a rendering mutex

commit babc250e278eac7b0e671bdaedf833759b43bb78 upstream.

Rendering calls may be done simultaneously from the workqueue,
dlfb_ops_write, dlfb_ops_ioctl, dlfb_ops_set_par and dlfb_dpy_deferred_io.
The code is robust enough so that it won't crash on concurrent rendering.

However, concurrent rendering may cause display corruption if the same
pixel is simultaneously being rendered. In order to avoid this corruption,
this patch adds a mutex around the rendering calls.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>
Cc: Ladislav Michl <ladis@linux-mips.org>
Cc: <stable@vger.kernel.org>
[b.zolnierkie: replace "dlfb:" with "uldfb:" in the patch summary]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/udlfb.c
include/video/udlfb.h