This series adds a new "link bpc" DRM property. It reflects the display link's actual achieved output bits per component, considering any degradation of the bit depth done by drivers for bandwidth or other reasons. The property's value is updated during an atomic commit, which is also when it fires an uevent if it changed to let userspace know.
There's a weston implementation at [1] which makes use of this new property to warn when a user's requested bpc could not be reached. [1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1850 --- Changes in v5: - Split "drm/connector: hdmi: Add a 'link bpc' property" into two patches; one adding the property, the other making use for it in the HDMI helpers (Maxime) - Apply Maxime's Ack to the two split patches as per the review - Link to v4: https://lore.kernel.org/r/[email protected] Changes in v4: - Throw out the workqueue and delayed work item - Remove the drm_connector_update_link_bpc_state function - Reimplement it by updating the property and firing the uevent in commit_tail - Check that the provided max_bpc value in attach_link_bpc_property is within the expected range - Clamp the connector state's link_bpc value between 8 and max_bpc so that no value outside the declared range is ever written to the drm property - Update and reword doc strings - Add an amdgpu implementation - Link to v3: https://lore.kernel.org/r/[email protected]/T/ Changes in v3: - remove VRR mention from commit description (Ville) - add DRM_MODE_PROP_IMMUTABLE to flags (Ville) - provide helpers functions for drivers to use (can be used by other types of connectors, not just HDMI) - send uevent informating userspace when 'link bpc' connector state changed (Daniel @ https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1850) - added missing doc entry - Link to v2: https://lore.kernel.org/r/[email protected]/T/ Changes in v2: - replace return with EBUSY if connector already exists (Dmitry) - add i-g-t test and an implementation for Weston (Dmitry) - re-wording patch description (Jani) - Link to v1: https://lore.kernel.org/r/[email protected]/T/ Signed-off-by: Nicolas Frattaroli <[email protected]> --- Nicolas Frattaroli (3): drm/connector: Add a 'link bpc' property drm/connector: hdmi: Add support for 'link bpc' property drm/amd/display: Add support for 'link bpc' property drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 2 + drivers/gpu/drm/drm_atomic_helper.c | 9 +++ drivers/gpu/drm/drm_atomic_uapi.c | 2 + drivers/gpu/drm/drm_connector.c | 86 +++++++++++++++++++++++ include/drm/drm_connector.h | 16 +++++ 6 files changed, 129 insertions(+), 1 deletion(-) --- base-commit: f4482de2c06e19b0c337b774e485755378990614 change-id: 20260309-link-bpc-d0afc475ac49 Best regards, -- Nicolas Frattaroli <[email protected]>
