aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/riva/riva_hw.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/riva_hw.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/riva_hw.c')
-rw-r--r--drivers/video/riva/riva_hw.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/riva/riva_hw.c b/drivers/video/riva/riva_hw.c
index b6f8690b96c9..e0b8c521cc9c 100644
--- a/drivers/video/riva/riva_hw.c
+++ b/drivers/video/riva/riva_hw.c
@@ -1227,7 +1227,7 @@ static int CalcVClock
1227 * Calculate extended mode parameters (SVGA) and save in a 1227 * Calculate extended mode parameters (SVGA) and save in a
1228 * mode state structure. 1228 * mode state structure.
1229 */ 1229 */
1230static void CalcStateExt 1230int CalcStateExt
1231( 1231(
1232 RIVA_HW_INST *chip, 1232 RIVA_HW_INST *chip,
1233 RIVA_HW_STATE *state, 1233 RIVA_HW_STATE *state,
@@ -1249,7 +1249,8 @@ static void CalcStateExt
1249 * Extended RIVA registers. 1249 * Extended RIVA registers.
1250 */ 1250 */
1251 pixelDepth = (bpp + 1)/8; 1251 pixelDepth = (bpp + 1)/8;
1252 CalcVClock(dotClock, &VClk, &m, &n, &p, chip); 1252 if (!CalcVClock(dotClock, &VClk, &m, &n, &p, chip))
1253 return -EINVAL;
1253 1254
1254 switch (chip->Architecture) 1255 switch (chip->Architecture)
1255 { 1256 {
@@ -1327,6 +1328,8 @@ static void CalcStateExt
1327 state->pitch1 = 1328 state->pitch1 =
1328 state->pitch2 = 1329 state->pitch2 =
1329 state->pitch3 = pixelDepth * width; 1330 state->pitch3 = pixelDepth * width;
1331
1332 return 0;
1330} 1333}
1331/* 1334/*
1332 * Load fixed function state and pre-calculated/stored state. 1335 * Load fixed function state and pre-calculated/stored state.
@@ -2026,7 +2029,6 @@ static void nv3GetConfig
2026 */ 2029 */
2027 chip->Busy = nv3Busy; 2030 chip->Busy = nv3Busy;
2028 chip->ShowHideCursor = ShowHideCursor; 2031 chip->ShowHideCursor = ShowHideCursor;
2029 chip->CalcStateExt = CalcStateExt;
2030 chip->LoadStateExt = LoadStateExt; 2032 chip->LoadStateExt = LoadStateExt;
2031 chip->UnloadStateExt = UnloadStateExt; 2033 chip->UnloadStateExt = UnloadStateExt;
2032 chip->SetStartAddress = SetStartAddress3; 2034 chip->SetStartAddress = SetStartAddress3;
@@ -2084,7 +2086,6 @@ static void nv4GetConfig
2084 */ 2086 */
2085 chip->Busy = nv4Busy; 2087 chip->Busy = nv4Busy;
2086 chip->ShowHideCursor = ShowHideCursor; 2088 chip->ShowHideCursor = ShowHideCursor;
2087 chip->CalcStateExt = CalcStateExt;
2088 chip->LoadStateExt = LoadStateExt; 2089 chip->LoadStateExt = LoadStateExt;
2089 chip->UnloadStateExt = UnloadStateExt; 2090 chip->UnloadStateExt = UnloadStateExt;
2090 chip->SetStartAddress = SetStartAddress; 2091 chip->SetStartAddress = SetStartAddress;
@@ -2186,7 +2187,6 @@ static void nv10GetConfig
2186 */ 2187 */
2187 chip->Busy = nv10Busy; 2188 chip->Busy = nv10Busy;
2188 chip->ShowHideCursor = ShowHideCursor; 2189 chip->ShowHideCursor = ShowHideCursor;
2189 chip->CalcStateExt = CalcStateExt;
2190 chip->LoadStateExt = LoadStateExt; 2190 chip->LoadStateExt = LoadStateExt;
2191 chip->UnloadStateExt = UnloadStateExt; 2191 chip->UnloadStateExt = UnloadStateExt;
2192 chip->SetStartAddress = SetStartAddress; 2192 chip->SetStartAddress = SetStartAddress;