This source file includes following definitions.
- quirk_ssc_force_disable
- quirk_invert_brightness
- quirk_backlight_present
- quirk_increase_t12_delay
- quirk_increase_ddi_disabled_time
- intel_dmi_reverse_brightness
- intel_init_quirks
1
2
3
4
5
6 #include <linux/dmi.h>
7
8 #include "intel_display_types.h"
9 #include "intel_quirks.h"
10
11
12
13
14 static void quirk_ssc_force_disable(struct drm_i915_private *i915)
15 {
16 i915->quirks |= QUIRK_LVDS_SSC_DISABLE;
17 DRM_INFO("applying lvds SSC disable quirk\n");
18 }
19
20
21
22
23
24 static void quirk_invert_brightness(struct drm_i915_private *i915)
25 {
26 i915->quirks |= QUIRK_INVERT_BRIGHTNESS;
27 DRM_INFO("applying inverted panel brightness quirk\n");
28 }
29
30
31 static void quirk_backlight_present(struct drm_i915_private *i915)
32 {
33 i915->quirks |= QUIRK_BACKLIGHT_PRESENT;
34 DRM_INFO("applying backlight present quirk\n");
35 }
36
37
38
39
40 static void quirk_increase_t12_delay(struct drm_i915_private *i915)
41 {
42 i915->quirks |= QUIRK_INCREASE_T12_DELAY;
43 DRM_INFO("Applying T12 delay quirk\n");
44 }
45
46
47
48
49
50 static void quirk_increase_ddi_disabled_time(struct drm_i915_private *i915)
51 {
52 i915->quirks |= QUIRK_INCREASE_DDI_DISABLED_TIME;
53 DRM_INFO("Applying Increase DDI Disabled quirk\n");
54 }
55
56 struct intel_quirk {
57 int device;
58 int subsystem_vendor;
59 int subsystem_device;
60 void (*hook)(struct drm_i915_private *i915);
61 };
62
63
64 struct intel_dmi_quirk {
65 void (*hook)(struct drm_i915_private *i915);
66 const struct dmi_system_id (*dmi_id_list)[];
67 };
68
69 static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
70 {
71 DRM_INFO("Backlight polarity reversed on %s\n", id->ident);
72 return 1;
73 }
74
75 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
76 {
77 .dmi_id_list = &(const struct dmi_system_id[]) {
78 {
79 .callback = intel_dmi_reverse_brightness,
80 .ident = "NCR Corporation",
81 .matches = {DMI_MATCH(DMI_SYS_VENDOR, "NCR Corporation"),
82 DMI_MATCH(DMI_PRODUCT_NAME, ""),
83 },
84 },
85 { }
86 },
87 .hook = quirk_invert_brightness,
88 },
89 };
90
91 static struct intel_quirk intel_quirks[] = {
92
93 { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
94
95
96 { 0x0046, 0x104d, 0x9076, quirk_ssc_force_disable },
97
98
99 { 0x2a42, 0x1025, 0x0459, quirk_invert_brightness },
100
101
102 { 0x2a42, 0x1025, 0x0210, quirk_invert_brightness },
103
104
105 { 0x2a42, 0x1025, 0x0212, quirk_invert_brightness },
106
107
108 { 0x2a42, 0x1025, 0x034b, quirk_invert_brightness },
109
110
111 { 0x2a42, 0x1025, 0x0260, quirk_invert_brightness },
112
113
114 { 0x2a42, 0x1025, 0x048a, quirk_invert_brightness },
115
116
117 { 0x0a06, 0x1025, 0x0a11, quirk_backlight_present },
118
119
120 { 0x0a16, 0x1025, 0x0a11, quirk_backlight_present },
121
122
123 { 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
124
125
126 { 0x2a02, 0x106b, 0x00a1, quirk_backlight_present },
127
128
129 { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
130
131
132 { 0x0a06, 0x103c, 0x21ed, quirk_backlight_present },
133
134
135 { 0x0a06, 0x1028, 0x0a35, quirk_backlight_present },
136
137
138 { 0x0a16, 0x1028, 0x0a35, quirk_backlight_present },
139
140
141 { 0x191B, 0x1179, 0xF840, quirk_increase_t12_delay },
142
143
144 { 0x3185, 0x8086, 0x2072, quirk_increase_ddi_disabled_time },
145 { 0x3184, 0x8086, 0x2072, quirk_increase_ddi_disabled_time },
146
147 { 0x3185, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
148 { 0x3184, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
149 };
150
151 void intel_init_quirks(struct drm_i915_private *i915)
152 {
153 struct pci_dev *d = i915->drm.pdev;
154 int i;
155
156 for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) {
157 struct intel_quirk *q = &intel_quirks[i];
158
159 if (d->device == q->device &&
160 (d->subsystem_vendor == q->subsystem_vendor ||
161 q->subsystem_vendor == PCI_ANY_ID) &&
162 (d->subsystem_device == q->subsystem_device ||
163 q->subsystem_device == PCI_ANY_ID))
164 q->hook(i915);
165 }
166 for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks); i++) {
167 if (dmi_check_system(*intel_dmi_quirks[i].dmi_id_list) != 0)
168 intel_dmi_quirks[i].hook(i915);
169 }
170 }