From: Mario Limonciello <[email protected]> Allow bridges that own brightness control to advertise a luminance operation and its supported relative range.
Signed-off-by: Mario Limonciello <[email protected]> --- v11: * Drop panel bridge declarations re-added by a bad rebase (Sashiko) * Document @luminance as the initial level v10: * Split bridge operations out of the combined panel and bridge patch --- include/drm/drm_bridge.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 1981d24a700d2..240a69c1233e7 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -62,6 +62,15 @@ enum drm_bridge_attach_flags { * struct drm_bridge_funcs - drm_bridge control functions */ struct drm_bridge_funcs { + /** + * @set_luminance: + * + * Apply a relative luminance level to a bridge that controls panel + * emission. Bridges implementing this callback shall set + * @DRM_BRIDGE_OP_LUMINANCE. + */ + void (*set_luminance)(struct drm_bridge *bridge, unsigned int luminance); + /** * @attach: * @@ -1021,6 +1030,11 @@ enum drm_bridge_ops { * &drm_bridge_funcs->hdmi_clear_spd_infoframe callbacks. */ DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME = BIT(10), + + /** + * @DRM_BRIDGE_OP_LUMINANCE: The bridge controls panel luminance. + */ + DRM_BRIDGE_OP_LUMINANCE = BIT(11), }; /** @@ -1071,6 +1085,12 @@ struct drm_bridge { void *driver_private; /** @ops: bitmask of operations supported by the bridge */ enum drm_bridge_ops ops; + + /** @luminance_max: Maximum relative luminance level. */ + unsigned int luminance_max; + + /** @luminance: Initial relative luminance level. */ + unsigned int luminance; /** * @type: Type of the connection at the bridge output * (DRM_MODE_CONNECTOR_*). For bridges at the end of this chain this -- 2.53.0
