Commit 094bb659 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] nvidiafb: Fallback to firmware EDID

If nvidiafb fails to probe the EDID block, get the EDID from the BIOS.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 13776711
...@@ -194,8 +194,9 @@ static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan) ...@@ -194,8 +194,9 @@ static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan)
return NULL; return NULL;
} }
int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid) int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
{ {
struct nvidia_par *par = info->par;
u8 *edid = NULL; u8 *edid = NULL;
int i; int i;
...@@ -205,10 +206,17 @@ int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid) ...@@ -205,10 +206,17 @@ int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid)
if (edid) if (edid)
break; break;
} }
if (!edid && conn == 1) {
/* try to get from firmware */
edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
if (edid)
memcpy(edid, fb_firmware_edid(info->device),
EDID_LENGTH);
}
if (out_edid) if (out_edid)
*out_edid = edid; *out_edid = edid;
if (!edid)
return 1;
return 0; return (edid) ? 0 : 1;
} }
...@@ -34,7 +34,7 @@ void NVLockUnlock(struct nvidia_par *par, int); ...@@ -34,7 +34,7 @@ void NVLockUnlock(struct nvidia_par *par, int);
#if defined(CONFIG_FB_NVIDIA_I2C) || defined (CONFIG_PPC_OF) #if defined(CONFIG_FB_NVIDIA_I2C) || defined (CONFIG_PPC_OF)
void nvidia_create_i2c_busses(struct nvidia_par *par); void nvidia_create_i2c_busses(struct nvidia_par *par);
void nvidia_delete_i2c_busses(struct nvidia_par *par); void nvidia_delete_i2c_busses(struct nvidia_par *par);
int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, int nvidia_probe_i2c_connector(struct fb_info *info, int conn,
u8 ** out_edid); u8 ** out_edid);
#else #else
#define nvidia_create_i2c_busses(...) #define nvidia_create_i2c_busses(...)
......
...@@ -401,7 +401,7 @@ void NVCommonSetup(struct fb_info *info) ...@@ -401,7 +401,7 @@ void NVCommonSetup(struct fb_info *info)
nvidia_create_i2c_busses(par); nvidia_create_i2c_busses(par);
if (!par->twoHeads) { if (!par->twoHeads) {
par->CRTCnumber = 0; par->CRTCnumber = 0;
nvidia_probe_i2c_connector(par, 1, &edidA); nvidia_probe_i2c_connector(info, 1, &edidA);
if (edidA && !fb_parse_edid(edidA, &var)) { if (edidA && !fb_parse_edid(edidA, &var)) {
printk("nvidiafb: EDID found from BUS1\n"); printk("nvidiafb: EDID found from BUS1\n");
monA = &monitorA; monA = &monitorA;
...@@ -488,14 +488,14 @@ void NVCommonSetup(struct fb_info *info) ...@@ -488,14 +488,14 @@ void NVCommonSetup(struct fb_info *info)
oldhead = NV_RD32(par->PCRTC0, 0x00000860); oldhead = NV_RD32(par->PCRTC0, 0x00000860);
NV_WR32(par->PCRTC0, 0x00000860, oldhead | 0x00000010); NV_WR32(par->PCRTC0, 0x00000860, oldhead | 0x00000010);
nvidia_probe_i2c_connector(par, 1, &edidA); nvidia_probe_i2c_connector(info, 1, &edidA);
if (edidA && !fb_parse_edid(edidA, &var)) { if (edidA && !fb_parse_edid(edidA, &var)) {
printk("nvidiafb: EDID found from BUS1\n"); printk("nvidiafb: EDID found from BUS1\n");
monA = &monitorA; monA = &monitorA;
fb_edid_to_monspecs(edidA, monA); fb_edid_to_monspecs(edidA, monA);
} }
nvidia_probe_i2c_connector(par, 2, &edidB); nvidia_probe_i2c_connector(info, 2, &edidB);
if (edidB && !fb_parse_edid(edidB, &var)) { if (edidB && !fb_parse_edid(edidB, &var)) {
printk("nvidiafb: EDID found from BUS2\n"); printk("nvidiafb: EDID found from BUS2\n");
monB = &monitorB; monB = &monitorB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment