From nobody Thu Mar 5 08:21:45 2026 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 710DD3346BB for ; Mon, 16 Feb 2026 16:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771260356; cv=none; b=rV/GK+fHZYfWNKBNvhnNgvu3k0tExylE/SER6pquq2MSGb2890c26lLS0DXZNsjMR9Efpg4PF0nLuN8Cx3TtQsd22JjjWt/NgdOnDryjhJE6ppDv0ltEfKFDqSAThpx2YrtqGSfYGHPUQcqhMtz7XGkgtfMw3sHACkA+lQYy51A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771260356; c=relaxed/simple; bh=KHA3BO4VSX5IZuH6JCAwdpfT/KK/sYqiICV2ZAk88X0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QHOxTJjEq4um/DsQeUCvT6fl3CYhb/ajW5gf1EdRzsSU9wCIqNL+9d/ClTO+yBf8+OzNfOzOFbjJc/qNhA6sNFwbuIIxHFuv441t+iAbTe5ZPouIEz7oPIIyHfNLUsbJlP1uh8vyyXqHjqYw5lTD9smIScZUwMMLG1uBiqpIiq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nqt3nyBU; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nqt3nyBU" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b8fa19e6186so64126766b.3 for ; Mon, 16 Feb 2026 08:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771260353; x=1771865153; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OELXgTEKNOln1QbMyB2O7aWm6BMQADWB4ffEkfUoOx4=; b=Nqt3nyBUli7xjTibaO7TVUyzNG5UyRDr96kXTxQEH6Wn6/ta1e7TGvmH/M5sTzgezE ojLXe/LbvGuFFl7RBsxNdfzWnYjvzRDkLwCf8ZaT3GWoKyi5fg8QPdyyOmAE21SUnjZ8 Foz5jslFhsUQYKtHGukcfqqJ6CmveCXkPOSL5yq82AyuByMFPAjRiaEX5ps8OU9hD1Tk S9sasxjEiDGi0eOxb3vBJLpeXPjyQHXzz51n6XDvwNhO/N9mwbnU3O/11MiF00rI6fcT zIbbtJgRrpTiFdYL/f0O3NBwhLWdMBXbuzdtNYZiiGqrayZ+jdvcsiO6kuwMtci8Be6D 3HwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771260353; x=1771865153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OELXgTEKNOln1QbMyB2O7aWm6BMQADWB4ffEkfUoOx4=; b=OHsF1kvYGyx2KGckBjWovmEo7skClwia/qJME3wTNsWJPireWH9e/FBQyaFNzC2uFc YbEAq7qgIWtsjiU++GMJFyHk5FZSejI+7abbcGNDadfZvL9w4yaSmDhd4Nsi9BDWTvfl 8FUvApX2w9/ErWEuTYv1DD65XMz6FUMYF67N7Ud8lwx1NLdeOc73ZJ+ZdoHr4oFuIYQ7 EIFLwpCpmCHLK/EAqNsJH4u1jyz4uLhyk6RyYl32Jy38tRq3/tyUx4RAytfSeTj5rBwv CSZDM8PrNZA2vvRnaOaG1Xm14xFcqt3AmNSUOJG+nSSbdZ50/IsiyYoj+TXofvx+TJnC 10Yg== X-Forwarded-Encrypted: i=1; AJvYcCXdK1K5sOlUKxe2m2Nq3HRkknVNRifZDvXmN9JN9A9Tz/UelIimnlNIAWyCa+SqshSoU74E0sd8lYrfCg4=@vger.kernel.org X-Gm-Message-State: AOJu0YzMtwpRSjguXA5iP5rxgRAqv1fIGLFvTTpk/rrMh1KpqyFMGBYt clkkuegZwXZcMM5GeNJsWfWSDmGjxC59yfm3EGgL/V2jXtPazPvHDm4g X-Gm-Gg: AZuq6aI23l/kvcK7QZWTypwCmsL/1g+hNkbtAaW98kxFs6olg3hGCfr1wEqLFlH/cM2 q4lSX+c/zJjmsfrQKfexmn0yIeNJptc6AaZWxALH6gTuuJ9s3RZCKhOPiusZ+YCwrDnCo3PxZqf Fj072HFzSnERx7ySYzZgLZCBRD3e9KgT/zrXg1RQacwdByb6/7wk33KxKvWKcWuKsFoRmbLTDM5 i7m26dWhb/HmfcvNEBcjHFM1sfm9Fbr1sC9DhOrq2eoDpjzIc0H7LYoKnTwvrNW7bCSMsVexP/k QktuHMbo++ywMnxDZXkpcY0EJcKsYwPywVXbXJ21UBDcaTqTtdeI/s9J10THnI11P9LmIYexn8k ojcoLNVfrGrK5blggBB1+63ZRzbsFteRMSqBch4cpX916pU9vSEEEbIhW7Y29sRB4OO8ObRUvMn SEyl7KECc4vq9hPNnSO+Rg/HPYGUFPTusmpgaJMsJNXnahel8ZA0Vx5UoDvMyvPxpZznWIEtpS3 /XH X-Received: by 2002:a17:907:2686:b0:b8e:fd74:f6b7 with SMTP id a640c23a62f3a-b8facdf05a6mr322216666b.5.1771260352482; Mon, 16 Feb 2026 08:45:52 -0800 (PST) Received: from laptok.lan (87-205-5-123.static.ip.netia.com.pl. [87.205.5.123]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8fc735d185sm264683866b.14.2026.02.16.08.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 08:45:52 -0800 (PST) From: =?UTF-8?q?Tomasz=20Paku=C5=82a?= To: alexander.deucher@amd.com, harry.wentland@amd.com, sunpeng.li@amd.com Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, siqueira@igalia.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, tomasz.pakula.oficjalny@gmail.com, bernhard.berger@gmail.com, michel.daenzer@mailbox.org, daniel@fooishbar.org Subject: [PATCH v4 25/27] drm: Add ALLM properties to connector Date: Mon, 16 Feb 2026 17:45:14 +0100 Message-ID: <20260216164516.36803-26-tomasz.pakula.oficjalny@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260216164516.36803-1-tomasz.pakula.oficjalny@gmail.com> References: <20260216164516.36803-1-tomasz.pakula.oficjalny@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Adds HDMI Auto Low Latency Mode optional connector properties allm_mode and allm_mode_capable. ALLM automatically puts TVs into low latency modes (gaming modes) and it's part of the HDMI Gaming Features introduced in HDMI 2.1. allm_mode_capable indicates whether connector (sink) supports ALLM allm_mode tells the driver which triggering mode to use. Off, dynamic and always on. Dynamic mode should consider the content type and the state of the crtc to discern whether ALLM should be activated. Recommendation is Content Type Hint =3D=3D Game || VRR_ENABLED based on testing behaviors on other operating systems and multiple GPU vendors + how TVs behave. Signed-off-by: Tomasz Paku=C5=82a --- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++ drivers/gpu/drm/drm_connector.c | 115 ++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 37 ++++++++++ 3 files changed, 156 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic= _uapi.c index a3ad2fe3306b..cfb50a3d617d 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -758,6 +758,8 @@ static int drm_atomic_connector_set_property(struct drm= _connector *connector, state->content_type =3D val; } else if (property =3D=3D connector->scaling_mode_property) { state->scaling_mode =3D val; + } else if (property =3D=3D connector->allm_mode_property) { + state->allm_mode =3D val; } else if (property =3D=3D config->content_protection_property) { if (val =3D=3D DRM_MODE_CONTENT_PROTECTION_ENABLED) { drm_dbg_kms(dev, "only drivers can set CP Enabled\n"); @@ -855,6 +857,8 @@ drm_atomic_connector_get_property(struct drm_connector = *connector, *val =3D state->colorspace; } else if (property =3D=3D connector->scaling_mode_property) { *val =3D state->scaling_mode; + } else if (property =3D=3D connector->allm_mode_property) { + *val =3D state->allm_mode; } else if (property =3D=3D config->hdr_output_metadata_property) { *val =3D state->hdr_output_metadata ? state->hdr_output_metadata->base.id : 0; diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connecto= r.c index 5bb38b80e214..14d504ca73f4 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1226,6 +1226,12 @@ static const struct drm_prop_enum_list drm_content_t= ype_enum_list[] =3D { { DRM_MODE_CONTENT_TYPE_GAME, "Game" }, }; =20 +static const struct drm_prop_enum_list drm_allm_mode_enum_list[] =3D { + { DRM_ALLM_MODE_DISABLED, "Disabled" }, + { DRM_ALLM_MODE_ENABLED_DYNAMIC, "Dynamic" }, + { DRM_ALLM_MODE_ENABLED_FORCED, "Always On" }, +}; + static const struct drm_prop_enum_list drm_panel_orientation_enum_list[] = =3D { { DRM_MODE_PANEL_ORIENTATION_NORMAL, "Normal" }, { DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP, "Upside Down" }, @@ -2449,6 +2455,94 @@ int drm_connector_attach_passive_vrr_capable_propert= y( } EXPORT_SYMBOL(drm_connector_attach_passive_vrr_capable_property); =20 +/** + * DOC: Auto Low Latency Mode properties + * + * Auto Low Latency capable HDMI displays (be it PC monitors or TVs) + * can automatically enter a "low latency" mode, usually named "Game Mode"= by + * receiving specific data in HDMI Forum vendor-specific info frame. + * + * This usually is the best mode for PC usage but disables as much process= ing as + * possible which might not be desireable on lower end devices casing them= to + * produce an image that's unsatisfactory to some users. + * + * "allm_capable": + * Optional &drm_connector boolean property that drivers should attach + * with drm_connector_attach_allm_capable_property() on connectors that + * could support Auto Low Latency Mode. Drivers should update the + * property value by calling drm_connector_set_allm_capable_property(). + * + * Absence of the property should indicate absence of support. + * + * "ALLM_MODE": + * Optional &drm_connector enum property enables compositors to control and + * expose ALLM triggering behavior modes to the end user where: + * + * - ALLM_MODE_DISABLED: completely disabled ALLM signalling. + * - ALLM_MODE_ENABLED_DYNAMIC: triggers ALLM based on current needs. + * preferrably display content type hint being set to Game by compositor + * or VRR being enabled and active. + * - ALLM_MODE_ENABLED_FORCED: always-on ALLM triggering. + * + * ALLM_MODE_ENABLED_DYNAMIC should behave like gaming devices such as + * consoles where ALLM is only triggered when needed. It's main purpose is + * gaming (part of so-called HDMI gaming features). + * + * If compositors wish to control ALLM completely on their own, they can + * switch between disabled and enabled_forced modes. + */ + +/** + * drm_connector_attach_allm_capable_property - creates the + * allm_capable property + * @connector: connector to create the allm_capable property on. + * + * This is used by atomic drivers to add support for querying + * Auto Low Latency Mode capability for a connector. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_attach_allm_capable_property(struct drm_connector *conne= ctor) +{ + struct drm_device *dev =3D connector->dev; + struct drm_property *prop; + + if (!connector->allm_capable_property) { + prop =3D drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE, + "allm_capable"); + if (!prop) + return -ENOMEM; + + connector->allm_capable_property =3D prop; + drm_object_attach_property(&connector->base, prop, 0); + } + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_allm_capable_property); + +int drm_connector_attach_allm_mode_property(struct drm_connector *connecto= r) +{ + struct drm_property *prop; + + if (connector->allm_mode_property) + return 0; + + prop =3D drm_property_create_enum(connector->dev, 0, "allm_mode", + drm_allm_mode_enum_list, + ARRAY_SIZE(drm_allm_mode_enum_list)); + if (!prop) + return -ENOMEM; + + connector->allm_mode_property =3D prop; + drm_object_attach_property(&connector->base, prop, + DRM_ALLM_MODE_DISABLED); + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_allm_mode_property); + /** * drm_connector_attach_scaling_mode_property - attach atomic scaling mode= property * @connector: connector to attach scaling mode property on. @@ -3041,6 +3135,27 @@ void drm_connector_set_passive_vrr_capable_property( } EXPORT_SYMBOL(drm_connector_set_passive_vrr_capable_property); =20 +/** + * drm_connector_set_allm_capable_property - sets Auto Low Latency Mode + * capable property for a connector + * @connector: drm connector + * @capable: True if the connector is ALLM capable + * + * Should be used by atomic drivers to update the indicated support for + * Auto Low Latency Mode over a connector. + */ +void drm_connector_set_allm_capable_property( + struct drm_connector *connector, bool capable) +{ + if (!connector->allm_capable_property) + return; + + drm_object_property_set_value(&connector->base, + connector->allm_capable_property, + capable); +} +EXPORT_SYMBOL(drm_connector_set_allm_capable_property); + /** * drm_connector_set_panel_orientation - sets the connector's panel_orient= ation * @connector: connector for which to set the panel-orientation property. diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 30dd9737bfe0..fa4abfe8971e 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -58,6 +58,12 @@ enum drm_connector_force { DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */ }; =20 +enum drm_allm_mode { + DRM_ALLM_MODE_DISABLED, + DRM_ALLM_MODE_ENABLED_DYNAMIC, + DRM_ALLM_MODE_ENABLED_FORCED, +}; + /** * enum drm_connector_status - status for a &drm_connector * @@ -1147,6 +1153,13 @@ struct drm_connector_state { */ unsigned int content_protection; =20 + /** + * @allm_mode: Connector property to control the + * HDMI Auto Low Latency Mode trigger setting. + * The %DRM_ALLM_MODE_\* values must match the values. + */ + enum drm_allm_mode allm_mode; + /** * @colorspace: State variable for Connector property to request * colorspace change on Sink. This is most commonly used to switch @@ -2112,6 +2125,26 @@ struct drm_connector { */ struct drm_property *passive_vrr_capable_property; =20 + /** + * @allm_capable_property: Optional property to help userspace + * query hardware support for HDMI Auto Low Latency Mode on a connector. + * Drivers can add the property to a connector by calling + * drm_connector_attach_allm_capable_property(). + * + * This should be updated only by calling + * drm_connector_set_allm_capable_property(). + */ + struct drm_property *allm_capable_property; + + /** + * @allm_mode_property: + * + * Indicates HDMI Auto Low Latency Mode triggering mode for connector. + * Support for the requested state will depend on driver and hardware + * capabiltiy - lacking support is not treated as failure. + */ + struct drm_property *allm_mode_property; + /** * @colorspace_property: Connector property to set the suitable * colorspace supported by the sink. @@ -2508,6 +2541,8 @@ int drm_connector_attach_vrr_capable_property( struct drm_connector *connector); int drm_connector_attach_passive_vrr_capable_property( struct drm_connector *connector); +int drm_connector_attach_allm_capable_property(struct drm_connector *conne= ctor); +int drm_connector_attach_allm_mode_property(struct drm_connector *connecto= r); int drm_connector_attach_broadcast_rgb_property(struct drm_connector *conn= ector); int drm_connector_attach_colorspace_property(struct drm_connector *connect= or); int drm_connector_attach_hdr_output_metadata_property(struct drm_connector= *connector); @@ -2532,6 +2567,8 @@ void drm_connector_set_vrr_capable_property( struct drm_connector *connector, bool capable); void drm_connector_set_passive_vrr_capable_property( struct drm_connector *connector, bool capable); +void drm_connector_set_allm_capable_property( + struct drm_connector *connector, bool capable); int drm_connector_set_panel_orientation( struct drm_connector *connector, enum drm_panel_orientation panel_orientation); --=20 2.53.0