aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tridentfb.c45
-rw-r--r--include/linux/fb.h4
2 files changed, 35 insertions, 14 deletions
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index ff82ec1e5e4d..279411523ed9 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -499,6 +499,10 @@ static void tridentfb_fillrect(struct fb_info *info,
499 struct tridentfb_par *par = info->par; 499 struct tridentfb_par *par = info->par;
500 int col; 500 int col;
501 501
502 if (info->flags & FBINFO_HWACCEL_DISABLED) {
503 cfb_fillrect(info, fr);
504 return;
505 }
502 if (info->var.bits_per_pixel == 8) { 506 if (info->var.bits_per_pixel == 8) {
503 col = fr->color; 507 col = fr->color;
504 col |= col << 8; 508 col |= col << 8;
@@ -516,6 +520,10 @@ static void tridentfb_copyarea(struct fb_info *info,
516{ 520{
517 struct tridentfb_par *par = info->par; 521 struct tridentfb_par *par = info->par;
518 522
523 if (info->flags & FBINFO_HWACCEL_DISABLED) {
524 cfb_copyarea(info, ca);
525 return;
526 }
519 par->wait_engine(par); 527 par->wait_engine(par);
520 par->copy_rect(par, ca->sx, ca->sy, ca->dx, ca->dy, 528 par->copy_rect(par, ca->sx, ca->sy, ca->dx, ca->dy,
521 ca->width, ca->height); 529 ca->width, ca->height);
@@ -525,7 +533,8 @@ static int tridentfb_sync(struct fb_info *info)
525{ 533{
526 struct tridentfb_par *par = info->par; 534 struct tridentfb_par *par = info->par;
527 535
528 par->wait_engine(par); 536 if (!(info->flags & FBINFO_HWACCEL_DISABLED))
537 par->wait_engine(par);
529 return 0; 538 return 0;
530} 539}
531#else 540#else
@@ -855,8 +864,9 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
855 if (var->yres_virtual > 0xffff) 864 if (var->yres_virtual > 0xffff)
856 return -EINVAL; 865 return -EINVAL;
857 line_length = var->xres_virtual * bpp / 8; 866 line_length = var->xres_virtual * bpp / 8;
858#ifdef CONFIG_FB_TRIDENT_ACCEL 867
859 if (!is3Dchip(par->chip_id)) { 868 if (!is3Dchip(par->chip_id) &&
869 !(info->flags & FBINFO_HWACCEL_DISABLED)) {
860 /* acceleration requires line length to be power of 2 */ 870 /* acceleration requires line length to be power of 2 */
861 if (line_length <= 512) 871 if (line_length <= 512)
862 var->xres_virtual = 512 * 8 / bpp; 872 var->xres_virtual = 512 * 8 / bpp;
@@ -873,7 +883,7 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
873 883
874 line_length = var->xres_virtual * bpp / 8; 884 line_length = var->xres_virtual * bpp / 8;
875 } 885 }
876#endif 886
877 if (var->yres > var->yres_virtual) 887 if (var->yres > var->yres_virtual)
878 var->yres_virtual = var->yres; 888 var->yres_virtual = var->yres;
879 if (line_length * var->yres_virtual > info->fix.smem_len) 889 if (line_length * var->yres_virtual > info->fix.smem_len)
@@ -1190,9 +1200,9 @@ static int tridentfb_set_par(struct fb_info *info)
1190 set_number_of_lines(par, info->var.yres); 1200 set_number_of_lines(par, info->var.yres);
1191 info->fix.line_length = info->var.xres_virtual * bpp / 8; 1201 info->fix.line_length = info->var.xres_virtual * bpp / 8;
1192 set_lwidth(par, info->fix.line_length / 8); 1202 set_lwidth(par, info->fix.line_length / 8);
1193#ifdef CONFIG_FB_TRIDENT_ACCEL 1203
1194 par->init_accel(par, info->var.xres_virtual, bpp); 1204 if (!(info->flags & FBINFO_HWACCEL_DISABLED))
1195#endif 1205 par->init_accel(par, info->var.xres_virtual, bpp);
1196 1206
1197 info->fix.visual = (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; 1207 info->fix.visual = (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
1198 info->cmap.len = (bpp == 8) ? 256 : 16; 1208 info->cmap.len = (bpp == 8) ? 256 : 16;
@@ -1326,6 +1336,9 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1326 output("*** Please do use cyblafb, Cyberblade/i1 support " 1336 output("*** Please do use cyblafb, Cyberblade/i1 support "
1327 "will soon be removed from tridentfb!\n"); 1337 "will soon be removed from tridentfb!\n");
1328 1338
1339#ifndef CONFIG_FB_TRIDENT_ACCEL
1340 noaccel = 1;
1341#endif
1329 1342
1330 /* If PCI id is 0x9660 then further detect chip type */ 1343 /* If PCI id is 0x9660 then further detect chip type */
1331 1344
@@ -1370,21 +1383,25 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1370 default_par->wait_engine = xp_wait_engine; 1383 default_par->wait_engine = xp_wait_engine;
1371 default_par->fill_rect = xp_fill_rect; 1384 default_par->fill_rect = xp_fill_rect;
1372 default_par->copy_rect = xp_copy_rect; 1385 default_par->copy_rect = xp_copy_rect;
1386 tridentfb_fix.accel = FB_ACCEL_TRIDENT_BLADEXP;
1373 } else if (is_blade(chip_id)) { 1387 } else if (is_blade(chip_id)) {
1374 default_par->init_accel = blade_init_accel; 1388 default_par->init_accel = blade_init_accel;
1375 default_par->wait_engine = blade_wait_engine; 1389 default_par->wait_engine = blade_wait_engine;
1376 default_par->fill_rect = blade_fill_rect; 1390 default_par->fill_rect = blade_fill_rect;
1377 default_par->copy_rect = blade_copy_rect; 1391 default_par->copy_rect = blade_copy_rect;
1392 tridentfb_fix.accel = FB_ACCEL_TRIDENT_BLADE3D;
1378 } else if (chip3D) { /* 3DImage family left */ 1393 } else if (chip3D) { /* 3DImage family left */
1379 default_par->init_accel = image_init_accel; 1394 default_par->init_accel = image_init_accel;
1380 default_par->wait_engine = image_wait_engine; 1395 default_par->wait_engine = image_wait_engine;
1381 default_par->fill_rect = image_fill_rect; 1396 default_par->fill_rect = image_fill_rect;
1382 default_par->copy_rect = image_copy_rect; 1397 default_par->copy_rect = image_copy_rect;
1398 tridentfb_fix.accel = FB_ACCEL_TRIDENT_3DIMAGE;
1383 } else { /* TGUI 9440/96XX family */ 1399 } else { /* TGUI 9440/96XX family */
1384 default_par->init_accel = tgui_init_accel; 1400 default_par->init_accel = tgui_init_accel;
1385 default_par->wait_engine = xp_wait_engine; 1401 default_par->wait_engine = xp_wait_engine;
1386 default_par->fill_rect = tgui_fill_rect; 1402 default_par->fill_rect = tgui_fill_rect;
1387 default_par->copy_rect = tgui_copy_rect; 1403 default_par->copy_rect = tgui_copy_rect;
1404 tridentfb_fix.accel = FB_ACCEL_TRIDENT_TGUI;
1388 } 1405 }
1389 1406
1390 default_par->chip_id = chip_id; 1407 default_par->chip_id = chip_id;
@@ -1441,9 +1458,13 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1441 info->pseudo_palette = default_par->pseudo_pal; 1458 info->pseudo_palette = default_par->pseudo_pal;
1442 1459
1443 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; 1460 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
1444#ifdef CONFIG_FB_TRIDENT_ACCEL 1461 if (!noaccel && default_par->init_accel) {
1445 info->flags |= FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT; 1462 info->flags &= ~FBINFO_HWACCEL_DISABLED;
1446#endif 1463 info->flags |= FBINFO_HWACCEL_COPYAREA;
1464 info->flags |= FBINFO_HWACCEL_FILLRECT;
1465 } else
1466 info->flags |= FBINFO_HWACCEL_DISABLED;
1467
1447 if (!fb_find_mode(&info->var, info, 1468 if (!fb_find_mode(&info->var, info,
1448 mode_option, NULL, 0, NULL, bpp)) { 1469 mode_option, NULL, 0, NULL, bpp)) {
1449 err = -EINVAL; 1470 err = -EINVAL;
@@ -1453,10 +1474,6 @@ static int __devinit trident_pci_probe(struct pci_dev *dev,
1453 if (err < 0) 1474 if (err < 0)
1454 goto out_unmap2; 1475 goto out_unmap2;
1455 1476
1456 if (!noaccel && default_par->init_accel)
1457 info->var.accel_flags |= FB_ACCELF_TEXT;
1458 else
1459 info->var.accel_flags &= ~FB_ACCELF_TEXT;
1460 info->var.activate |= FB_ACTIVATE_NOW; 1477 info->var.activate |= FB_ACTIVATE_NOW;
1461 info->device = &dev->dev; 1478 info->device = &dev->dev;
1462 if (register_framebuffer(info) < 0) { 1479 if (register_framebuffer(info) < 0) {
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 72295b099228..a084d1335869 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -120,6 +120,10 @@ struct dentry;
120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ 120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ 121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
122#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ 122#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
123#define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */
124#define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */
125#define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */
126#define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */
123#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ 127#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
124#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ 128#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
125#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ 129#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */