From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Junio C Hamano <junkio@cox.net>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: Re: [PATCH] GeForce 5200 on rivafb
Date: Tue, 14 Dec 2004 04:52:18 +0800 [thread overview]
Message-ID: <200412140452.19873.adaplas@hotpop.com> (raw)
In-Reply-To: <7vpt1fu97r.fsf@assigned-by-dhcp.cox.net>
On Sunday 12 December 2004 18:00, Junio C Hamano wrote:
> >>>>> "AAD" == Antonino A Daplas <adaplas@hotpop.com> writes:
>
> AAD> 1. Change this line in drivers/video/fbmon.c
>
> AAD> #undef DEBUG
> AAD> to
> AAD> #define DEBUG
>
> >>> Will do, but I have one question. The last time I tried
> >>> turning debugging on on rivafb-i2c it was very unpleasant;
>
> AAD> No :-), this is not for nvidiafb but for the EDID parser, and it will
> give AAD> you a very descriptive parsing of the EDID block.
>
> The attached is what I got in the kernel boot log. Again,
> AFAICT the display is an analog CRT but one of the decoded lines
> say "Digital Display Input". Anyway I'll disable the i2c stuff
> in the meantime as you recommended.
>
Can you try this patch and enable nvidiafb-i2c. It adds your monitor model
to the database of displays with broken edid's and attempts a fix. It checks
first if the monitor is GTF capable, and if it is, sets the input type from
digital to analog. (I don't think digital inputs can be GTF capable).
However, do you know if your monitor model does support digital input?
Tony
diff -Nru a/drivers/video/fbmon.c b/drivers/video/fbmon.c
--- a/drivers/video/fbmon.c 2004-11-21 22:32:56 +08:00
+++ b/drivers/video/fbmon.c 2004-12-14 04:38:30 +08:00
@@ -50,6 +50,7 @@
#endif
#define FBMON_FIX_HEADER 1
+#define FBMON_FIX_INPUT 2
#ifdef CONFIG_FB_MODE_HELPERS
struct broken_edid {
@@ -60,9 +61,16 @@
static struct broken_edid brokendb[] = {
/* DEC FR-PCXAV-YZ */
- { .manufacturer = "DEC",
- .model = 0x073a,
- .fix = FBMON_FIX_HEADER,
+ {
+ .manufacturer = "DEC",
+ .model = 0x073a,
+ .fix = FBMON_FIX_HEADER,
+ },
+ /* ViewSonic PF775a */
+ {
+ .manufacturer = "VSC",
+ .model = 0x5a44,
+ .fix = FBMON_FIX_INPUT,
},
};
@@ -80,9 +88,10 @@
while (i-- && (*--s == 0x20)) *s = 0;
}
-static void fix_broken_edid(unsigned char *edid)
+static void fix_edid(unsigned char *edid)
{
unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4];
+ unsigned char *b;
u32 model, i;
manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@';
@@ -95,15 +104,23 @@
for (i = 0; i < ARRAY_SIZE(brokendb); i++) {
if (!strncmp(manufacturer, brokendb[i].manufacturer, 4) &&
brokendb[i].model == model) {
+
+ printk("fbmon: The EDID Block of "
+ "Manufacturer: %s Model: 0x%x is known to "
+ "be broken,\n", manufacturer, model);
switch (brokendb[i].fix) {
case FBMON_FIX_HEADER:
- printk("fbmon: The EDID header of "
- "Manufacturer: %s Model: 0x%x is "
- "known to be broken,\n"
- "fbmon: trying a header "
- "reconstruct\n", manufacturer, model);
+ printk("fbmon: trying a header "
+ "reconstruct\n");
memcpy(edid, edid_v1_header, 8);
break;
+ case FBMON_FIX_INPUT:
+ printk("fbmon: trying to fix input type\n");
+ b = edid + EDID_STRUCT_DISPLAY;
+ /* Only if display is GTF capable will
+ the input type be reset to analog */
+ if (b[4] & 0x01)
+ b[0] &= ~0x80;
}
}
}
@@ -112,6 +129,9 @@
static int edid_checksum(unsigned char *edid)
{
unsigned char i, csum = 0, all_null = 0;
+ int err = 0;
+
+ fix_edid(edid);
for (i = 0; i < EDID_LENGTH; i++) {
csum += edid[i];
@@ -120,38 +140,23 @@
if (csum == 0x00 && all_null) {
/* checksum passed, everything's good */
- return 1;
+ err = 1;
}
- fix_broken_edid(edid);
- csum = all_null = 0;
- for (i = 0; i < EDID_LENGTH; i++) {
- csum += edid[i];
- all_null |= edid[i];
- }
- if (csum != 0x00 || !all_null) {
- printk("EDID checksum failed, aborting\n");
- return 0;
- }
- return 1;
+ return err;
}
static int edid_check_header(unsigned char *edid)
{
- int i, fix = 0;
+ int i, err = 1;
- for (i = 0; i < 8; i++) {
- if (edid[i] != edid_v1_header[i])
- fix = 1;
- }
- if (!fix)
- return 1;
+ fix_edid(edid);
- fix_broken_edid(edid);
for (i = 0; i < 8; i++) {
if (edid[i] != edid_v1_header[i])
- return 0;
+ err = 0;
}
+
return 1;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
next prev parent reply other threads:[~2004-12-13 20:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-11 21:11 [PATCH] GeForce 5200 on rivafb Antonino A. Daplas
2004-12-12 2:25 ` Junio C Hamano
2004-12-12 10:00 ` Junio C Hamano
2004-12-13 20:52 ` Antonino A. Daplas [this message]
2004-12-13 21:47 ` Antonino A. Daplas
2004-12-14 7:51 ` Junio C Hamano
2004-12-15 20:02 ` Antonino A. Daplas
2004-12-15 21:22 ` Junio C Hamano
2004-12-14 1:57 ` Junio C Hamano
2004-12-14 12:02 ` Antonino A. Daplas
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=200412140452.19873.adaplas@hotpop.com \
--to=adaplas@hotpop.com \
--cc=junkio@cox.net \
--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).