Advertisement
Guest User

patch-for-dvi-monitor.patch

a guest
Jun 17th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. From b0e1f97853047c10d4ede61c17c676fc8049743a Mon Sep 17 00:00:00 2001
  2. From: mikhailk-2012 <info@sky-control.ru>
  3. Date: Fri, 6 Jun 2014 11:54:12 +0400
  4. Subject: [PATCH 1/1] This fixes problems with DVI monitors connected to the
  5. HDMI port via a DVI <-> HDMI cable. With DVI monitors,
  6. the list of CEA modes is always zero, preventing high
  7. resolution modes to be used. This patch disables the
  8. CEA mode check if CEA extension is empty.
  9.  
  10. ---
  11. drivers/video/fbmon.c | 4 ++--
  12. drivers/video/mxc/mxc_edid.c | 14 +++++++++++---
  13. drivers/video/mxc/mxc_hdmi.c | 13 +++++++++++--
  14. 3 files changed, 24 insertions(+), 7 deletions(-)
  15.  
  16. diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
  17. index 6103fa6..82245ab 100644
  18. --- a/drivers/video/fbmon.c
  19. +++ b/drivers/video/fbmon.c
  20. @@ -44,9 +44,9 @@
  21. */
  22.  
  23. #undef DEBUG /* define this for verbose EDID parsing output */
  24. -
  25. +#define DEBUG
  26. #ifdef DEBUG
  27. -#define DPRINTK(fmt, args...) printk(fmt,## args)
  28. +#define DPRINTK(fmt, args...) printk(KERN_INFO fmt,## args)
  29. #else
  30. #define DPRINTK(fmt, args...)
  31. #endif
  32. diff --git a/drivers/video/mxc/mxc_edid.c b/drivers/video/mxc/mxc_edid.c
  33. index 88b5268..17ac319 100644
  34. --- a/drivers/video/mxc/mxc_edid.c
  35. +++ b/drivers/video/mxc/mxc_edid.c
  36. @@ -32,8 +32,9 @@
  37. #include "../edid.h"
  38.  
  39. #undef DEBUG /* define this for verbose EDID parsing output */
  40. +#define DEBUG
  41. #ifdef DEBUG
  42. -#define DPRINTK(fmt, args...) printk(fmt, ## args)
  43. +#define DPRINTK(fmt, args...) printk(KERN_INFO fmt, ## args)
  44. #else
  45. #define DPRINTK(fmt, args...)
  46. #endif
  47. @@ -720,11 +721,15 @@ int mxc_edid_mode_to_vic(const struct fb_videomode *mode)
  48. }
  49. EXPORT_SYMBOL(mxc_edid_mode_to_vic);
  50.  
  51. -/* make sure edid has 512 bytes*/
  52. +/* make sure edid has 512 bytes
  53. + * return: < 0 - error
  54. + * = 0 - edid only
  55. + * = 1 - edid + cea extension */
  56. int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
  57. unsigned char *edid, struct mxc_edid_cfg *cfg, struct fb_info *fbi)
  58. {
  59. int ret = 0, extblknum;
  60. + __u32 modedb_len_temp;
  61. if (!adp || !edid || !cfg || !fbi)
  62. return -EINVAL;
  63.  
  64. @@ -738,7 +743,7 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
  65. /* edid first block parsing */
  66. memset(&fbi->monspecs, 0, sizeof(fbi->monspecs));
  67. fb_edid_to_monspecs(edid, &fbi->monspecs);
  68. -
  69. + modedb_len_temp = fbi->monspecs.modedb_len;
  70. if (extblknum) {
  71. int i;
  72.  
  73. @@ -756,7 +761,10 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
  74. cfg, &fbi->monspecs);
  75. }
  76.  
  77. + if (modedb_len_temp != fbi->monspecs.modedb_len)
  78. + return 1;
  79. return 0;
  80. +
  81. }
  82. EXPORT_SYMBOL(mxc_edid_read);
  83.  
  84. diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c
  85. index e510025..513a81a 100644
  86. --- a/drivers/video/mxc/mxc_hdmi.c
  87. +++ b/drivers/video/mxc/mxc_hdmi.c
  88. @@ -163,6 +163,7 @@ struct mxc_hdmi {
  89. int vic;
  90. struct mxc_edid_cfg edid_cfg;
  91. u8 edid[HDMI_EDID_LEN];
  92. + int edid_cea_parsed;
  93. bool fb_reg;
  94. bool cable_plugin;
  95. u8 blank;
  96. @@ -1611,9 +1612,15 @@ static int mxc_hdmi_read_edid(struct mxc_hdmi *hdmi)
  97. memcpy(edid_old, hdmi->edid, HDMI_EDID_LEN);
  98.  
  99. /* Read EDID via HDMI DDC when HDCP Enable */
  100. - if (!hdcp_init)
  101. + if (!hdcp_init) {
  102. ret = mxc_edid_read(hdmi_i2c->adapter, hdmi_i2c->addr,
  103. hdmi->edid, &hdmi->edid_cfg, hdmi->fbi);
  104. + hdmi->edid_cea_parsed = false;
  105. + if (ret > 0) {
  106. + hdmi->edid_cea_parsed = true;
  107. + ret=0;
  108. + }
  109. + }
  110. else {
  111.  
  112. /* Disable HDCP clk */
  113. @@ -1800,7 +1807,7 @@ static void mxc_hdmi_edid_rebuild_modelist(struct mxc_hdmi *hdmi)
  114. mode = &hdmi->fbi->monspecs.modedb[i];
  115.  
  116. if (!(mode->vmode & FB_VMODE_INTERLACED) &&
  117. - (mxc_edid_mode_to_vic(mode) != 0)) {
  118. + (!hdmi->edid_cea_parsed || mxc_edid_mode_to_vic(mode) != 0)) {
  119.  
  120. dev_dbg(&hdmi->pdev->dev, "Added mode %d:", i);
  121. dev_dbg(&hdmi->pdev->dev,
  122. @@ -2539,6 +2546,8 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
  123. hdmi->dft_mode_str, NULL, 0, NULL,
  124. hdmi->default_bpp);
  125.  
  126. + hdmi->edid_cea_parsed = false;
  127. +
  128. console_lock();
  129.  
  130. fb_destroy_modelist(&hdmi->fbi->modelist);
  131. --
  132. 1.7.9.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement