2 * Copyright (c) 2006 Luc Verhaegen (quirks list)
3 * Copyright (c) 2007 Intel Corporation
4 * Jesse Barnes <jesse.barnes@intel.com>
6 * DDC probing routines (drm_ddc_read & drm_do_probe_ddc_edid) originally from
8 * Copyright (C) 2006 Dennis Munsie <dmunsie@cecropia.com>
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sub license,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice (including the
18 * next paragraph) shall be included in all copies or substantial portions
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
29 #include <linux/kernel.h>
30 #include <linux/i2c.h>
31 #include <linux/i2c-algo-bit.h>
38 * - port quirks from X server code
42 * EDID blocks out in the wild have a variety of bugs, try to collect
43 * them here (note that userspace may work around broken monitors first,
44 * but fixes should make their way here so that the kernel "just works"
45 * on as many displays as possible).
48 /* First detailed mode wrong, use largest 60Hz mode */
49 #define EDID_QUIRK_PREFER_LARGE_60 (1 << 0)
50 /* Reported 135MHz pixel clock is too high, needs adjustment */
51 #define EDID_QUIRK_135_CLOCK_TOO_HIGH (1 << 1)
52 /* Prefer the largest mode at 75 Hz */
53 #define EDID_QUIRK_PREFER_LARGE_75 (1 << 2)
54 /* Detail timing is in cm not mm */
55 #define EDID_QUIRK_DETAILED_IN_CM (1 << 3)
56 /* Detailed timing descriptors have bogus size values, so just take the
57 * maximum size and use that.
59 #define EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE (1 << 4)
60 /* Monitor forgot to set the first detailed is preferred bit. */
61 #define EDID_QUIRK_FIRST_DETAILED_PREFERRED (1 << 5)
62 /* use +hsync +vsync for detailed mode */
63 #define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6)
65 static struct edid_quirk {
69 } edid_quirk_list[] = {
71 { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 },
73 { "API", 0x7602, EDID_QUIRK_PREFER_LARGE_60 },
75 { "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
77 /* Belinea 10 15 55 */
78 { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 },
79 { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
81 /* Envision Peripherals, Inc. EN-7100e */
82 { "EPI", 59264, EDID_QUIRK_135_CLOCK_TOO_HIGH },
84 /* Funai Electronics PM36B */
85 { "FCM", 13600, EDID_QUIRK_PREFER_LARGE_75 |
86 EDID_QUIRK_DETAILED_IN_CM },
88 /* LG Philips LCD LP154W01-A5 */
89 { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
90 { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
92 /* Philips 107p5 CRT */
93 { "PHL", 57364, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
96 { "PTS", 765, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
98 /* Samsung SyncMaster 205BW. Note: irony */
99 { "SAM", 541, EDID_QUIRK_DETAILED_SYNC_PP },
100 /* Samsung SyncMaster 22[5-6]BW */
101 { "SAM", 596, EDID_QUIRK_PREFER_LARGE_60 },
102 { "SAM", 638, EDID_QUIRK_PREFER_LARGE_60 },
106 /* Valid EDID header has these bytes */
107 static u8 edid_header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
110 * edid_is_valid - sanity check EDID data
113 * Sanity check the EDID block by looking at the header, the version number
114 * and the checksum. Return 0 if the EDID doesn't check out, or 1 if it's
117 static bool edid_is_valid(struct edid *edid)
121 u8 *raw_edid = (u8 *)edid;
123 if (memcmp(edid->header, edid_header, sizeof(edid_header)))
125 if (edid->version != 1) {
126 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
129 if (edid->revision <= 0 || edid->revision > 3) {
130 DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision);
134 for (i = 0; i < EDID_LENGTH; i++)
137 DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum);
145 DRM_ERROR("Raw EDID:\n");
146 print_hex_dump_bytes(KERN_ERR, DUMP_PREFIX_NONE, raw_edid, EDID_LENGTH);
153 * edid_vendor - match a string against EDID's obfuscated vendor field
154 * @edid: EDID to match
155 * @vendor: vendor string
157 * Returns true if @vendor is in @edid, false otherwise
159 static bool edid_vendor(struct edid *edid, char *vendor)
163 edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
164 edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
165 ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
166 edid_vendor[2] = (edid->mfg_id[2] & 0x1f) + '@';
168 return !strncmp(edid_vendor, vendor, 3);
172 * edid_get_quirks - return quirk flags for a given EDID
173 * @edid: EDID to process
175 * This tells subsequent routines what fixes they need to apply.
177 static u32 edid_get_quirks(struct edid *edid)
179 struct edid_quirk *quirk;
182 for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) {
183 quirk = &edid_quirk_list[i];
185 if (edid_vendor(edid, quirk->vendor) &&
186 (EDID_PRODUCT_ID(edid) == quirk->product_id))
187 return quirk->quirks;
193 #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
194 #define MODE_REFRESH_DIFF(m,r) (abs((m)->vrefresh - target_refresh))
198 * edid_fixup_preferred - set preferred modes based on quirk list
199 * @connector: has mode list to fix up
200 * @quirks: quirks list
202 * Walk the mode list for @connector, clearing the preferred status
203 * on existing modes and setting it anew for the right mode ala @quirks.
205 static void edid_fixup_preferred(struct drm_connector *connector,
208 struct drm_display_mode *t, *cur_mode, *preferred_mode;
211 if (list_empty(&connector->probed_modes))
214 if (quirks & EDID_QUIRK_PREFER_LARGE_60)
216 if (quirks & EDID_QUIRK_PREFER_LARGE_75)
219 preferred_mode = list_first_entry(&connector->probed_modes,
220 struct drm_display_mode, head);
222 list_for_each_entry_safe(cur_mode, t, &connector->probed_modes, head) {
223 cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED;
225 if (cur_mode == preferred_mode)
228 /* Largest mode is preferred */
229 if (MODE_SIZE(cur_mode) > MODE_SIZE(preferred_mode))
230 preferred_mode = cur_mode;
232 /* At a given size, try to get closest to target refresh */
233 if ((MODE_SIZE(cur_mode) == MODE_SIZE(preferred_mode)) &&
234 MODE_REFRESH_DIFF(cur_mode, target_refresh) <
235 MODE_REFRESH_DIFF(preferred_mode, target_refresh)) {
236 preferred_mode = cur_mode;
240 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED;
244 * drm_mode_std - convert standard mode info (width, height, refresh) into mode
245 * @t: standard timing params
247 * Take the standard timing params (in this case width, aspect, and refresh)
248 * and convert them into a real mode using CVT.
250 * Punts for now, but should eventually use the FB layer's CVT based mode
253 struct drm_display_mode *drm_mode_std(struct drm_device *dev,
254 struct std_timing *t)
256 // struct fb_videomode mode;
258 // fb_find_mode_cvt(&mode, 0, 0);
259 /* JJJ: convert to drm_display_mode */
260 struct drm_display_mode *mode;
261 int hsize = t->hsize * 8 + 248, vsize;
263 mode = drm_mode_create(dev);
267 if (t->aspect_ratio == 0)
268 vsize = (hsize * 10) / 16;
269 else if (t->aspect_ratio == 1)
270 vsize = (hsize * 3) / 4;
271 else if (t->aspect_ratio == 2)
272 vsize = (hsize * 4) / 5;
274 vsize = (hsize * 9) / 16;
276 drm_mode_set_name(mode);
282 * drm_mode_detailed - create a new mode from an EDID detailed timing section
283 * @dev: DRM device (needed to create new mode)
285 * @timing: EDID detailed timing info
286 * @quirks: quirks to apply
288 * An EDID detailed timing block contains enough info for us to create and
289 * return a new struct drm_display_mode.
291 static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
293 struct detailed_timing *timing,
296 struct drm_display_mode *mode;
297 struct detailed_pixel_timing *pt = &timing->data.pixel_data;
300 printk(KERN_WARNING "stereo mode not supported\n");
303 if (!pt->separate_sync) {
304 printk(KERN_WARNING "integrated sync not supported\n");
308 mode = drm_mode_create(dev);
312 mode->type = DRM_MODE_TYPE_DRIVER;
314 if (quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH)
315 timing->pixel_clock = 1088;
317 mode->clock = timing->pixel_clock * 10;
319 mode->hdisplay = (pt->hactive_hi << 8) | pt->hactive_lo;
320 mode->hsync_start = mode->hdisplay + ((pt->hsync_offset_hi << 8) |
321 pt->hsync_offset_lo);
322 mode->hsync_end = mode->hsync_start +
323 ((pt->hsync_pulse_width_hi << 8) |
324 pt->hsync_pulse_width_lo);
325 mode->htotal = mode->hdisplay + ((pt->hblank_hi << 8) | pt->hblank_lo);
327 mode->vdisplay = (pt->vactive_hi << 8) | pt->vactive_lo;
328 mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 8) |
329 pt->vsync_offset_lo);
330 mode->vsync_end = mode->vsync_start +
331 ((pt->vsync_pulse_width_hi << 8) |
332 pt->vsync_pulse_width_lo);
333 mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo);
335 drm_mode_set_name(mode);
338 mode->flags |= V_INTERLACE;
340 if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
341 pt->hsync_positive = 1;
342 pt->vsync_positive = 1;
345 mode->flags |= pt->hsync_positive ? V_PHSYNC : V_NHSYNC;
346 mode->flags |= pt->vsync_positive ? V_PVSYNC : V_NVSYNC;
348 mode->width_mm = pt->width_mm_lo | (pt->width_mm_hi << 8);
349 mode->height_mm = pt->height_mm_lo | (pt->height_mm_hi << 8);
351 if (quirks & EDID_QUIRK_DETAILED_IN_CM) {
352 mode->width_mm *= 10;
353 mode->height_mm *= 10;
356 if (quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE) {
357 mode->width_mm = edid->width_cm * 10;
358 mode->height_mm = edid->height_cm * 10;
365 * Detailed mode info for the EDID "established modes" data to use.
367 static struct drm_display_mode edid_est_modes[] = {
368 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840,
369 968, 1056, 0, 600, 601, 605, 628, 0,
370 V_PHSYNC | V_PVSYNC) }, /* 800x600@60Hz */
371 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 36000, 800, 824,
372 896, 1024, 0, 600, 601, 603, 625, 0,
373 V_PHSYNC | V_PVSYNC) }, /* 800x600@56Hz */
374 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 656,
375 720, 840, 0, 480, 481, 484, 500, 0,
376 V_NHSYNC | V_NVSYNC) }, /* 640x480@75Hz */
377 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664,
378 704, 832, 0, 480, 489, 491, 520, 0,
379 V_NHSYNC | V_NVSYNC) }, /* 640x480@72Hz */
380 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 30240, 640, 704,
381 768, 864, 0, 480, 483, 486, 525, 0,
382 V_NHSYNC | V_NVSYNC) }, /* 640x480@67Hz */
383 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25200, 640, 656,
384 752, 800, 0, 480, 490, 492, 525, 0,
385 V_NHSYNC | V_NVSYNC) }, /* 640x480@60Hz */
386 { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 738,
387 846, 900, 0, 400, 421, 423, 449, 0,
388 V_NHSYNC | V_NVSYNC) }, /* 720x400@88Hz */
389 { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 28320, 720, 738,
390 846, 900, 0, 400, 412, 414, 449, 0,
391 V_NHSYNC | V_PVSYNC) }, /* 720x400@70Hz */
392 { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296,
393 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
394 V_PHSYNC | V_PVSYNC) }, /* 1280x1024@75Hz */
395 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78800, 1024, 1040,
396 1136, 1312, 0, 768, 769, 772, 800, 0,
397 V_PHSYNC | V_PVSYNC) }, /* 1024x768@75Hz */
398 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048,
399 1184, 1328, 0, 768, 771, 777, 806, 0,
400 V_NHSYNC | V_NVSYNC) }, /* 1024x768@70Hz */
401 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
402 1184, 1344, 0, 768, 771, 777, 806, 0,
403 V_NHSYNC | V_NVSYNC) }, /* 1024x768@60Hz */
404 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER,44900, 1024, 1032,
405 1208, 1264, 0, 768, 768, 776, 817, 0,
406 V_PHSYNC | V_PVSYNC | V_INTERLACE) }, /* 1024x768@43Hz */
407 { DRM_MODE("832x624", DRM_MODE_TYPE_DRIVER, 57284, 832, 864,
408 928, 1152, 0, 624, 625, 628, 667, 0,
409 V_NHSYNC | V_NVSYNC) }, /* 832x624@75Hz */
410 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 49500, 800, 816,
411 896, 1056, 0, 600, 601, 604, 625, 0,
412 V_PHSYNC | V_PVSYNC) }, /* 800x600@75Hz */
413 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 50000, 800, 856,
414 976, 1040, 0, 600, 637, 643, 666, 0,
415 V_PHSYNC | V_PVSYNC) }, /* 800x600@72Hz */
416 { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
417 1344, 1600, 0, 864, 865, 868, 900, 0,
418 V_PHSYNC | V_PVSYNC) }, /* 1152x864@75Hz */
421 #define EDID_EST_TIMINGS 16
422 #define EDID_STD_TIMINGS 8
423 #define EDID_DETAILED_TIMINGS 4
426 * add_established_modes - get est. modes from EDID and add them
427 * @edid: EDID block to scan
429 * Each EDID block contains a bitmap of the supported "established modes" list
430 * (defined above). Tease them out and add them to the global modes list.
432 static int add_established_modes(struct drm_connector *connector, struct edid *edid)
434 struct drm_device *dev = connector->dev;
435 unsigned long est_bits = edid->established_timings.t1 |
436 (edid->established_timings.t2 << 8) |
437 ((edid->established_timings.mfg_rsvd & 0x80) << 9);
440 for (i = 0; i <= EDID_EST_TIMINGS; i++)
441 if (est_bits & (1<<i)) {
442 struct drm_display_mode *newmode;
443 newmode = drm_mode_duplicate(dev, &edid_est_modes[i]);
445 drm_mode_probed_add(connector, newmode);
454 * add_standard_modes - get std. modes from EDID and add them
455 * @edid: EDID block to scan
457 * Standard modes can be calculated using the CVT standard. Grab them from
458 * @edid, calculate them, and add them to the list.
460 static int add_standard_modes(struct drm_connector *connector, struct edid *edid)
462 struct drm_device *dev = connector->dev;
465 for (i = 0; i < EDID_STD_TIMINGS; i++) {
466 struct std_timing *t = &edid->standard_timings[i];
467 struct drm_display_mode *newmode;
469 /* If std timings bytes are 1, 1 it's empty */
470 if (t->hsize == 1 && (t->aspect_ratio | t->vfreq) == 1)
473 newmode = drm_mode_std(dev, &edid->standard_timings[i]);
475 drm_mode_probed_add(connector, newmode);
484 * add_detailed_modes - get detailed mode info from EDID data
485 * @connector: attached connector
486 * @edid: EDID block to scan
487 * @quirks: quirks to apply
489 * Some of the detailed timing sections may contain mode information. Grab
490 * it and add it to the list.
492 static int add_detailed_info(struct drm_connector *connector,
493 struct edid *edid, u32 quirks)
495 struct drm_device *dev = connector->dev;
498 for (i = 0; i < EDID_DETAILED_TIMINGS; i++) {
499 struct detailed_timing *timing = &edid->detailed_timings[i];
500 struct detailed_non_pixel *data = &timing->data.other_data;
501 struct drm_display_mode *newmode;
503 /* EDID up to and including 1.2 may put monitor info here */
504 if (edid->version == 1 && edid->revision < 3)
507 /* Detailed mode timing */
508 if (timing->pixel_clock) {
509 newmode = drm_mode_detailed(dev, edid, timing, quirks);
513 /* First detailed mode is preferred */
514 if (i == 0 && edid->preferred_timing)
515 newmode->type |= DRM_MODE_TYPE_PREFERRED;
516 drm_mode_probed_add(connector, newmode);
522 /* Other timing or info */
523 switch (data->type) {
524 case EDID_DETAIL_MONITOR_SERIAL:
526 case EDID_DETAIL_MONITOR_STRING:
528 case EDID_DETAIL_MONITOR_RANGE:
529 /* Get monitor range data */
531 case EDID_DETAIL_MONITOR_NAME:
533 case EDID_DETAIL_MONITOR_CPDATA:
535 case EDID_DETAIL_STD_MODES:
536 /* Five modes per detailed section */
537 for (j = 0; j < 5; i++) {
538 struct std_timing *std;
539 struct drm_display_mode *newmode;
541 std = &data->data.timings[j];
542 newmode = drm_mode_std(dev, std);
544 drm_mode_probed_add(connector, newmode);
557 #define DDC_ADDR 0x50
559 unsigned char *drm_do_probe_ddc_edid(struct i2c_adapter *adapter)
561 unsigned char start = 0x0;
562 unsigned char *buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
563 struct i2c_msg msgs[] = {
578 dev_warn(&adapter->dev, "unable to allocate memory for EDID "
583 if (i2c_transfer(adapter, msgs, 2) == 2)
586 dev_info(&adapter->dev, "unable to read EDID block.\n");
590 EXPORT_SYMBOL(drm_do_probe_ddc_edid);
592 static unsigned char *drm_ddc_read(struct i2c_adapter *adapter)
594 struct i2c_algo_bit_data *algo_data = adapter->algo_data;
595 unsigned char *edid = NULL;
600 * Set clock line high (but give it time to come up)
601 * Then set clock & data low
603 algo_data->setscl(algo_data->data, 1);
604 udelay(550); /* startup delay */
605 algo_data->setscl(algo_data->data, 0);
606 algo_data->setsda(algo_data->data, 0);
608 for (i = 0; i < 3; i++) {
609 /* For some old monitors we need the
610 * following process to initialize/stop DDC
612 algo_data->setsda(algo_data->data, 0);
615 algo_data->setscl(algo_data->data, 1);
616 for (j = 0; j < 5; j++) {
618 if (algo_data->getscl(algo_data->data))
624 algo_data->setsda(algo_data->data, 0);
626 algo_data->setscl(algo_data->data, 0);
628 algo_data->setsda(algo_data->data, 1);
631 /* Do the real work */
632 edid = drm_do_probe_ddc_edid(adapter);
633 algo_data->setsda(algo_data->data, 0);
634 algo_data->setscl(algo_data->data, 0);
637 algo_data->setscl(algo_data->data, 1);
638 for (j = 0; j < 10; j++) {
640 if (algo_data->getscl(algo_data->data))
644 algo_data->setsda(algo_data->data, 1);
646 algo_data->setscl(algo_data->data, 0);
650 /* Release the DDC lines when done or the Apple Cinema HD display
653 algo_data->setsda(algo_data->data, 1);
654 algo_data->setscl(algo_data->data, 1);
660 * drm_get_edid - get EDID data, if available
661 * @connector: connector we're probing
662 * @adapter: i2c adapter to use for DDC
664 * Poke the given connector's i2c channel to grab EDID data if possible.
666 * Return edid data or NULL if we couldn't find any.
668 struct edid *drm_get_edid(struct drm_connector *connector,
669 struct i2c_adapter *adapter)
673 edid = (struct edid *)drm_ddc_read(adapter);
675 dev_warn(&connector->dev->pdev->dev, "%s: no EDID data\n",
676 drm_get_connector_name(connector));
679 if (!edid_is_valid(edid)) {
680 dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n",
681 drm_get_connector_name(connector));
686 connector->display_info.raw_edid = (char *)edid;
690 EXPORT_SYMBOL(drm_get_edid);
693 * drm_add_edid_modes - add modes from EDID data, if available
694 * @connector: connector we're probing
697 * Add the specified modes to the connector's mode list.
699 * Return number of modes added or 0 if we couldn't find any.
701 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
709 if (!edid_is_valid(edid)) {
710 dev_warn(&connector->dev->pdev->dev, "%s: EDID invalid.\n",
711 drm_get_connector_name(connector));
715 quirks = edid_get_quirks(edid);
717 num_modes += add_established_modes(connector, edid);
718 num_modes += add_standard_modes(connector, edid);
719 num_modes += add_detailed_info(connector, edid, quirks);
721 if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
722 edid_fixup_preferred(connector, quirks);
724 connector->display_info.serration_vsync = edid->serration_vsync;
725 connector->display_info.sync_on_green = edid->sync_on_green;
726 connector->display_info.composite_sync = edid->composite_sync;
727 connector->display_info.separate_syncs = edid->separate_syncs;
728 connector->display_info.blank_to_black = edid->blank_to_black;
729 connector->display_info.video_level = edid->video_level;
730 connector->display_info.digital = edid->digital;
731 connector->display_info.width_mm = edid->width_cm * 10;
732 connector->display_info.height_mm = edid->height_cm * 10;
733 connector->display_info.gamma = edid->gamma;
734 connector->display_info.gtf_supported = edid->default_gtf;
735 connector->display_info.standard_color = edid->standard_color;
736 connector->display_info.display_type = edid->display_type;
737 connector->display_info.active_off_supported = edid->pm_active_off;
738 connector->display_info.suspend_supported = edid->pm_suspend;
739 connector->display_info.standby_supported = edid->pm_standby;
740 connector->display_info.gamma = edid->gamma;
744 EXPORT_SYMBOL(drm_add_edid_modes);