Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: panel-backlight-quirks: Add secondary DMI match

Using a single DMI match only allows matching per manufacturer.
Introduce a second optional match to allow matching make/model.
In addition, make DMI optional to allow matching only by EDID.

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-4-lkml@antheas.dev
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

authored by

Antheas Kapenekakis and committed by
Mario Limonciello (AMD)
f7033fab 6eee1ef9

+14 -5
+14 -5
drivers/gpu/drm/drm_panel_backlight_quirks.c
··· 8 8 #include <drm/drm_edid.h> 9 9 #include <drm/drm_utils.h> 10 10 11 + struct drm_panel_match { 12 + enum dmi_field field; 13 + const char * const value; 14 + }; 15 + 11 16 struct drm_get_panel_backlight_quirk { 12 - struct { 13 - enum dmi_field field; 14 - const char * const value; 15 - } dmi_match; 17 + struct drm_panel_match dmi_match; 18 + struct drm_panel_match dmi_match_other; 16 19 struct drm_edid_ident ident; 17 20 struct drm_panel_backlight_quirk quirk; 18 21 }; ··· 51 48 const struct drm_get_panel_backlight_quirk *quirk, 52 49 const struct drm_edid *edid) 53 50 { 54 - if (!dmi_match(quirk->dmi_match.field, quirk->dmi_match.value)) 51 + if (quirk->dmi_match.field && 52 + !dmi_match(quirk->dmi_match.field, quirk->dmi_match.value)) 53 + return false; 54 + 55 + if (quirk->dmi_match_other.field && 56 + !dmi_match(quirk->dmi_match_other.field, 57 + quirk->dmi_match_other.value)) 55 58 return false; 56 59 57 60 if (quirk->ident.panel_id && !drm_edid_match(edid, &quirk->ident))