Rev 1230 | Rev 1239 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1230 | Rev 1233 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #include "radeon_asic.h" |
35 | #include "radeon_asic.h" |
36 | #include "atom.h" |
36 | #include "atom.h" |
Line 37... | Line 37... | ||
37 | 37 | ||
Line 38... | Line -... | ||
38 | #include |
- | |
Line 39... | Line 38... | ||
39 | 38 | #include |
|
40 | #include |
39 | |
41 | 40 | ||
42 | int radeon_dynclks = -1; |
41 | int radeon_dynclks = -1; |
43 | int radeon_r4xx_atom = 0; |
42 | int radeon_r4xx_atom = 0; |
44 | int radeon_agpmode = -1; |
43 | int radeon_agpmode = -1; |
45 | int radeon_gart_size = 512; /* default gart size */ |
44 | int radeon_gart_size = 512; /* default gart size */ |
Line 46... | Line 45... | ||
46 | int radeon_benchmarking = 0; |
45 | int radeon_benchmarking = 0; |
47 | int radeon_connector_table = 0; |
46 | int radeon_connector_table = 0; |
- | 47 | int radeon_tv = 0; |
|
- | 48 | ||
- | 49 | void parse_cmdline(char *cmdline, mode_t *mode, char *log); |
|
- | 50 | int init_display(struct radeon_device *rdev, mode_t *mode); |
|
- | 51 | ||
- | 52 | /* Legacy VGA regions */ |
|
- | 53 | #define VGA_RSRC_NONE 0x00 |
|
- | 54 | #define VGA_RSRC_LEGACY_IO 0x01 |
|
- | 55 | #define VGA_RSRC_LEGACY_MEM 0x02 |
|
- | 56 | #define VGA_RSRC_LEGACY_MASK (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) |
|
- | 57 | /* Non-legacy access */ |
|
Line 48... | Line 58... | ||
48 | int radeon_tv = 0; |
58 | #define VGA_RSRC_NORMAL_IO 0x04 |
49 | 59 | #define VGA_RSRC_NORMAL_MEM 0x08 |
|
50 | int pre_init_display(struct radeon_device *rdev); |
60 | |
51 | int post_init_display(struct radeon_device *rdev); |
61 | |
Line 225... | Line 235... | ||
225 | 235 | ||
Line 226... | Line 236... | ||
226 | return false; |
236 | return false; |
Line -... | Line 237... | ||
- | 237 | ||
- | 238 | } |
|
- | 239 | ||
- | 240 | int radeon_dummy_page_init(struct radeon_device *rdev) |
|
- | 241 | { |
|
- | 242 | rdev->dummy_page.page = AllocPage(); |
|
- | 243 | if (rdev->dummy_page.page == NULL) |
|
- | 244 | return -ENOMEM; |
|
- | 245 | rdev->dummy_page.addr = MapIoMem(rdev->dummy_page.page, 4096, 5); |
|
- | 246 | if (!rdev->dummy_page.addr) { |
|
- | 247 | // __free_page(rdev->dummy_page.page); |
|
- | 248 | rdev->dummy_page.page = NULL; |
|
- | 249 | return -ENOMEM; |
|
- | 250 | } |
|
- | 251 | return 0; |
|
- | 252 | } |
|
- | 253 | ||
- | 254 | void radeon_dummy_page_fini(struct radeon_device *rdev) |
|
- | 255 | { |
|
- | 256 | if (rdev->dummy_page.page == NULL) |
|
- | 257 | return; |
|
- | 258 | KernelFree(rdev->dummy_page.addr); |
|
Line 227... | Line 259... | ||
227 | 259 | rdev->dummy_page.page = NULL; |
|
228 | } |
260 | } |
229 | 261 | ||
230 | 262 | ||
Line 283... | Line 315... | ||
283 | } |
315 | } |
284 | if (rdev->family == CHIP_RS600) { |
316 | if (rdev->family == CHIP_RS600) { |
285 | rdev->mc_rreg = &rs600_mc_rreg; |
317 | rdev->mc_rreg = &rs600_mc_rreg; |
286 | rdev->mc_wreg = &rs600_mc_wreg; |
318 | rdev->mc_wreg = &rs600_mc_wreg; |
287 | } |
319 | } |
288 | // if (rdev->family >= CHIP_R600) { |
320 | if (rdev->family >= CHIP_R600) { |
289 | // rdev->pciep_rreg = &r600_pciep_rreg; |
321 | rdev->pciep_rreg = &r600_pciep_rreg; |
290 | // rdev->pciep_wreg = &r600_pciep_wreg; |
322 | rdev->pciep_wreg = &r600_pciep_wreg; |
291 | // } |
323 | } |
292 | } |
324 | } |
Line 293... | Line 325... | ||
293 | 325 | ||
294 | 326 | ||
Line 352... | Line 384... | ||
352 | case CHIP_RV620: |
384 | case CHIP_RV620: |
353 | case CHIP_RV635: |
385 | case CHIP_RV635: |
354 | case CHIP_RV670: |
386 | case CHIP_RV670: |
355 | case CHIP_RS780: |
387 | case CHIP_RS780: |
356 | case CHIP_RS880: |
388 | case CHIP_RS880: |
357 | // rdev->asic = &r600_asic; |
389 | rdev->asic = &r600_asic; |
358 | break; |
390 | break; |
359 | case CHIP_RV770: |
391 | case CHIP_RV770: |
360 | case CHIP_RV730: |
392 | case CHIP_RV730: |
361 | case CHIP_RV710: |
393 | case CHIP_RV710: |
362 | case CHIP_RV740: |
394 | case CHIP_RV740: |
363 | // rdev->asic = &rv770_asic; |
395 | rdev->asic = &rv770_asic; |
364 | break; |
396 | break; |
365 | default: |
397 | default: |
366 | /* FIXME: not supported yet */ |
398 | /* FIXME: not supported yet */ |
367 | return -EINVAL; |
399 | return -EINVAL; |
368 | } |
400 | } |
Line 473... | Line 505... | ||
473 | 505 | ||
474 | void radeon_combios_fini(struct radeon_device *rdev) |
506 | void radeon_combios_fini(struct radeon_device *rdev) |
475 | { |
507 | { |
Line -... | Line 508... | ||
- | 508 | } |
|
- | 509 | ||
- | 510 | /* if we get transitioned to only one device, tak VGA back */ |
|
476 | } |
511 | static unsigned int radeon_vga_set_decode(void *cookie, bool state) |
477 | 512 | { |
|
- | 513 | struct radeon_device *rdev = cookie; |
|
- | 514 | radeon_vga_set_state(rdev, state); |
|
- | 515 | if (state) |
|
- | 516 | return VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM | |
|
- | 517 | VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM; |
|
- | 518 | else |
|
Line 478... | Line 519... | ||
478 | int radeon_modeset_init(struct radeon_device *rdev); |
519 | return VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM; |
479 | void radeon_modeset_fini(struct radeon_device *rdev); |
520 | } |
480 | 521 | ||
481 | void radeon_agp_disable(struct radeon_device *rdev) |
522 | void radeon_agp_disable(struct radeon_device *rdev) |
Line 607... | Line 648... | ||
607 | 648 | ||
608 | static struct pci_device_id pciidlist[] = { |
649 | static struct pci_device_id pciidlist[] = { |
609 | radeon_PCI_IDS |
650 | radeon_PCI_IDS |
Line -... | Line 651... | ||
- | 651 | }; |
|
- | 652 | ||
Line 610... | Line 653... | ||
610 | }; |
653 | mode_t usermode; |
611 | 654 | char log[256]; |
|
612 | 655 | ||
Line 619... | Line 662... | ||
619 | u32_t retval = 0; |
662 | u32_t retval = 0; |
Line 620... | Line 663... | ||
620 | 663 | ||
621 | if(action != 1) |
664 | if(action != 1) |
Line -... | Line 665... | ||
- | 665 | return 0; |
|
- | 666 | ||
- | 667 | if( cmdline && *cmdline ) |
|
622 | return 0; |
668 | parse_cmdline(cmdline, &usermode, log); |
623 | 669 | ||
- | 670 | if(!dbg_open(log)) |
|
- | 671 | { |
|
- | 672 | strcpy(log, "/rd/1/drivers/atikms.log"); |
|
- | 673 | ||
624 | if(!dbg_open("/hd0/2/atikms.log")) |
674 | if(!dbg_open(log)) |
625 | { |
675 | { |
- | 676 | printf("Can't open %s\nExit\n", log); |
|
626 | printf("Can't open /hd0/2/atikms.log\nExit\n"); |
677 | return 0; |
Line 627... | Line -... | ||
627 | return 0; |
- | |
628 | } |
- | |
629 | - | ||
630 | if(cmdline) |
678 | }; |
Line 631... | Line 679... | ||
631 | dbgprintf("cmdline: %s\n", cmdline); |
679 | } |
Line 632... | Line 680... | ||
632 | 680 | ||
Line 723... | Line 771... | ||
723 | 771 | ||
724 | dev->pdev = pdev; |
772 | dev->pdev = pdev; |
725 | dev->pci_device = pdev->device; |
773 | dev->pci_device = pdev->device; |
Line 726... | Line -... | ||
726 | dev->pci_vendor = pdev->vendor; |
- | |
727 | - | ||
728 | // if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
- | |
729 | // pci_set_drvdata(pdev, dev); |
- | |
730 | // ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL); |
- | |
731 | // if (ret) |
- | |
732 | // goto err_g2; |
- | |
733 | // } |
- | |
734 | - | ||
735 | // if ((ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY))) |
- | |
736 | // goto err_g3; |
- | |
737 | - | ||
738 | // if (dev->driver->load) { |
- | |
739 | // ret = dev->driver->load(dev, ent->driver_data); |
- | |
740 | // if (ret) |
- | |
741 | // goto err_g4; |
- | |
742 | // } |
774 | dev->pci_vendor = pdev->vendor; |
743 | 775 | ||
744 | ret = radeon_driver_load_kms(dev, ent->driver_data ); |
776 | ret = radeon_driver_load_kms(dev, ent->driver_data ); |
Line 745... | Line 777... | ||
745 | if (ret) |
777 | if (ret) |
Line 746... | Line 778... | ||
746 | goto err_g4; |
778 | goto err_g4; |
747 | 779 | ||
748 | // list_add_tail(&dev->driver_item, &driver->device_list); |
780 | // list_add_tail(&dev->driver_item, &driver->device_list); |
Line 749... | Line 781... | ||
749 | 781 | ||
750 | // DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", |
- | |
751 | // driver->name, driver->major, driver->minor, driver->patchlevel, |
- | |
Line 752... | Line 782... | ||
752 | // driver->date, pci_name(pdev), dev->primary->index); |
782 | // DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", |
Line 753... | Line 783... | ||
753 | 783 | // driver->name, driver->major, driver->minor, driver->patchlevel, |