From: Antheas Kapenekakis lkml@antheas.dev
[ Upstream commit 9931e4be11f2129a20ffd908bc364598a63016f8 ]
Currently, having a valid panel_id match is required to use the quirk system. For certain devices, we know that all SKUs need a certain quirk. Therefore, allow not specifying ident by only checking for a match if panel_id is non-zero.
Tested-by: Philip Müller philm@manjaro.org Reviewed-by: Mario Limonciello mario.limonciello@amd.com Signed-off-by: Antheas Kapenekakis lkml@antheas.dev Link: https://lore.kernel.org/r/20250829145541.512671-2-lkml@antheas.dev Acked-by: Alex Deucher alexander.deucher@amd.com Signed-off-by: Mario Limonciello (AMD) superm1@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What changed: In drivers/gpu/drm/drm_panel_backlight_quirks.c, the match helper was relaxed to make the EDID check optional: - Before: drm_panel_min_backlight_quirk_matches() unconditionally required an EDID identity match and returned false if drm_edid_match() failed. - Code: drivers/gpu/drm/drm_panel_backlight_quirks.c, function drm_panel_min_backlight_quirk_matches, the line was: - if (!drm_edid_match(edid, &quirk->ident)) return false; - After: The EDID check is performed only if the quirk’s EDID identity contains a non-zero panel_id: - Code: drivers/gpu/drm/drm_panel_backlight_quirks.c, function drm_panel_min_backlight_quirk_matches: - if (quirk->ident.panel_id && !drm_edid_match(edid, &quirk->ident)) return false;
- Why this matters (bug it addresses): Previously, even when the platform (DMI) uniquely and reliably identifies devices that need a backlight quirk “across all SKUs,” the quirk would not apply unless the EDID identity also matched. For platforms where the quirk should apply regardless of panel EDID (e.g., multiple panel variants shipping under the same system SKU, or unreliable EDID), this produced a false negative and the quirk was never applied. This can cause user-visible issues such as unusable minimum brightness, flicker, or a too-dark panel at low settings.
- Scope and risk: - Localized change: A single conditional in the matching helper; no API/ABI change. All existing quirks that specify a valid EDID panel_id keep the same behavior. Only quirks that intentionally set ident.panel_id = 0 now match on DMI alone. - Dependencies: The helper still requires DMI to match (via dmi_match), and only skips the EDID check when ident.panel_id is zero, so the chance of accidental overmatching is low. The EDID match itself remains strict when requested (drm_edid_match compares the computed panel_id and, if provided, the panel name). - Callers/usage: The result is consumed to adjust backlight behavior (e.g., min_brightness or brightness_mask) by drivers like AMDGPU on eDP connectors (see drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:3692 calling drm_get_panel_backlight_quirk). The change therefore directly impacts user experience in a constrained and intended way.
- Stable policy fit: - Fixes a real user-visible problem (quirks not applying where they should). - Minimal, contained change (one conditional). - No architectural changes or new features; it only enables proper use of the existing quirk mechanism for platforms known to require it. - Low regression risk: Existing EDID-specific quirks remain unaffected; only explicitly EDID-agnostic entries (ident.panel_id = 0) are enabled.
- Practical note: On its own, this change is largely inert unless there are DMI-only quirk entries (with ident.panel_id unset) in the stable branch’s quirk table. It is best paired with the corresponding quirk entries that rely on this behavior. Nonetheless, backporting this enabling fix is safe and prepares stable trees to accept those entries cleanly.
drivers/gpu/drm/drm_panel_backlight_quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_panel_backlight_quirks.c b/drivers/gpu/drm/drm_panel_backlight_quirks.c index 598f812b7cb38..b38b33e26ea5c 100644 --- a/drivers/gpu/drm/drm_panel_backlight_quirks.c +++ b/drivers/gpu/drm/drm_panel_backlight_quirks.c @@ -50,7 +50,7 @@ static bool drm_panel_min_backlight_quirk_matches(const struct drm_panel_min_bac if (!dmi_match(quirk->dmi_match.field, quirk->dmi_match.value)) return false;
- if (!drm_edid_match(edid, &quirk->ident)) + if (quirk->ident.panel_id && !drm_edid_match(edid, &quirk->ident)) return false;
return true;