Skip to content

Commit f7033fa

Browse files
antheassuperm1
authored andcommitted
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>
1 parent 6eee1ef commit f7033fa

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

drivers/gpu/drm/drm_panel_backlight_quirks.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
#include <drm/drm_edid.h>
99
#include <drm/drm_utils.h>
1010

11+
struct drm_panel_match {
12+
enum dmi_field field;
13+
const char * const value;
14+
};
15+
1116
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;
1619
struct drm_edid_ident ident;
1720
struct drm_panel_backlight_quirk quirk;
1821
};
@@ -48,7 +51,13 @@ static bool drm_panel_min_backlight_quirk_matches(
4851
const struct drm_get_panel_backlight_quirk *quirk,
4952
const struct drm_edid *edid)
5053
{
51-
if (!dmi_match(quirk->dmi_match.field, quirk->dmi_match.value))
54+
if (quirk->dmi_match.field &&
55+
!dmi_match(quirk->dmi_match.field, quirk->dmi_match.value))
56+
return false;
57+
58+
if (quirk->dmi_match_other.field &&
59+
!dmi_match(quirk->dmi_match_other.field,
60+
quirk->dmi_match_other.value))
5261
return false;
5362

5463
if (quirk->ident.panel_id && !drm_edid_match(edid, &quirk->ident))

0 commit comments

Comments
 (0)