summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9dfef40..b03a8a7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -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;
+
+ while ((dev = udev_monitor_receive_device(drmmode->uevent_monitor))) {
+ udev_device_unref(dev);
+ received = TRUE;
+ }
- amdgpu_mode_hotplug(scrn, drmmode);
- udev_device_unref(dev);
+ if (received)
+ amdgpu_mode_hotplug(scrn, drmmode);
}
#endif