aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-09-08 20:22:53 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-08 20:22:53 -0400
commite3e3679cfc1c6689e035f6d69606253b1eda63ca (patch)
tree1e7931256ecb9b37c35469a26a37216287657857 /drivers/char
parent54205209732a05f51f5fbb3eb3e5c36ac81e79d9 (diff)
parent29db35edb2548c3b0299c53d62d5f26d77a8e58f (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/amd64-agp.c2
-rw-r--r--drivers/char/agp/generic.c33
2 files changed, 17 insertions, 18 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 59f589d733f9..0a7624a9b1c1 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -429,7 +429,7 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
429 struct pci_dev *dev1; 429 struct pci_dev *dev1;
430 int i; 430 int i;
431 unsigned size = amd64_fetch_size(); 431 unsigned size = amd64_fetch_size();
432 printk(KERN_INFO "Setting up ULi AGP. \n"); 432 printk(KERN_INFO "Setting up ULi AGP.\n");
433 dev1 = pci_find_slot ((unsigned int)pdev->bus->number,PCI_DEVFN(0,0)); 433 dev1 = pci_find_slot ((unsigned int)pdev->bus->number,PCI_DEVFN(0,0));
434 if (dev1 == NULL) { 434 if (dev1 == NULL) {
435 printk(KERN_INFO PFX "Detected a ULi chipset, " 435 printk(KERN_INFO PFX "Detected a ULi chipset, "
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index f0079e991bdc..ac9da0ca36b7 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -319,7 +319,6 @@ int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
319 info->mode = bridge->mode & ~AGP3_RESERVED_MASK; 319 info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
320 else 320 else
321 info->mode = bridge->mode & ~AGP2_RESERVED_MASK; 321 info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
322 info->mode = bridge->mode;
323 info->aper_base = bridge->gart_bus_addr; 322 info->aper_base = bridge->gart_bus_addr;
324 info->aper_size = agp_return_size(); 323 info->aper_size = agp_return_size();
325 info->max_memory = bridge->max_memory_agp; 324 info->max_memory = bridge->max_memory_agp;
@@ -356,7 +355,7 @@ int agp_bind_memory(struct agp_memory *curr, off_t pg_start)
356 return -EINVAL; 355 return -EINVAL;
357 356
358 if (curr->is_bound == TRUE) { 357 if (curr->is_bound == TRUE) {
359 printk (KERN_INFO PFX "memory %p is already bound!\n", curr); 358 printk(KERN_INFO PFX "memory %p is already bound!\n", curr);
360 return -EINVAL; 359 return -EINVAL;
361 } 360 }
362 if (curr->is_flushed == FALSE) { 361 if (curr->is_flushed == FALSE) {
@@ -391,7 +390,7 @@ int agp_unbind_memory(struct agp_memory *curr)
391 return -EINVAL; 390 return -EINVAL;
392 391
393 if (curr->is_bound != TRUE) { 392 if (curr->is_bound != TRUE) {
394 printk (KERN_INFO PFX "memory %p was not bound!\n", curr); 393 printk(KERN_INFO PFX "memory %p was not bound!\n", curr);
395 return -EINVAL; 394 return -EINVAL;
396 } 395 }
397 396
@@ -415,7 +414,7 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
415 u32 tmp; 414 u32 tmp;
416 415
417 if (*requested_mode & AGP2_RESERVED_MASK) { 416 if (*requested_mode & AGP2_RESERVED_MASK) {
418 printk (KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode); 417 printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode);
419 *requested_mode &= ~AGP2_RESERVED_MASK; 418 *requested_mode &= ~AGP2_RESERVED_MASK;
420 } 419 }
421 420
@@ -423,7 +422,7 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
423 tmp = *requested_mode & 7; 422 tmp = *requested_mode & 7;
424 switch (tmp) { 423 switch (tmp) {
425 case 0: 424 case 0:
426 printk (KERN_INFO PFX "%s tried to set rate=x0. Setting to x1 mode.\n", current->comm); 425 printk(KERN_INFO PFX "%s tried to set rate=x0. Setting to x1 mode.\n", current->comm);
427 *requested_mode |= AGPSTAT2_1X; 426 *requested_mode |= AGPSTAT2_1X;
428 break; 427 break;
429 case 1: 428 case 1:
@@ -493,18 +492,18 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
493 u32 tmp; 492 u32 tmp;
494 493
495 if (*requested_mode & AGP3_RESERVED_MASK) { 494 if (*requested_mode & AGP3_RESERVED_MASK) {
496 printk (KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode); 495 printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode);
497 *requested_mode &= ~AGP3_RESERVED_MASK; 496 *requested_mode &= ~AGP3_RESERVED_MASK;
498 } 497 }
499 498
500 /* Check the speed bits make sense. */ 499 /* Check the speed bits make sense. */
501 tmp = *requested_mode & 7; 500 tmp = *requested_mode & 7;
502 if (tmp == 0) { 501 if (tmp == 0) {
503 printk (KERN_INFO PFX "%s tried to set rate=x0. Setting to AGP3 x4 mode.\n", current->comm); 502 printk(KERN_INFO PFX "%s tried to set rate=x0. Setting to AGP3 x4 mode.\n", current->comm);
504 *requested_mode |= AGPSTAT3_4X; 503 *requested_mode |= AGPSTAT3_4X;
505 } 504 }
506 if (tmp >= 3) { 505 if (tmp >= 3) {
507 printk (KERN_INFO PFX "%s tried to set rate=x%d. Setting to AGP3 x8 mode.\n", current->comm, tmp * 4); 506 printk(KERN_INFO PFX "%s tried to set rate=x%d. Setting to AGP3 x8 mode.\n", current->comm, tmp * 4);
508 *requested_mode = (*requested_mode & ~7) | AGPSTAT3_8X; 507 *requested_mode = (*requested_mode & ~7) | AGPSTAT3_8X;
509 } 508 }
510 509
@@ -533,7 +532,7 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
533 * AGP2.x 4x -> AGP3.0 4x. 532 * AGP2.x 4x -> AGP3.0 4x.
534 */ 533 */
535 if (*requested_mode & AGPSTAT2_4X) { 534 if (*requested_mode & AGPSTAT2_4X) {
536 printk (KERN_INFO PFX "%s passes broken AGP3 flags (%x). Fixed.\n", 535 printk(KERN_INFO PFX "%s passes broken AGP3 flags (%x). Fixed.\n",
537 current->comm, *requested_mode); 536 current->comm, *requested_mode);
538 *requested_mode &= ~AGPSTAT2_4X; 537 *requested_mode &= ~AGPSTAT2_4X;
539 *requested_mode |= AGPSTAT3_4X; 538 *requested_mode |= AGPSTAT3_4X;
@@ -544,7 +543,7 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
544 * but have been passed an AGP 2.x mode. 543 * but have been passed an AGP 2.x mode.
545 * Convert AGP 1x,2x,4x -> AGP 3.0 4x. 544 * Convert AGP 1x,2x,4x -> AGP 3.0 4x.
546 */ 545 */
547 printk (KERN_INFO PFX "%s passes broken AGP2 flags (%x) in AGP3 mode. Fixed.\n", 546 printk(KERN_INFO PFX "%s passes broken AGP2 flags (%x) in AGP3 mode. Fixed.\n",
548 current->comm, *requested_mode); 547 current->comm, *requested_mode);
549 *requested_mode &= ~(AGPSTAT2_4X | AGPSTAT2_2X | AGPSTAT2_1X); 548 *requested_mode &= ~(AGPSTAT2_4X | AGPSTAT2_2X | AGPSTAT2_1X);
550 *requested_mode |= AGPSTAT3_4X; 549 *requested_mode |= AGPSTAT3_4X;
@@ -554,13 +553,13 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
554 if (!(*bridge_agpstat & AGPSTAT3_8X)) { 553 if (!(*bridge_agpstat & AGPSTAT3_8X)) {
555 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); 554 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
556 *bridge_agpstat |= AGPSTAT3_4X; 555 *bridge_agpstat |= AGPSTAT3_4X;
557 printk ("%s requested AGPx8 but bridge not capable.\n", current->comm); 556 printk(KERN_INFO PFX "%s requested AGPx8 but bridge not capable.\n", current->comm);
558 return; 557 return;
559 } 558 }
560 if (!(*vga_agpstat & AGPSTAT3_8X)) { 559 if (!(*vga_agpstat & AGPSTAT3_8X)) {
561 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD); 560 *bridge_agpstat &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
562 *bridge_agpstat |= AGPSTAT3_4X; 561 *bridge_agpstat |= AGPSTAT3_4X;
563 printk ("%s requested AGPx8 but graphic card not capable.\n", current->comm); 562 printk(KERN_INFO PFX "%s requested AGPx8 but graphic card not capable.\n", current->comm);
564 return; 563 return;
565 } 564 }
566 /* All set, bridge & device can do AGP x8*/ 565 /* All set, bridge & device can do AGP x8*/
@@ -578,13 +577,13 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
578 if ((*bridge_agpstat & AGPSTAT3_4X) && (*vga_agpstat & AGPSTAT3_4X)) 577 if ((*bridge_agpstat & AGPSTAT3_4X) && (*vga_agpstat & AGPSTAT3_4X))
579 *bridge_agpstat |= AGPSTAT3_4X; 578 *bridge_agpstat |= AGPSTAT3_4X;
580 else { 579 else {
581 printk (KERN_INFO PFX "Badness. Don't know which AGP mode to set. " 580 printk(KERN_INFO PFX "Badness. Don't know which AGP mode to set. "
582 "[bridge_agpstat:%x vga_agpstat:%x fell back to:- bridge_agpstat:%x vga_agpstat:%x]\n", 581 "[bridge_agpstat:%x vga_agpstat:%x fell back to:- bridge_agpstat:%x vga_agpstat:%x]\n",
583 origbridge, origvga, *bridge_agpstat, *vga_agpstat); 582 origbridge, origvga, *bridge_agpstat, *vga_agpstat);
584 if (!(*bridge_agpstat & AGPSTAT3_4X)) 583 if (!(*bridge_agpstat & AGPSTAT3_4X))
585 printk (KERN_INFO PFX "Bridge couldn't do AGP x4.\n"); 584 printk(KERN_INFO PFX "Bridge couldn't do AGP x4.\n");
586 if (!(*vga_agpstat & AGPSTAT3_4X)) 585 if (!(*vga_agpstat & AGPSTAT3_4X))
587 printk (KERN_INFO PFX "Graphic card couldn't do AGP x4.\n"); 586 printk(KERN_INFO PFX "Graphic card couldn't do AGP x4.\n");
588 return; 587 return;
589 } 588 }
590 } 589 }
@@ -622,7 +621,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode
622 for (;;) { 621 for (;;) {
623 device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, device); 622 device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, device);
624 if (!device) { 623 if (!device) {
625 printk (KERN_INFO PFX "Couldn't find an AGP VGA controller.\n"); 624 printk(KERN_INFO PFX "Couldn't find an AGP VGA controller.\n");
626 return 0; 625 return 0;
627 } 626 }
628 cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP); 627 cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP);
@@ -734,7 +733,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
734 pci_write_config_dword(bridge->dev, 733 pci_write_config_dword(bridge->dev,
735 bridge->capndx+AGPCTRL, temp); 734 bridge->capndx+AGPCTRL, temp);
736 735
737 printk (KERN_INFO PFX "Device is in legacy mode," 736 printk(KERN_INFO PFX "Device is in legacy mode,"
738 " falling back to 2.x\n"); 737 " falling back to 2.x\n");
739 } 738 }
740 } 739 }