Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From b0e1f97853047c10d4ede61c17c676fc8049743a Mon Sep 17 00:00:00 2001
- From: mikhailk-2012 <info@sky-control.ru>
- Date: Fri, 6 Jun 2014 11:54:12 +0400
- Subject: [PATCH 1/1] This fixes problems with DVI monitors connected to the
- HDMI port via a DVI <-> HDMI cable. With DVI monitors,
- the list of CEA modes is always zero, preventing high
- resolution modes to be used. This patch disables the
- CEA mode check if CEA extension is empty.
- ---
- drivers/video/fbmon.c | 4 ++--
- drivers/video/mxc/mxc_edid.c | 14 +++++++++++---
- drivers/video/mxc/mxc_hdmi.c | 13 +++++++++++--
- 3 files changed, 24 insertions(+), 7 deletions(-)
- diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
- index 6103fa6..82245ab 100644
- --- a/drivers/video/fbmon.c
- +++ b/drivers/video/fbmon.c
- @@ -44,9 +44,9 @@
- */
- #undef DEBUG /* define this for verbose EDID parsing output */
- -
- +#define DEBUG
- #ifdef DEBUG
- -#define DPRINTK(fmt, args...) printk(fmt,## args)
- +#define DPRINTK(fmt, args...) printk(KERN_INFO fmt,## args)
- #else
- #define DPRINTK(fmt, args...)
- #endif
- diff --git a/drivers/video/mxc/mxc_edid.c b/drivers/video/mxc/mxc_edid.c
- index 88b5268..17ac319 100644
- --- a/drivers/video/mxc/mxc_edid.c
- +++ b/drivers/video/mxc/mxc_edid.c
- @@ -32,8 +32,9 @@
- #include "../edid.h"
- #undef DEBUG /* define this for verbose EDID parsing output */
- +#define DEBUG
- #ifdef DEBUG
- -#define DPRINTK(fmt, args...) printk(fmt, ## args)
- +#define DPRINTK(fmt, args...) printk(KERN_INFO fmt, ## args)
- #else
- #define DPRINTK(fmt, args...)
- #endif
- @@ -720,11 +721,15 @@ int mxc_edid_mode_to_vic(const struct fb_videomode *mode)
- }
- EXPORT_SYMBOL(mxc_edid_mode_to_vic);
- -/* make sure edid has 512 bytes*/
- +/* make sure edid has 512 bytes
- + * return: < 0 - error
- + * = 0 - edid only
- + * = 1 - edid + cea extension */
- int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
- unsigned char *edid, struct mxc_edid_cfg *cfg, struct fb_info *fbi)
- {
- int ret = 0, extblknum;
- + __u32 modedb_len_temp;
- if (!adp || !edid || !cfg || !fbi)
- return -EINVAL;
- @@ -738,7 +743,7 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
- /* edid first block parsing */
- memset(&fbi->monspecs, 0, sizeof(fbi->monspecs));
- fb_edid_to_monspecs(edid, &fbi->monspecs);
- -
- + modedb_len_temp = fbi->monspecs.modedb_len;
- if (extblknum) {
- int i;
- @@ -756,7 +761,10 @@ int mxc_edid_read(struct i2c_adapter *adp, unsigned short addr,
- cfg, &fbi->monspecs);
- }
- + if (modedb_len_temp != fbi->monspecs.modedb_len)
- + return 1;
- return 0;
- +
- }
- EXPORT_SYMBOL(mxc_edid_read);
- diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c
- index e510025..513a81a 100644
- --- a/drivers/video/mxc/mxc_hdmi.c
- +++ b/drivers/video/mxc/mxc_hdmi.c
- @@ -163,6 +163,7 @@ struct mxc_hdmi {
- int vic;
- struct mxc_edid_cfg edid_cfg;
- u8 edid[HDMI_EDID_LEN];
- + int edid_cea_parsed;
- bool fb_reg;
- bool cable_plugin;
- u8 blank;
- @@ -1611,9 +1612,15 @@ static int mxc_hdmi_read_edid(struct mxc_hdmi *hdmi)
- memcpy(edid_old, hdmi->edid, HDMI_EDID_LEN);
- /* Read EDID via HDMI DDC when HDCP Enable */
- - if (!hdcp_init)
- + if (!hdcp_init) {
- ret = mxc_edid_read(hdmi_i2c->adapter, hdmi_i2c->addr,
- hdmi->edid, &hdmi->edid_cfg, hdmi->fbi);
- + hdmi->edid_cea_parsed = false;
- + if (ret > 0) {
- + hdmi->edid_cea_parsed = true;
- + ret=0;
- + }
- + }
- else {
- /* Disable HDCP clk */
- @@ -1800,7 +1807,7 @@ static void mxc_hdmi_edid_rebuild_modelist(struct mxc_hdmi *hdmi)
- mode = &hdmi->fbi->monspecs.modedb[i];
- if (!(mode->vmode & FB_VMODE_INTERLACED) &&
- - (mxc_edid_mode_to_vic(mode) != 0)) {
- + (!hdmi->edid_cea_parsed || mxc_edid_mode_to_vic(mode) != 0)) {
- dev_dbg(&hdmi->pdev->dev, "Added mode %d:", i);
- dev_dbg(&hdmi->pdev->dev,
- @@ -2539,6 +2546,8 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp,
- hdmi->dft_mode_str, NULL, 0, NULL,
- hdmi->default_bpp);
- + hdmi->edid_cea_parsed = false;
- +
- console_lock();
- fb_destroy_modelist(&hdmi->fbi->modelist);
- --
- 1.7.9.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement