Multi-GPU hot plug
Hi, team!
I have a device with three cards, and the connectors are as follows:
The first connector:
root@dev:/sys/class/drm/card3-LVDS-2# cat connector_id
37
The second connector:
root@dev:/sys/class/drm/card2-LVDS-1# cat connector_id
37
The last one is HDMI:
root@dev:/sys/class/drm/card1-HDMI-A-1# cat connector_id
37
Currently we don't use the HDMI card in weston test, and I'm doing a test to disable one connector when the other display are working, when disabling one connector, the weston will free the frame-buffer associated to the connector that is disconnected, I check the source code of the weston, the connectors are all stored in one list, and find connector is use the connector_id as key, if the different connectors have the same connector id, then it will find a wrong connector.
struct drm_head *
drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id)
{
struct weston_head *base;
struct drm_head *head;
wl_list_for_each(base,
&backend->compositor->head_list, compositor_link)
{
head = to_drm_head(base);
if (!head)
continue;
if (head->connector.connector_id == connector_id)
return head;
}
return NULL;
}
BTW, I start weston with the following parameters:
ExecStart=/usr/bin/weston -Swayland-0 --debug --drm-device=card3 --additional-devices=card2 --use-pixman --flight-rec-scopes=
So I think the way drm_head_find_by_connector finds the connector is inappropriate in a multi-GPU situation.
Looking forward to your reply!
Snow
Best regards