@@ -66,34 +66,36 @@ static int oui(u8 first, u8 second, u8 third)
66
66
* on as many displays as possible).
67
67
*/
68
68
69
- /* First detailed mode wrong, use largest 60Hz mode */
70
- #define EDID_QUIRK_PREFER_LARGE_60 (1 << 0)
71
- /* Reported 135MHz pixel clock is too high, needs adjustment */
72
- #define EDID_QUIRK_135_CLOCK_TOO_HIGH (1 << 1)
73
- /* Prefer the largest mode at 75 Hz */
74
- #define EDID_QUIRK_PREFER_LARGE_75 (1 << 2)
75
- /* Detail timing is in cm not mm */
76
- #define EDID_QUIRK_DETAILED_IN_CM (1 << 3)
77
- /* Detailed timing descriptors have bogus size values, so just take the
78
- * maximum size and use that.
79
- */
80
- #define EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE (1 << 4)
81
- /* use +hsync +vsync for detailed mode */
82
- #define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6)
83
- /* Force reduced-blanking timings for detailed modes */
84
- #define EDID_QUIRK_FORCE_REDUCED_BLANKING (1 << 7)
85
- /* Force 8bpc */
86
- #define EDID_QUIRK_FORCE_8BPC (1 << 8)
87
- /* Force 12bpc */
88
- #define EDID_QUIRK_FORCE_12BPC (1 << 9)
89
- /* Force 6bpc */
90
- #define EDID_QUIRK_FORCE_6BPC (1 << 10)
91
- /* Force 10bpc */
92
- #define EDID_QUIRK_FORCE_10BPC (1 << 11)
93
- /* Non desktop display (i.e. HMD) */
94
- #define EDID_QUIRK_NON_DESKTOP (1 << 12)
95
- /* Cap the DSC target bitrate to 15bpp */
96
- #define EDID_QUIRK_CAP_DSC_15BPP (1 << 13)
69
+ enum drm_edid_internal_quirk {
70
+ /* First detailed mode wrong, use largest 60Hz mode */
71
+ EDID_QUIRK_PREFER_LARGE_60 ,
72
+ /* Reported 135MHz pixel clock is too high, needs adjustment */
73
+ EDID_QUIRK_135_CLOCK_TOO_HIGH ,
74
+ /* Prefer the largest mode at 75 Hz */
75
+ EDID_QUIRK_PREFER_LARGE_75 ,
76
+ /* Detail timing is in cm not mm */
77
+ EDID_QUIRK_DETAILED_IN_CM ,
78
+ /* Detailed timing descriptors have bogus size values, so just take the
79
+ * maximum size and use that.
80
+ */
81
+ EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ,
82
+ /* use +hsync +vsync for detailed mode */
83
+ EDID_QUIRK_DETAILED_SYNC_PP ,
84
+ /* Force reduced-blanking timings for detailed modes */
85
+ EDID_QUIRK_FORCE_REDUCED_BLANKING ,
86
+ /* Force 8bpc */
87
+ EDID_QUIRK_FORCE_8BPC ,
88
+ /* Force 12bpc */
89
+ EDID_QUIRK_FORCE_12BPC ,
90
+ /* Force 6bpc */
91
+ EDID_QUIRK_FORCE_6BPC ,
92
+ /* Force 10bpc */
93
+ EDID_QUIRK_FORCE_10BPC ,
94
+ /* Non desktop display (i.e. HMD) */
95
+ EDID_QUIRK_NON_DESKTOP ,
96
+ /* Cap the DSC target bitrate to 15bpp */
97
+ EDID_QUIRK_CAP_DSC_15BPP ,
98
+ };
97
99
98
100
#define MICROSOFT_IEEE_OUI 0xca125c
99
101
@@ -128,124 +130,124 @@ static const struct edid_quirk {
128
130
u32 quirks ;
129
131
} edid_quirk_list [] = {
130
132
/* Acer AL1706 */
131
- EDID_QUIRK ('A' , 'C' , 'R' , 44358 , EDID_QUIRK_PREFER_LARGE_60 ),
133
+ EDID_QUIRK ('A' , 'C' , 'R' , 44358 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
132
134
/* Acer F51 */
133
- EDID_QUIRK ('A' , 'P' , 'I' , 0x7602 , EDID_QUIRK_PREFER_LARGE_60 ),
135
+ EDID_QUIRK ('A' , 'P' , 'I' , 0x7602 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
134
136
135
137
/* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
136
- EDID_QUIRK ('A' , 'E' , 'O' , 0 , EDID_QUIRK_FORCE_6BPC ),
138
+ EDID_QUIRK ('A' , 'E' , 'O' , 0 , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
137
139
138
140
/* BenQ GW2765 */
139
- EDID_QUIRK ('B' , 'N' , 'Q' , 0x78d6 , EDID_QUIRK_FORCE_8BPC ),
141
+ EDID_QUIRK ('B' , 'N' , 'Q' , 0x78d6 , BIT ( EDID_QUIRK_FORCE_8BPC ) ),
140
142
141
143
/* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */
142
- EDID_QUIRK ('B' , 'O' , 'E' , 0x78b , EDID_QUIRK_FORCE_6BPC ),
144
+ EDID_QUIRK ('B' , 'O' , 'E' , 0x78b , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
143
145
144
146
/* CPT panel of Asus UX303LA reports 8 bpc, but is a 6 bpc panel */
145
- EDID_QUIRK ('C' , 'P' , 'T' , 0x17df , EDID_QUIRK_FORCE_6BPC ),
147
+ EDID_QUIRK ('C' , 'P' , 'T' , 0x17df , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
146
148
147
149
/* SDC panel of Lenovo B50-80 reports 8 bpc, but is a 6 bpc panel */
148
- EDID_QUIRK ('S' , 'D' , 'C' , 0x3652 , EDID_QUIRK_FORCE_6BPC ),
150
+ EDID_QUIRK ('S' , 'D' , 'C' , 0x3652 , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
149
151
150
152
/* BOE model 0x0771 reports 8 bpc, but is a 6 bpc panel */
151
- EDID_QUIRK ('B' , 'O' , 'E' , 0x0771 , EDID_QUIRK_FORCE_6BPC ),
153
+ EDID_QUIRK ('B' , 'O' , 'E' , 0x0771 , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
152
154
153
155
/* Belinea 10 15 55 */
154
- EDID_QUIRK ('M' , 'A' , 'X' , 1516 , EDID_QUIRK_PREFER_LARGE_60 ),
155
- EDID_QUIRK ('M' , 'A' , 'X' , 0x77e , EDID_QUIRK_PREFER_LARGE_60 ),
156
+ EDID_QUIRK ('M' , 'A' , 'X' , 1516 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
157
+ EDID_QUIRK ('M' , 'A' , 'X' , 0x77e , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
156
158
157
159
/* Envision Peripherals, Inc. EN-7100e */
158
- EDID_QUIRK ('E' , 'P' , 'I' , 59264 , EDID_QUIRK_135_CLOCK_TOO_HIGH ),
160
+ EDID_QUIRK ('E' , 'P' , 'I' , 59264 , BIT ( EDID_QUIRK_135_CLOCK_TOO_HIGH ) ),
159
161
/* Envision EN2028 */
160
- EDID_QUIRK ('E' , 'P' , 'I' , 8232 , EDID_QUIRK_PREFER_LARGE_60 ),
162
+ EDID_QUIRK ('E' , 'P' , 'I' , 8232 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
161
163
162
164
/* Funai Electronics PM36B */
163
- EDID_QUIRK ('F' , 'C' , 'M' , 13600 , EDID_QUIRK_PREFER_LARGE_75 |
164
- EDID_QUIRK_DETAILED_IN_CM ),
165
+ EDID_QUIRK ('F' , 'C' , 'M' , 13600 , BIT ( EDID_QUIRK_PREFER_LARGE_75 ) |
166
+ BIT ( EDID_QUIRK_DETAILED_IN_CM ) ),
165
167
166
168
/* LG 27GP950 */
167
- EDID_QUIRK ('G' , 'S' , 'M' , 0x5bbf , EDID_QUIRK_CAP_DSC_15BPP ),
169
+ EDID_QUIRK ('G' , 'S' , 'M' , 0x5bbf , BIT ( EDID_QUIRK_CAP_DSC_15BPP ) ),
168
170
169
171
/* LG 27GN950 */
170
- EDID_QUIRK ('G' , 'S' , 'M' , 0x5b9a , EDID_QUIRK_CAP_DSC_15BPP ),
172
+ EDID_QUIRK ('G' , 'S' , 'M' , 0x5b9a , BIT ( EDID_QUIRK_CAP_DSC_15BPP ) ),
171
173
172
174
/* LGD panel of HP zBook 17 G2, eDP 10 bpc, but reports unknown bpc */
173
- EDID_QUIRK ('L' , 'G' , 'D' , 764 , EDID_QUIRK_FORCE_10BPC ),
175
+ EDID_QUIRK ('L' , 'G' , 'D' , 764 , BIT ( EDID_QUIRK_FORCE_10BPC ) ),
174
176
175
177
/* LG Philips LCD LP154W01-A5 */
176
- EDID_QUIRK ('L' , 'P' , 'L' , 0 , EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ),
177
- EDID_QUIRK ('L' , 'P' , 'L' , 0x2a00 , EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ),
178
+ EDID_QUIRK ('L' , 'P' , 'L' , 0 , BIT ( EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ) ),
179
+ EDID_QUIRK ('L' , 'P' , 'L' , 0x2a00 , BIT ( EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ) ),
178
180
179
181
/* Samsung SyncMaster 205BW. Note: irony */
180
- EDID_QUIRK ('S' , 'A' , 'M' , 541 , EDID_QUIRK_DETAILED_SYNC_PP ),
182
+ EDID_QUIRK ('S' , 'A' , 'M' , 541 , BIT ( EDID_QUIRK_DETAILED_SYNC_PP ) ),
181
183
/* Samsung SyncMaster 22[5-6]BW */
182
- EDID_QUIRK ('S' , 'A' , 'M' , 596 , EDID_QUIRK_PREFER_LARGE_60 ),
183
- EDID_QUIRK ('S' , 'A' , 'M' , 638 , EDID_QUIRK_PREFER_LARGE_60 ),
184
+ EDID_QUIRK ('S' , 'A' , 'M' , 596 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
185
+ EDID_QUIRK ('S' , 'A' , 'M' , 638 , BIT ( EDID_QUIRK_PREFER_LARGE_60 ) ),
184
186
185
187
/* Sony PVM-2541A does up to 12 bpc, but only reports max 8 bpc */
186
- EDID_QUIRK ('S' , 'N' , 'Y' , 0x2541 , EDID_QUIRK_FORCE_12BPC ),
188
+ EDID_QUIRK ('S' , 'N' , 'Y' , 0x2541 , BIT ( EDID_QUIRK_FORCE_12BPC ) ),
187
189
188
190
/* ViewSonic VA2026w */
189
- EDID_QUIRK ('V' , 'S' , 'C' , 5020 , EDID_QUIRK_FORCE_REDUCED_BLANKING ),
191
+ EDID_QUIRK ('V' , 'S' , 'C' , 5020 , BIT ( EDID_QUIRK_FORCE_REDUCED_BLANKING ) ),
190
192
191
193
/* Medion MD 30217 PG */
192
- EDID_QUIRK ('M' , 'E' , 'D' , 0x7b8 , EDID_QUIRK_PREFER_LARGE_75 ),
194
+ EDID_QUIRK ('M' , 'E' , 'D' , 0x7b8 , BIT ( EDID_QUIRK_PREFER_LARGE_75 ) ),
193
195
194
196
/* Lenovo G50 */
195
- EDID_QUIRK ('S' , 'D' , 'C' , 18514 , EDID_QUIRK_FORCE_6BPC ),
197
+ EDID_QUIRK ('S' , 'D' , 'C' , 18514 , BIT ( EDID_QUIRK_FORCE_6BPC ) ),
196
198
197
199
/* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */
198
- EDID_QUIRK ('S' , 'E' , 'C' , 0xd033 , EDID_QUIRK_FORCE_8BPC ),
200
+ EDID_QUIRK ('S' , 'E' , 'C' , 0xd033 , BIT ( EDID_QUIRK_FORCE_8BPC ) ),
199
201
200
202
/* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
201
- EDID_QUIRK ('E' , 'T' , 'R' , 13896 , EDID_QUIRK_FORCE_8BPC ),
203
+ EDID_QUIRK ('E' , 'T' , 'R' , 13896 , BIT ( EDID_QUIRK_FORCE_8BPC ) ),
202
204
203
205
/* Valve Index Headset */
204
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91a8 , EDID_QUIRK_NON_DESKTOP ),
205
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b0 , EDID_QUIRK_NON_DESKTOP ),
206
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b1 , EDID_QUIRK_NON_DESKTOP ),
207
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b2 , EDID_QUIRK_NON_DESKTOP ),
208
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b3 , EDID_QUIRK_NON_DESKTOP ),
209
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b4 , EDID_QUIRK_NON_DESKTOP ),
210
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b5 , EDID_QUIRK_NON_DESKTOP ),
211
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b6 , EDID_QUIRK_NON_DESKTOP ),
212
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b7 , EDID_QUIRK_NON_DESKTOP ),
213
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b8 , EDID_QUIRK_NON_DESKTOP ),
214
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91b9 , EDID_QUIRK_NON_DESKTOP ),
215
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91ba , EDID_QUIRK_NON_DESKTOP ),
216
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91bb , EDID_QUIRK_NON_DESKTOP ),
217
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91bc , EDID_QUIRK_NON_DESKTOP ),
218
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91bd , EDID_QUIRK_NON_DESKTOP ),
219
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91be , EDID_QUIRK_NON_DESKTOP ),
220
- EDID_QUIRK ('V' , 'L' , 'V' , 0x91bf , EDID_QUIRK_NON_DESKTOP ),
206
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91a8 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
207
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b0 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
208
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b1 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
209
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b2 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
210
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b3 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
211
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b4 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
212
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b5 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
213
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b6 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
214
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b7 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
215
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b8 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
216
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91b9 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
217
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91ba , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
218
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91bb , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
219
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91bc , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
220
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91bd , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
221
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91be , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
222
+ EDID_QUIRK ('V' , 'L' , 'V' , 0x91bf , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
221
223
222
224
/* HTC Vive and Vive Pro VR Headsets */
223
- EDID_QUIRK ('H' , 'V' , 'R' , 0xaa01 , EDID_QUIRK_NON_DESKTOP ),
224
- EDID_QUIRK ('H' , 'V' , 'R' , 0xaa02 , EDID_QUIRK_NON_DESKTOP ),
225
+ EDID_QUIRK ('H' , 'V' , 'R' , 0xaa01 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
226
+ EDID_QUIRK ('H' , 'V' , 'R' , 0xaa02 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
225
227
226
228
/* Oculus Rift DK1, DK2, CV1 and Rift S VR Headsets */
227
- EDID_QUIRK ('O' , 'V' , 'R' , 0x0001 , EDID_QUIRK_NON_DESKTOP ),
228
- EDID_QUIRK ('O' , 'V' , 'R' , 0x0003 , EDID_QUIRK_NON_DESKTOP ),
229
- EDID_QUIRK ('O' , 'V' , 'R' , 0x0004 , EDID_QUIRK_NON_DESKTOP ),
230
- EDID_QUIRK ('O' , 'V' , 'R' , 0x0012 , EDID_QUIRK_NON_DESKTOP ),
229
+ EDID_QUIRK ('O' , 'V' , 'R' , 0x0001 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
230
+ EDID_QUIRK ('O' , 'V' , 'R' , 0x0003 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
231
+ EDID_QUIRK ('O' , 'V' , 'R' , 0x0004 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
232
+ EDID_QUIRK ('O' , 'V' , 'R' , 0x0012 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
231
233
232
234
/* Windows Mixed Reality Headsets */
233
- EDID_QUIRK ('A' , 'C' , 'R' , 0x7fce , EDID_QUIRK_NON_DESKTOP ),
234
- EDID_QUIRK ('L' , 'E' , 'N' , 0x0408 , EDID_QUIRK_NON_DESKTOP ),
235
- EDID_QUIRK ('F' , 'U' , 'J' , 0x1970 , EDID_QUIRK_NON_DESKTOP ),
236
- EDID_QUIRK ('D' , 'E' , 'L' , 0x7fce , EDID_QUIRK_NON_DESKTOP ),
237
- EDID_QUIRK ('S' , 'E' , 'C' , 0x144a , EDID_QUIRK_NON_DESKTOP ),
238
- EDID_QUIRK ('A' , 'U' , 'S' , 0xc102 , EDID_QUIRK_NON_DESKTOP ),
235
+ EDID_QUIRK ('A' , 'C' , 'R' , 0x7fce , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
236
+ EDID_QUIRK ('L' , 'E' , 'N' , 0x0408 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
237
+ EDID_QUIRK ('F' , 'U' , 'J' , 0x1970 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
238
+ EDID_QUIRK ('D' , 'E' , 'L' , 0x7fce , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
239
+ EDID_QUIRK ('S' , 'E' , 'C' , 0x144a , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
240
+ EDID_QUIRK ('A' , 'U' , 'S' , 0xc102 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
239
241
240
242
/* Sony PlayStation VR Headset */
241
- EDID_QUIRK ('S' , 'N' , 'Y' , 0x0704 , EDID_QUIRK_NON_DESKTOP ),
243
+ EDID_QUIRK ('S' , 'N' , 'Y' , 0x0704 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
242
244
243
245
/* Sensics VR Headsets */
244
- EDID_QUIRK ('S' , 'E' , 'N' , 0x1019 , EDID_QUIRK_NON_DESKTOP ),
246
+ EDID_QUIRK ('S' , 'E' , 'N' , 0x1019 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
245
247
246
248
/* OSVR HDK and HDK2 VR Headsets */
247
- EDID_QUIRK ('S' , 'V' , 'R' , 0x1019 , EDID_QUIRK_NON_DESKTOP ),
248
- EDID_QUIRK ('A' , 'U' , 'O' , 0x1111 , EDID_QUIRK_NON_DESKTOP ),
249
+ EDID_QUIRK ('S' , 'V' , 'R' , 0x1019 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
250
+ EDID_QUIRK ('A' , 'U' , 'O' , 0x1111 , BIT ( EDID_QUIRK_NON_DESKTOP ) ),
249
251
};
250
252
251
253
/*
@@ -2951,6 +2953,12 @@ static u32 edid_get_quirks(const struct drm_edid *drm_edid)
2951
2953
return 0 ;
2952
2954
}
2953
2955
2956
+ static bool drm_edid_has_internal_quirk (struct drm_connector * connector ,
2957
+ enum drm_edid_internal_quirk quirk )
2958
+ {
2959
+ return connector -> display_info .quirks & BIT (quirk );
2960
+ }
2961
+
2954
2962
#define MODE_SIZE (m ) ((m)->hdisplay * (m)->vdisplay)
2955
2963
#define MODE_REFRESH_DIFF (c ,t ) (abs((c) - (t)))
2956
2964
@@ -2960,17 +2968,16 @@ static u32 edid_get_quirks(const struct drm_edid *drm_edid)
2960
2968
*/
2961
2969
static void edid_fixup_preferred (struct drm_connector * connector )
2962
2970
{
2963
- const struct drm_display_info * info = & connector -> display_info ;
2964
2971
struct drm_display_mode * t , * cur_mode , * preferred_mode ;
2965
2972
int target_refresh = 0 ;
2966
2973
int cur_vrefresh , preferred_vrefresh ;
2967
2974
2968
2975
if (list_empty (& connector -> probed_modes ))
2969
2976
return ;
2970
2977
2971
- if (info -> quirks & EDID_QUIRK_PREFER_LARGE_60 )
2978
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_PREFER_LARGE_60 ) )
2972
2979
target_refresh = 60 ;
2973
- if (info -> quirks & EDID_QUIRK_PREFER_LARGE_75 )
2980
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_PREFER_LARGE_75 ) )
2974
2981
target_refresh = 75 ;
2975
2982
2976
2983
preferred_mode = list_first_entry (& connector -> probed_modes ,
@@ -3474,7 +3481,6 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
3474
3481
const struct drm_edid * drm_edid ,
3475
3482
const struct detailed_timing * timing )
3476
3483
{
3477
- const struct drm_display_info * info = & connector -> display_info ;
3478
3484
struct drm_device * dev = connector -> dev ;
3479
3485
struct drm_display_mode * mode ;
3480
3486
const struct detailed_pixel_timing * pt = & timing -> data .pixel_data ;
@@ -3508,7 +3514,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
3508
3514
return NULL ;
3509
3515
}
3510
3516
3511
- if (info -> quirks & EDID_QUIRK_FORCE_REDUCED_BLANKING ) {
3517
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_FORCE_REDUCED_BLANKING ) ) {
3512
3518
mode = drm_cvt_mode (dev , hactive , vactive , 60 , true, false, false);
3513
3519
if (!mode )
3514
3520
return NULL ;
@@ -3520,7 +3526,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
3520
3526
if (!mode )
3521
3527
return NULL ;
3522
3528
3523
- if (info -> quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH )
3529
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_135_CLOCK_TOO_HIGH ) )
3524
3530
mode -> clock = 1088 * 10 ;
3525
3531
else
3526
3532
mode -> clock = le16_to_cpu (timing -> pixel_clock ) * 10 ;
@@ -3551,7 +3557,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
3551
3557
3552
3558
drm_mode_do_interlace_quirk (mode , pt );
3553
3559
3554
- if (info -> quirks & EDID_QUIRK_DETAILED_SYNC_PP ) {
3560
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_DETAILED_SYNC_PP ) ) {
3555
3561
mode -> flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC ;
3556
3562
} else {
3557
3563
mode -> flags |= (pt -> misc & DRM_EDID_PT_HSYNC_POSITIVE ) ?
@@ -3564,12 +3570,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_connector *connecto
3564
3570
mode -> width_mm = pt -> width_mm_lo | (pt -> width_height_mm_hi & 0xf0 ) << 4 ;
3565
3571
mode -> height_mm = pt -> height_mm_lo | (pt -> width_height_mm_hi & 0xf ) << 8 ;
3566
3572
3567
- if (info -> quirks & EDID_QUIRK_DETAILED_IN_CM ) {
3573
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_DETAILED_IN_CM ) ) {
3568
3574
mode -> width_mm *= 10 ;
3569
3575
mode -> height_mm *= 10 ;
3570
3576
}
3571
3577
3572
- if (info -> quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ) {
3578
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE ) ) {
3573
3579
mode -> width_mm = drm_edid -> edid -> width_cm * 10 ;
3574
3580
mode -> height_mm = drm_edid -> edid -> height_cm * 10 ;
3575
3581
}
@@ -6734,26 +6740,26 @@ static void update_display_info(struct drm_connector *connector,
6734
6740
drm_update_mso (connector , drm_edid );
6735
6741
6736
6742
out :
6737
- if (info -> quirks & EDID_QUIRK_NON_DESKTOP ) {
6743
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_NON_DESKTOP ) ) {
6738
6744
drm_dbg_kms (connector -> dev , "[CONNECTOR:%d:%s] Non-desktop display%s\n" ,
6739
6745
connector -> base .id , connector -> name ,
6740
6746
info -> non_desktop ? " (redundant quirk)" : "" );
6741
6747
info -> non_desktop = true;
6742
6748
}
6743
6749
6744
- if (info -> quirks & EDID_QUIRK_CAP_DSC_15BPP )
6750
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_CAP_DSC_15BPP ) )
6745
6751
info -> max_dsc_bpp = 15 ;
6746
6752
6747
- if (info -> quirks & EDID_QUIRK_FORCE_6BPC )
6753
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_FORCE_6BPC ) )
6748
6754
info -> bpc = 6 ;
6749
6755
6750
- if (info -> quirks & EDID_QUIRK_FORCE_8BPC )
6756
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_FORCE_8BPC ) )
6751
6757
info -> bpc = 8 ;
6752
6758
6753
- if (info -> quirks & EDID_QUIRK_FORCE_10BPC )
6759
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_FORCE_10BPC ) )
6754
6760
info -> bpc = 10 ;
6755
6761
6756
- if (info -> quirks & EDID_QUIRK_FORCE_12BPC )
6762
+ if (drm_edid_has_internal_quirk ( connector , EDID_QUIRK_FORCE_12BPC ) )
6757
6763
info -> bpc = 12 ;
6758
6764
6759
6765
/* Depends on info->cea_rev set by drm_parse_cea_ext() above */
@@ -6918,7 +6924,6 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
6918
6924
static int _drm_edid_connector_add_modes (struct drm_connector * connector ,
6919
6925
const struct drm_edid * drm_edid )
6920
6926
{
6921
- const struct drm_display_info * info = & connector -> display_info ;
6922
6927
int num_modes = 0 ;
6923
6928
6924
6929
if (!drm_edid )
@@ -6948,7 +6953,8 @@ static int _drm_edid_connector_add_modes(struct drm_connector *connector,
6948
6953
if (drm_edid -> edid -> features & DRM_EDID_FEATURE_CONTINUOUS_FREQ )
6949
6954
num_modes += add_inferred_modes (connector , drm_edid );
6950
6955
6951
- if (info -> quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75 ))
6956
+ if (drm_edid_has_internal_quirk (connector , EDID_QUIRK_PREFER_LARGE_60 ) ||
6957
+ drm_edid_has_internal_quirk (connector , EDID_QUIRK_PREFER_LARGE_75 ))
6952
6958
edid_fixup_preferred (connector );
6953
6959
6954
6960
return num_modes ;
0 commit comments