hwc: Fix mutex deadlock in GetVsyncPeriod

Existing implementation of GetVsyncPeriod use sequence locker entry mechanism.

This can potentially lead to deadlock for below scenario:
1. During hotplug connection, locker_.sequence_wait_ is set in GetVsyncPeriod.
2. Dumpsys() utility acquires HWComposer::mDrawLock and waits till
   locker_.sequence_wait_ is reset.
3. SurfaceFlinger::SetupHWComposer() waits on HWComposer::mDrawLock.

This results in deadlock.

Fix deadlock by using scope lock of locker_ in GetVsyncPeriod.

Change-Id: Iea1e2bd53ef4434c40af6062eb9dd5fa9354db4a
CRs-Fixed: 962964
1 file changed