Replace drmModeGetConnector with drmModeGetConnectorCurrent for faster start-up?
AFAIU, drmModeGetConnector()
forces re-probing the connector which might take time. drmModeGetConnectorCurrent()
simply returns the kernel's current understanding of the connector state, which is fast.
Does Weston have any reason to use drmModeGetConnector()
?
Maybe we can shave off some start-up and hotplug handling time by switching to drmModeGetConnectorCurrent()
?
This is just a hypothesis, I haven't actually measured the impact. If anyone is interested in making Weston start-up faster, would be nice if you can provide a measurement of this.
xf86drmMode.h
:
/**
* Retrieve current information, i.e the currently active mode and encoder,
* about the connector connectorId. This will not do any probing on the
* connector or remote device, and only reports what is currently known.
* For the complete set of modes and encoders associated with the connector
* use drmModeGetConnector() which will do a probe to determine any display
* link changes first.
*/
extern drmModeConnectorPtr drmModeGetConnectorCurrent(int fd,
uint32_t connector_id);
That seems to suggest GetConnector
is good to use in some cases, but I'm not really sure what those cases are. For example, if Weston starts up with come connectors that are not active, do we need to force probing to ensure we know what's behind it, if anything?