[Ozone-Drm] Process display hotplug events sequentially
commite037bbf79d760921ed56cb0694b1defc598edadc
authordnicoara <dnicoara@chromium.org>
Tue, 28 Apr 2015 17:58:41 +0000 (28 10:58 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 28 Apr 2015 17:59:15 +0000 (28 17:59 +0000)
tree5c65f0f7ff3ce0123243ad20419ca2ae709bd93b
parent79b9eaa7b82dd12263e9f8689d33c0fa434fff16
[Ozone-Drm] Process display hotplug events sequentially

If add,remove or add,add (scanning for devices) events are delivered
fast enough, the remove/add event would be processed before the first
add event. In the first case the state would be incorrect while in the
second case it would cause the device to be opened multiple times
(causing permission errors in one of the events). To avoid this, use a
sequenced worker pool to properly order events. The device path is used
to group events for the same device.

This CL also keeps track of the active devices such that we can ignore
duplicate events (possible due to device scanning) and reduce the number
of display configurations performed.

BUG=477792,476728

Review URL: https://codereview.chromium.org/1072193008

Cr-Commit-Position: refs/heads/master@{#327321}
ui/ozone/platform/drm/host/drm_native_display_delegate.cc
ui/ozone/platform/drm/host/drm_native_display_delegate.h