aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cirrusfb.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-03-31 18:25:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:27 -0400
commit213d4bdd8cd405d9ba59ee78165b8c870f83a018 (patch)
treeee9f4cdf2d8a964f2d75b5948b059ada6e62fe94 /drivers/video/cirrusfb.c
parent55a4ea6ab0fff0c02f101a60d2ba4f1794990499 (diff)
cirrusfb: add Laguna additional overflow register
Add additional overflow register setting for Laguna chips. Also, simplify some code in the cirrusfb_pan_display() and cirrusfb_blank(). Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/cirrusfb.c')
-rw-r--r--drivers/video/cirrusfb.c68
1 files changed, 42 insertions, 26 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index dd09bae910f0..119e49ed6218 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -1259,13 +1259,32 @@ static int cirrusfb_set_par_foo(struct fb_info *info)
1259 /* screen start addr #16-18, fastpagemode cycles */ 1259 /* screen start addr #16-18, fastpagemode cycles */
1260 vga_wcrt(regbase, CL_CRT1B, tmp); 1260 vga_wcrt(regbase, CL_CRT1B, tmp);
1261 1261
1262 if (cinfo->btype == BT_SD64 || 1262 /* screen start address bit 19 */
1263 cinfo->btype == BT_PICASSO4 || 1263 if (cirrusfb_board_info[cinfo->btype].scrn_start_bit19)
1264 cinfo->btype == BT_ALPINE ||
1265 cinfo->btype == BT_GD5480)
1266 /* screen start address bit 19 */
1267 vga_wcrt(regbase, CL_CRT1D, 0x00); 1264 vga_wcrt(regbase, CL_CRT1D, 0x00);
1268 1265
1266 if (cinfo->btype == BT_LAGUNA ||
1267 cinfo->btype == BT_GD5480) {
1268
1269 tmp = 0;
1270 if ((htotal + 5) & 256)
1271 tmp |= 128;
1272 if (hdispend & 256)
1273 tmp |= 64;
1274 if (hsyncstart & 256)
1275 tmp |= 48;
1276 if (vtotal & 1024)
1277 tmp |= 8;
1278 if (vdispend & 1024)
1279 tmp |= 4;
1280 if (vsyncstart & 1024)
1281 tmp |= 3;
1282
1283 vga_wcrt(regbase, CL_CRT1E, tmp);
1284 dev_dbg(info->device, "CRT1e: %d\n", tmp);
1285 }
1286
1287
1269 /* text cursor location high */ 1288 /* text cursor location high */
1270 vga_wcrt(regbase, VGA_CRTC_CURSOR_HI, 0); 1289 vga_wcrt(regbase, VGA_CRTC_CURSOR_HI, 0);
1271 /* text cursor location low */ 1290 /* text cursor location low */
@@ -1383,7 +1402,7 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var,
1383 int xoffset = 0; 1402 int xoffset = 0;
1384 int yoffset = 0; 1403 int yoffset = 0;
1385 unsigned long base; 1404 unsigned long base;
1386 unsigned char tmp = 0, tmp2 = 0, xpix; 1405 unsigned char tmp, xpix;
1387 struct cirrusfb_info *cinfo = info->par; 1406 struct cirrusfb_info *cinfo = info->par;
1388 1407
1389 dev_dbg(info->device, 1408 dev_dbg(info->device,
@@ -1418,6 +1437,8 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var,
1418 vga_wcrt(cinfo->regbase, VGA_CRTC_START_HI, 1437 vga_wcrt(cinfo->regbase, VGA_CRTC_START_HI,
1419 (unsigned char) (base >> 8)); 1438 (unsigned char) (base >> 8));
1420 1439
1440 /* 0xf2 is %11110010, exclude tmp bits */
1441 tmp = vga_rcrt(cinfo->regbase, CL_CRT1B) & 0xf2;
1421 /* construct bits 16, 17 and 18 of screen start address */ 1442 /* construct bits 16, 17 and 18 of screen start address */
1422 if (base & 0x10000) 1443 if (base & 0x10000)
1423 tmp |= 0x01; 1444 tmp |= 0x01;
@@ -1426,9 +1447,7 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var,
1426 if (base & 0x40000) 1447 if (base & 0x40000)
1427 tmp |= 0x08; 1448 tmp |= 0x08;
1428 1449
1429 /* 0xf2 is %11110010, exclude tmp bits */ 1450 vga_wcrt(cinfo->regbase, CL_CRT1B, tmp);
1430 tmp2 = (vga_rcrt(cinfo->regbase, CL_CRT1B) & 0xf2) | tmp;
1431 vga_wcrt(cinfo->regbase, CL_CRT1B, tmp2);
1432 1451
1433 /* construct bit 19 of screen start address */ 1452 /* construct bit 19 of screen start address */
1434 if (cirrusfb_board_info[cinfo->btype].scrn_start_bit19) 1453 if (cirrusfb_board_info[cinfo->btype].scrn_start_bit19)
@@ -1473,47 +1492,44 @@ static int cirrusfb_blank(int blank_mode, struct fb_info *info)
1473 1492
1474 /* Undo current */ 1493 /* Undo current */
1475 if (current_mode == FB_BLANK_NORMAL || 1494 if (current_mode == FB_BLANK_NORMAL ||
1476 current_mode == FB_BLANK_UNBLANK) { 1495 current_mode == FB_BLANK_UNBLANK)
1477 /* unblank the screen */
1478 val = vga_rseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE);
1479 /* clear "FullBandwidth" bit */ 1496 /* clear "FullBandwidth" bit */
1480 vga_wseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE, val & 0xdf); 1497 val = 0;
1481 /* and undo VESA suspend trickery */ 1498 else
1482 vga_wgfx(cinfo->regbase, CL_GRE, 0x00);
1483 }
1484
1485 /* set new */
1486 if (blank_mode > FB_BLANK_NORMAL) {
1487 /* blank the screen */
1488 val = vga_rseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE);
1489 /* set "FullBandwidth" bit */ 1499 /* set "FullBandwidth" bit */
1490 vga_wseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE, val | 0x20); 1500 val = 0x20;
1491 } 1501
1502 val |= vga_rseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE) & 0xdf;
1503 vga_wseq(cinfo->regbase, VGA_SEQ_CLOCK_MODE, val);
1492 1504
1493 switch (blank_mode) { 1505 switch (blank_mode) {
1494 case FB_BLANK_UNBLANK: 1506 case FB_BLANK_UNBLANK:
1495 case FB_BLANK_NORMAL: 1507 case FB_BLANK_NORMAL:
1508 val = 0x00;
1496 break; 1509 break;
1497 case FB_BLANK_VSYNC_SUSPEND: 1510 case FB_BLANK_VSYNC_SUSPEND:
1498 vga_wgfx(cinfo->regbase, CL_GRE, 0x04); 1511 val = 0x04;
1499 break; 1512 break;
1500 case FB_BLANK_HSYNC_SUSPEND: 1513 case FB_BLANK_HSYNC_SUSPEND:
1501 vga_wgfx(cinfo->regbase, CL_GRE, 0x02); 1514 val = 0x02;
1502 break; 1515 break;
1503 case FB_BLANK_POWERDOWN: 1516 case FB_BLANK_POWERDOWN:
1504 vga_wgfx(cinfo->regbase, CL_GRE, 0x06); 1517 val = 0x06;
1505 break; 1518 break;
1506 default: 1519 default:
1507 dev_dbg(info->device, "EXIT, returning 1\n"); 1520 dev_dbg(info->device, "EXIT, returning 1\n");
1508 return 1; 1521 return 1;
1509 } 1522 }
1510 1523
1524 vga_wgfx(cinfo->regbase, CL_GRE, val);
1525
1511 cinfo->blank_mode = blank_mode; 1526 cinfo->blank_mode = blank_mode;
1512 dev_dbg(info->device, "EXIT, returning 0\n"); 1527 dev_dbg(info->device, "EXIT, returning 0\n");
1513 1528
1514 /* Let fbcon do a soft blank for us */ 1529 /* Let fbcon do a soft blank for us */
1515 return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0; 1530 return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0;
1516} 1531}
1532
1517/**** END Hardware specific Routines **************************************/ 1533/**** END Hardware specific Routines **************************************/
1518/****************************************************************************/ 1534/****************************************************************************/
1519/**** BEGIN Internal Routines ***********************************************/ 1535/**** BEGIN Internal Routines ***********************************************/