nvidiafb: Fix mode setting & PPC support
PATCH 1/1 nvidiafb: Fix mode setting & PPC support
This patch fixes nvifiafb mode setting code to be closer to what the X driver does, which actually makes it work on the 5200FX I have access to. It also fix the routine that gets the EDID from Open Firmware on PPC, it was broken in various ways and would crash at boot. Compared to the patch I posted to linux-fbdev last week, this one just changes a printk to be closer to the other ones in the driver.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
drivers/video/Kconfig +1 -1
@@ -662,7 +662,7 @@ config FB_NVIDIA_I2C bool "Enable DDC Support" - depends on FB_NVIDIA && !PPC_OF + depends on FB_NVIDIA help This enables I2C support for nVidia Chipsets. This is used only for getting EDID information from the attached display
drivers/video/nvidia/nv_of.c +44 -18
78 lines not on this page · raw message
drivers/video/nvidia/nv_proto.h +11 -1
@@ -31,7 +31,7 @@void NVLockUnlock (struct nvidia_par *par,int );/* in nvidia-i2c.c */ -#if defined(CONFIG_FB_NVIDIA_I2C ) || defined (CONFIG_PPC_OF ) +#ifdef CONFIG_FB_NVIDIA_I2C void nvidia_create_i2c_busses (struct nvidia_par *par);void nvidia_delete_i2c_busses (struct nvidia_par *par); int nvidia_probe_i2c_connector(struct fb_info *info, int conn,
@@ -45,6 +45,16 @@ } while(0)#endif +#ifdef CONFIG_FB_OF +int nvidia_probe_of_connector (struct fb_info *info,int conn, +u8 ** out_edid); +#else +#define nvidia_probe_of_connector (p, c, edid) \ +do { \ + *(edid) = NULL; \ +} while(0) +#endif +/* in nv_accel.c */ extern void NVResetGraphics (struct fb_info *info); extern void nvidiafb_copyarea(struct fb_info *info,
drivers/video/nvidia/nv_setup.c +11 -5
@@ -190,9 +190,9 @@ present = (NV_RD32 (PRAMDAC ,0x0608 ) & (1 <<28 )) ?1 :0 ;if (present) -printk ("nvidiafb: CRTC%i found\n" , output); +printk ("nvidiafb: CRTC%i analog found\n" , output);else -printk ("nvidiafb: CRTC%i not found\n" , output); +printk ("nvidiafb: CRTC%i analog not found\n" , output);NV_WR32 (par->PRAMDAC0,0x0608 ,NV_RD32 (par->PRAMDAC0,0x0608 ) &0x0000EFFF );
@@ -305,6 +305,9 @@int FlatPanel =-1 ;/* really means the CRTC is slaved */ int Television =0 ; +memset (&monitorA,0 ,sizeof (struct fb_monspecs )); +memset (&monitorB,0 ,sizeof (struct fb_monspecs )); + par->PRAMIN = par->REGS + (0x00710000 /4 ); par->PCRTC0 = par->REGS + (0x00600000 /4 ); par->PRAMDAC0 = par->REGS + (0x00680000 /4 );
@@ -401,7 +404,8 @@nvidia_create_i2c_busses (par);if (!par->twoHeads) { par->CRTCnumber =0 ; -nvidia_probe_i2c_connector (info,1 , &edidA); +if (nvidia_probe_i2c_connector (info,1 , &edidA)) +nvidia_probe_of_connector (info,1 , &edidA);if (edidA && !fb_parse_edid (edidA, &var)) {printk ("nvidiafb: EDID found from BUS1\n" ); monA = &monitorA;
@@ -488,14 +492,16 @@ oldhead =NV_RD32 (par->PCRTC0,0x00000860 );NV_WR32 (par->PCRTC0,0x00000860 , oldhead |0x00000010 ); -nvidia_probe_i2c_connector (info,1 , &edidA); +if (nvidia_probe_i2c_connector (info,1 , &edidA)) +nvidia_probe_of_connector (info,1 , &edidA);if (edidA && !fb_parse_edid (edidA, &var)) {printk ("nvidiafb: EDID found from BUS1\n" ); monA = &monitorA;fb_edid_to_monspecs (edidA, monA); } -nvidia_probe_i2c_connector (info,2 , &edidB); +if (nvidia_probe_i2c_connector (info,2 , &edidB)) +nvidia_probe_of_connector (info,2 , &edidB);if (edidB && !fb_parse_edid (edidB, &var)) {printk ("nvidiafb: EDID found from BUS2\n" ); monB = &monitorB;
drivers/video/nvidia/nvidia.c +71 -13
140 lines not on this page · raw message
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl