Skip to content

libweston: Add a fixed name to bind input devices

liang zhou requested to merge snow/weston:add-fix-connector-name into main

There are 2 connectors of the same type on different card in our system. Due to the order in which drivers are loaded during system startup, the connector IDs can be inconsistent, leading to uncertain connector names. For example, if a device has two LVDS display devices, sometimes after system startup, their connector names might be LVDS-1 and LVDS-2, but at other times, they might be LVDS-2 and LVDS-1. This inconsistency makes it impossible to bind input to a specific output using the WL_OUTPUT name.

Below are the two scenarios that may occur during system startup: Case 1:

root@test64:/sys/class/drm# ls
card0           card1-HDMI-A-1  card2-DSI-1     card3           renderD128
card1           card2           card2-LVDS-2    card3-LVDS-1    version

Case 2:

root@test64:/sys/class/drm# ls
card0           card1-HDMI-A-1  card2-DSI-1     card3           renderD128
card1           card2           card2-LVDS-1    card3-LVDS-2    version

The name of this connector is sometimes LVDS-1, and sometimes it is LVDS-2.

Since we cannot determine the name of the WL_OUTPUT to which the touch device is bound, we cannot set the name of the WL_OUTPUT in the udev rule.

To solve this problem, a fixed_name attribute is added to the head to represent its fixed name. When binding input to output, if the output cannot be found using the head's name, the fixed_name of the head will be used to locate the output.

With this mechanism, we can set the WL_OUTPUT_FIXED_NAME property for the drm connector in the udev rule. This WL_OUTPUT_FIXED_NAME is fixed, and it can be used to match when binding the touch device.

Signed-off-by: liang zhou liang.zhou@gehealthcare.com

Edited by liang zhou

Merge request reports

Loading