]> git.ipfire.org Git - thirdparty/plymouth.git/commit
ply-device-manager: Speed up DRM-connector probing
authorHans de Goede <hdegoede@redhat.com>
Fri, 5 Mar 2021 11:25:36 +0000 (12:25 +0100)
committerHans de Goede <hdegoede@redhat.com>
Sat, 6 Mar 2021 09:57:05 +0000 (10:57 +0100)
commit42ee6809b0cb669c23cac8cb289b0d101a19fa47
treefbaac0a7158cfa2585cbb0b76c97f006399b829e
parentdc8dc20b2685d09c68b4f90a1a34f0f9cc024a74
ply-device-manager: Speed up DRM-connector probing

During the initial monitor/connector enumeration on boot the kernel
fires a large number of change events. If we process these 1 by 1,
we spend a lot of time probing the DRM-connectors. So instead we
collect them all and then coalescence them so that if there are multiple
change events pending for a single card, we only re-probe the card once.

Here are some numbers of the probing times before / after this patch:

1. Lenovo X1 carbon 8th gen connected to a Lenovo Thunderbolt dock gen 2
   with 2 FullHD monitors connected:
Before: add event card0: 00:00:02.543 last change complete at: 00:00:04.250,
   12 change events processed, 13 probes done!
After: add event card0: 00:00:02.548 last change complete at: 00:00:04.049
   1 change event processed, 2 probes done!

2. Intel skylake CPU + iGPU based desktop with 2 FullHD monitors connected:
Before: add event card0: 00:00:02.394 last change complete at: 00:00:05.024,
   5 change events processed, 6 probes done!
After: add event card0: 00:00:02.343 last change complete at: 00:00:03.744,
   1 change event processed, 2 probes done!

In the Thunderbolt dock case we probe the DRM-connectors 2 times instead
of 13 times after this change. This does not lead to a big speed-up though
because the dock caches the monitors EDID info and the DP aux channel to
the dock is quite fast.

In the desktop case we only reduce the amount of probes from 6 to 2, so
less then in the Thunderbolt dock case, but since we don't have the EDID
caching happening there this does reduce the time which it takes to probe
the DRM-connectors from 2.6 seconds to 1.4 seconds which is a huge
improvement.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/libply-splash-core/ply-device-manager.c