edidvar.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* $NetBSD: edidvar.h,v 1.2 2006/05/11 19:05:41 gdamore Exp $ */
  2. /*-
  3. * Copyright (c) 2006 Itronix Inc.
  4. * All rights reserved.
  5. *
  6. * Written by Garrett D'Amore for Itronix Inc.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. The name of Itronix Inc. may not be used to endorse
  17. * or promote products derived from this software without specific
  18. * prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND ANY EXPRESS
  21. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. * ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
  24. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  26. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  29. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  30. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #ifndef _DEV_VIDEOMODE_EDIDVAR_H
  33. #define _DEV_VIDEOMODE_EDIDVAR_H
  34. struct edid_chroma {
  35. uint16_t ec_redx;
  36. uint16_t ec_redy;
  37. uint16_t ec_greenx;
  38. uint16_t ec_greeny;
  39. uint16_t ec_bluex;
  40. uint16_t ec_bluey;
  41. uint16_t ec_whitex;
  42. uint16_t ec_whitey;
  43. };
  44. struct edid_range {
  45. uint16_t er_min_vfreq; /* Hz */
  46. uint16_t er_max_vfreq; /* Hz */
  47. uint16_t er_min_hfreq; /* kHz */
  48. uint16_t er_max_hfreq; /* kHz */
  49. uint16_t er_max_clock; /* MHz */
  50. int er_have_gtf2;
  51. uint16_t er_gtf2_hfreq;
  52. uint16_t er_gtf2_c;
  53. uint16_t er_gtf2_m;
  54. uint16_t er_gtf2_k;
  55. uint16_t er_gtf2_j;
  56. };
  57. struct edid_info {
  58. uint8_t edid_vendor[4];
  59. char edid_vendorname[16];
  60. char edid_productname[16];
  61. char edid_comment[16];
  62. char edid_serial[16];
  63. uint16_t edid_product;
  64. uint8_t edid_version;
  65. uint8_t edid_revision;
  66. int edid_year;
  67. int edid_week;
  68. uint8_t edid_video_input; /* see edidregs.h */
  69. uint8_t edid_max_hsize; /* in cm */
  70. uint8_t edid_max_vsize; /* in cm */
  71. uint8_t edid_gamma;
  72. uint8_t edid_features;
  73. int edid_have_range;
  74. struct edid_range edid_range;
  75. struct edid_chroma edid_chroma;
  76. /* parsed modes */
  77. struct videomode *edid_preferred_mode;
  78. int edid_nmodes;
  79. struct videomode edid_modes[64];
  80. };
  81. int edid_is_valid(uint8_t *);
  82. int edid_parse(uint8_t *, struct edid_info *);
  83. void edid_print(struct edid_info *);
  84. #endif /* _DEV_VIDEOMODE_EDIDVAR_H */