aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-09-09 16:04:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:59 -0400
commit094bb659f53b6d90aab6067268d6d14f1f352d30 (patch)
tree37f2e11d4c0345bb7b84ec99f50ff77bd2f395a3 /drivers
parent13776711ce4b234b5ad153e55e8b5d6703c6b1ef (diff)
[PATCH] nvidiafb: Fallback to firmware EDID
If nvidiafb fails to probe the EDID block, get the EDID from the BIOS. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/nvidia/nv_i2c.c16
-rw-r--r--drivers/video/nvidia/nv_proto.h2
-rw-r--r--drivers/video/nvidia/nv_setup.c6
3 files changed, 16 insertions, 8 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index 1a91bffdda26..ace484fa61ce 100644
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -194,8 +194,9 @@ static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan)
194 return NULL; 194 return NULL;
195} 195}
196 196
197int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid) 197int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
198{ 198{
199 struct nvidia_par *par = info->par;
199 u8 *edid = NULL; 200 u8 *edid = NULL;
200 int i; 201 int i;
201 202
@@ -205,10 +206,17 @@ int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid)
205 if (edid) 206 if (edid)
206 break; 207 break;
207 } 208 }
209
210 if (!edid && conn == 1) {
211 /* try to get from firmware */
212 edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
213 if (edid)
214 memcpy(edid, fb_firmware_edid(info->device),
215 EDID_LENGTH);
216 }
217
208 if (out_edid) 218 if (out_edid)
209 *out_edid = edid; 219 *out_edid = edid;
210 if (!edid)
211 return 1;
212 220
213 return 0; 221 return (edid) ? 0 : 1;
214} 222}
diff --git a/drivers/video/nvidia/nv_proto.h b/drivers/video/nvidia/nv_proto.h
index 42847ce1b8dd..cac44fc7f587 100644
--- a/drivers/video/nvidia/nv_proto.h
+++ b/drivers/video/nvidia/nv_proto.h
@@ -34,7 +34,7 @@ void NVLockUnlock(struct nvidia_par *par, int);
34#if defined(CONFIG_FB_NVIDIA_I2C) || defined (CONFIG_PPC_OF) 34#if defined(CONFIG_FB_NVIDIA_I2C) || defined (CONFIG_PPC_OF)
35void nvidia_create_i2c_busses(struct nvidia_par *par); 35void nvidia_create_i2c_busses(struct nvidia_par *par);
36void nvidia_delete_i2c_busses(struct nvidia_par *par); 36void nvidia_delete_i2c_busses(struct nvidia_par *par);
37int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, 37int nvidia_probe_i2c_connector(struct fb_info *info, int conn,
38 u8 ** out_edid); 38 u8 ** out_edid);
39#else 39#else
40#define nvidia_create_i2c_busses(...) 40#define nvidia_create_i2c_busses(...)
diff --git a/drivers/video/nvidia/nv_setup.c b/drivers/video/nvidia/nv_setup.c
index 0bbdca2e0f91..11c84178f420 100644
--- a/drivers/video/nvidia/nv_setup.c
+++ b/drivers/video/nvidia/nv_setup.c
@@ -401,7 +401,7 @@ void NVCommonSetup(struct fb_info *info)
401 nvidia_create_i2c_busses(par); 401 nvidia_create_i2c_busses(par);
402 if (!par->twoHeads) { 402 if (!par->twoHeads) {
403 par->CRTCnumber = 0; 403 par->CRTCnumber = 0;
404 nvidia_probe_i2c_connector(par, 1, &edidA); 404 nvidia_probe_i2c_connector(info, 1, &edidA);
405 if (edidA && !fb_parse_edid(edidA, &var)) { 405 if (edidA && !fb_parse_edid(edidA, &var)) {
406 printk("nvidiafb: EDID found from BUS1\n"); 406 printk("nvidiafb: EDID found from BUS1\n");
407 monA = &monitorA; 407 monA = &monitorA;
@@ -488,14 +488,14 @@ void NVCommonSetup(struct fb_info *info)
488 oldhead = NV_RD32(par->PCRTC0, 0x00000860); 488 oldhead = NV_RD32(par->PCRTC0, 0x00000860);
489 NV_WR32(par->PCRTC0, 0x00000860, oldhead | 0x00000010); 489 NV_WR32(par->PCRTC0, 0x00000860, oldhead | 0x00000010);
490 490
491 nvidia_probe_i2c_connector(par, 1, &edidA); 491 nvidia_probe_i2c_connector(info, 1, &edidA);
492 if (edidA && !fb_parse_edid(edidA, &var)) { 492 if (edidA && !fb_parse_edid(edidA, &var)) {
493 printk("nvidiafb: EDID found from BUS1\n"); 493 printk("nvidiafb: EDID found from BUS1\n");
494 monA = &monitorA; 494 monA = &monitorA;
495 fb_edid_to_monspecs(edidA, monA); 495 fb_edid_to_monspecs(edidA, monA);
496 } 496 }
497 497
498 nvidia_probe_i2c_connector(par, 2, &edidB); 498 nvidia_probe_i2c_connector(info, 2, &edidB);
499 if (edidB && !fb_parse_edid(edidB, &var)) { 499 if (edidB && !fb_parse_edid(edidB, &var)) {
500 printk("nvidiafb: EDID found from BUS2\n"); 500 printk("nvidiafb: EDID found from BUS2\n");
501 monB = &monitorB; 501 monB = &monitorB;