OSDN Git Service

drm/vmwgfx: Fix a layout race condition
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 12 Nov 2018 14:46:39 +0000 (15:46 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Dec 2018 09:08:53 +0000 (10:08 +0100)
commit9da6e26c0aae3fda6017c1ecf5c8881f8dbc37df
treef5508c1cf472149239011c514789cde6788390fc
parent9d9486e43728cd513e10ed3dd54e156c8ab7bd2a
drm/vmwgfx: Fix a layout race condition

This fixes a layout update race condition. We make sure
the crtc mutex is locked before we dereference crtc->state. Otherwise the
state might change under us.

Since now we're already holding the crtc mutexes when reading the gui
coordinates, protect them with the crtc mutexes rather than with the
requested_layout mutex.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c