linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: Robert Siemer <Robert.Siemer@backsla.sh>
Subject: Re: radeonfb: DDC read wrong?
Date: Sun, 25 Jun 2006 08:00:30 +0800	[thread overview]
Message-ID: <449DD21E.9070906@gmail.com> (raw)
In-Reply-To: <20060624174731.GA6091@polar.elf12.net>

Robert Siemer wrote:
> On Sat, Jun 24, 2006 at 08:11:46PM +0800, Antonino A. Daplas wrote:
>> Robert Siemer wrote:

Disregard the previous patch, I forgot to adjust the checksum.
Try this instead...

Tony

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index fb9ed4c..42865b6 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -49,8 +49,9 @@ #else
 #define DPRINTK(fmt, args...)
 #endif
 
-#define FBMON_FIX_HEADER 1
-#define FBMON_FIX_INPUT  2
+#define FBMON_FIX_HEADER   1
+#define FBMON_FIX_INPUT    2
+#define FBMON_FIX_DETAILED 3
 
 #ifdef CONFIG_FB_MODE_HELPERS
 struct broken_edid {
@@ -72,6 +73,12 @@ static struct broken_edid brokendb[] = {
 		.model        = 0x5a44,
 		.fix          = FBMON_FIX_INPUT,
 	},
+	/* Eizo (202) */
+	{
+		.manufacturer = "EIZ",
+		.model        = 0x0202,
+		.fix          = FBMON_FIX_DETAILED,
+	},
 };
 
 static const unsigned char edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff,
@@ -127,6 +134,18 @@ static int check_edid(unsigned char *edi
 		if (b[4] & 0x01 && b[0] & 0x80)
 			ret = fix;
 		break;
+	case FBMON_FIX_DETAILED:
+		b = edid + DETAILED_TIMING_DESCRIPTIONS_START;
+
+		for (i = 0; i < 4; i++, b+=DETAILED_TIMING_DESCRIPTION_SIZE) {
+			if (!(b[0] == 0 && b[1] == 0 &&
+			      b[2] == 0 && b[4] == 0)) {
+				ret = fix;
+				break;
+			}
+		}
+
+		break;
 	}
 
 	return ret;
@@ -134,7 +153,8 @@ static int check_edid(unsigned char *edi
 
 static void fix_edid(unsigned char *edid, int fix)
 {
-	unsigned char *b;
+	unsigned char *b, csum = 0;
+	int i;
 
 	switch (fix) {
 	case FBMON_FIX_HEADER:
@@ -146,8 +166,29 @@ static void fix_edid(unsigned char *edid
 		b = edid + EDID_STRUCT_DISPLAY;
 		b[0] &= ~0x80;
 		edid[127] += 0x80;
+		break;
+	case FBMON_FIX_DETAILED:
+		printk("fbmon: trying to fix detailed description blocks\n");
+		b = edid + DETAILED_TIMING_DESCRIPTIONS_START;
+
+		/* Use 0xf0 which is currently unused for tagging */
+		for (i = 0; i < 4; i++, b+=DETAILED_TIMING_DESCRIPTION_SIZE) {
+			if (!(b[0] == 0 && b[1] == 0 &&
+			      b[2] == 0 && b[4] == 0)) {
+				b[3] = 0xf0;
+				b[0] = 	b[1] = b[2] = b[4] = 0;
+			}
+		}
+
+		for (i = 0; i < EDID_LENGTH - 1; i++)
+			csum += edid[i];
+
+		csum = 256 - csum;
+		edid[EDID_LENGTH - 1] = csum;
+
 	}
-}
+}
+
 
 static int edid_checksum(unsigned char *edid)
 {

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  parent reply	other threads:[~2006-06-25  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 14:01 radeonfb: DDC read wrong? Robert Siemer
2006-06-24 12:11 ` Antonino A. Daplas
2006-06-24 17:47   ` Robert Siemer
2006-06-24 21:33     ` Antonino A. Daplas
2006-06-24 21:56       ` Robert Siemer
2006-06-24 23:27     ` Antonino A. Daplas
2006-06-25  0:00     ` Antonino A. Daplas [this message]
2006-06-26 17:01       ` Robert Siemer
2006-06-26 20:55         ` Antonino A. Daplas
2006-06-27 19:11           ` Luca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449DD21E.9070906@gmail.com \
    --to=adaplas@gmail.com \
    --cc=Robert.Siemer@backsla.sh \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).