| @@ -443,34 +443,45 @@ EXPORT_SYMBOL(drm_get_edid); | | | @@ -443,34 +443,45 @@ EXPORT_SYMBOL(drm_get_edid); |
443 | #endif /* !defined(__NetBSD__) */ | | 443 | #endif /* !defined(__NetBSD__) */ |
444 | | | 444 | |
445 | /*** EDID parsing ***/ | | 445 | /*** EDID parsing ***/ |
446 | | | 446 | |
447 | /** | | 447 | /** |
448 | * edid_vendor - match a string against EDID's obfuscated vendor field | | 448 | * edid_vendor - match a string against EDID's obfuscated vendor field |
449 | * @edid: EDID to match | | 449 | * @edid: EDID to match |
450 | * @vendor: vendor string | | 450 | * @vendor: vendor string |
451 | * | | 451 | * |
452 | * Returns true if @vendor is in @edid, false otherwise | | 452 | * Returns true if @vendor is in @edid, false otherwise |
453 | */ | | 453 | */ |
454 | static bool edid_vendor(struct edid *edid, char *vendor) | | 454 | static bool edid_vendor(struct edid *edid, char *vendor) |
455 | { | | 455 | { |
| | | 456 | #ifdef __NetBSD__ /* XXX Avoid shadowing global definition. */ |
| | | 457 | char edidv[3]; |
| | | 458 | |
| | | 459 | edidv[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; |
| | | 460 | edidv[1] = (((edid->mfg_id[0] & 0x3) << 3) | |
| | | 461 | ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; |
| | | 462 | edidv[2] = (edid->mfg_id[1] & 0x1f) + '@'; |
| | | 463 | |
| | | 464 | return !strncmp(edidv, vendor, 3); |
| | | 465 | #else |
456 | char edid_vendor[3]; | | 466 | char edid_vendor[3]; |
457 | | | 467 | |
458 | edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; | | 468 | edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; |
459 | edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) | | | 469 | edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) | |
460 | ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; | | 470 | ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; |
461 | edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; | | 471 | edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; |
462 | | | 472 | |
463 | return !strncmp(edid_vendor, vendor, 3); | | 473 | return !strncmp(edid_vendor, vendor, 3); |
| | | 474 | #endif |
464 | } | | 475 | } |
465 | | | 476 | |
466 | /** | | 477 | /** |
467 | * edid_get_quirks - return quirk flags for a given EDID | | 478 | * edid_get_quirks - return quirk flags for a given EDID |
468 | * @edid: EDID to process | | 479 | * @edid: EDID to process |
469 | * | | 480 | * |
470 | * This tells subsequent routines what fixes they need to apply. | | 481 | * This tells subsequent routines what fixes they need to apply. |
471 | */ | | 482 | */ |
472 | static u32 edid_get_quirks(struct edid *edid) | | 483 | static u32 edid_get_quirks(struct edid *edid) |
473 | { | | 484 | { |
474 | struct edid_quirk *quirk; | | 485 | struct edid_quirk *quirk; |
475 | int i; | | 486 | int i; |
476 | | | 487 | |