mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
Consume all available udev events at once
We get multiple udev events for actions like docking a laptop into its station or plugging a monitor to the station. By consuming as many events as we can, we reduce the number of output re-evalutions. It depends on the timing how many events can be consumed at once. (Inspired by xserver commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8) (Ported from radeon commit 22b5ce9548393ba2ff73ee234ecd82eeaf0ef6c4) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
c87dff3257
commit
3c1f4386ba
@@ -2479,12 +2479,15 @@ static void drmmode_handle_uevents(int fd, void *closure)
|
||||
drmmode_ptr drmmode = closure;
|
||||
ScrnInfoPtr scrn = drmmode->scrn;
|
||||
struct udev_device *dev;
|
||||
dev = udev_monitor_receive_device(drmmode->uevent_monitor);
|
||||
if (!dev)
|
||||
return;
|
||||
Bool received = FALSE;
|
||||
|
||||
amdgpu_mode_hotplug(scrn, drmmode);
|
||||
udev_device_unref(dev);
|
||||
while ((dev = udev_monitor_receive_device(drmmode->uevent_monitor))) {
|
||||
udev_device_unref(dev);
|
||||
received = TRUE;
|
||||
}
|
||||
|
||||
if (received)
|
||||
amdgpu_mode_hotplug(scrn, drmmode);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user