aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/riva/fbdev.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-08 05:40:17 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:05 -0500
commitfd717689f46436fc212882ddc6e02a20be920634 (patch)
tree4b4a7bd76f23716fbd14886cfdfb9aab7033b2f8 /drivers/video/riva/fbdev.c
parent945f0ee257b4f91498b4061dc89b8a68c423ea6f (diff)
[PATCH] atyfb, rivafb: minor fixes
aty128fb: return an error in the unlikely event that we cannot calculate some key PLL info rivafb: * call CalcStateExt() directly, rather than via function pointers, since CalcStateExt() is the only value ever assigned to ->CalcStateExt(). * propagate error return back from CalcVClock() through callers Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/riva/fbdev.c')
-rw-r--r--drivers/video/riva/fbdev.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index c6f86859399c..345e8b1c1af8 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -740,11 +740,12 @@ static void riva_load_state(struct riva_par *par, struct riva_regs *regs)
740 * CALLED FROM: 740 * CALLED FROM:
741 * rivafb_set_par() 741 * rivafb_set_par()
742 */ 742 */
743static void riva_load_video_mode(struct fb_info *info) 743static int riva_load_video_mode(struct fb_info *info)
744{ 744{
745 int bpp, width, hDisplaySize, hDisplay, hStart, 745 int bpp, width, hDisplaySize, hDisplay, hStart,
746 hEnd, hTotal, height, vDisplay, vStart, vEnd, vTotal, dotClock; 746 hEnd, hTotal, height, vDisplay, vStart, vEnd, vTotal, dotClock;
747 int hBlankStart, hBlankEnd, vBlankStart, vBlankEnd; 747 int hBlankStart, hBlankEnd, vBlankStart, vBlankEnd;
748 int rc;
748 struct riva_par *par = info->par; 749 struct riva_par *par = info->par;
749 struct riva_regs newmode; 750 struct riva_regs newmode;
750 751
@@ -850,8 +851,10 @@ static void riva_load_video_mode(struct fb_info *info)
850 else 851 else
851 newmode.misc_output |= 0x80; 852 newmode.misc_output |= 0x80;
852 853
853 par->riva.CalcStateExt(&par->riva, &newmode.ext, bpp, width, 854 rc = CalcStateExt(&par->riva, &newmode.ext, bpp, width,
854 hDisplaySize, height, dotClock); 855 hDisplaySize, height, dotClock);
856 if (rc)
857 goto out;
855 858
856 newmode.ext.scale = NV_RD32(par->riva.PRAMDAC, 0x00000848) & 859 newmode.ext.scale = NV_RD32(par->riva.PRAMDAC, 0x00000848) &
857 0xfff000ff; 860 0xfff000ff;
@@ -883,8 +886,12 @@ static void riva_load_video_mode(struct fb_info *info)
883 par->current_state = newmode; 886 par->current_state = newmode;
884 riva_load_state(par, &par->current_state); 887 riva_load_state(par, &par->current_state);
885 par->riva.LockUnlock(&par->riva, 0); /* important for HW cursor */ 888 par->riva.LockUnlock(&par->riva, 0); /* important for HW cursor */
889
890out:
886 rivafb_blank(FB_BLANK_UNBLANK, info); 891 rivafb_blank(FB_BLANK_UNBLANK, info);
887 NVTRACE_LEAVE(); 892 NVTRACE_LEAVE();
893
894 return rc;
888} 895}
889 896
890static void riva_update_var(struct fb_var_screeninfo *var, struct fb_videomode *modedb) 897static void riva_update_var(struct fb_var_screeninfo *var, struct fb_videomode *modedb)
@@ -1252,12 +1259,15 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
1252static int rivafb_set_par(struct fb_info *info) 1259static int rivafb_set_par(struct fb_info *info)
1253{ 1260{
1254 struct riva_par *par = info->par; 1261 struct riva_par *par = info->par;
1262 int rc = 0;
1255 1263
1256 NVTRACE_ENTER(); 1264 NVTRACE_ENTER();
1257 /* vgaHWunlock() + riva unlock (0x7F) */ 1265 /* vgaHWunlock() + riva unlock (0x7F) */
1258 CRTCout(par, 0x11, 0xFF); 1266 CRTCout(par, 0x11, 0xFF);
1259 par->riva.LockUnlock(&par->riva, 0); 1267 par->riva.LockUnlock(&par->riva, 0);
1260 riva_load_video_mode(info); 1268 rc = riva_load_video_mode(info);
1269 if (rc)
1270 goto out;
1261 if(!(info->flags & FBINFO_HWACCEL_DISABLED)) 1271 if(!(info->flags & FBINFO_HWACCEL_DISABLED))
1262 riva_setup_accel(info); 1272 riva_setup_accel(info);
1263 1273
@@ -1270,8 +1280,10 @@ static int rivafb_set_par(struct fb_info *info)
1270 info->pixmap.scan_align = 1; 1280 info->pixmap.scan_align = 1;
1271 else 1281 else
1272 info->pixmap.scan_align = 4; 1282 info->pixmap.scan_align = 4;
1283
1284out:
1273 NVTRACE_LEAVE(); 1285 NVTRACE_LEAVE();
1274 return 0; 1286 return rc;
1275} 1287}
1276 1288
1277/** 1289/**