|
37 | 37 | #include <linux/vga_switcheroo.h>
|
38 | 38 | #include <linux/mmu_notifier.h>
|
39 | 39 |
|
| 40 | +#include <drm/drm_agpsupport.h> |
40 | 41 | #include <drm/drm_crtc_helper.h>
|
41 | 42 | #include <drm/drm_drv.h>
|
42 | 43 | #include <drm/drm_fb_helper.h>
|
@@ -325,6 +326,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
|
325 | 326 | const struct pci_device_id *ent)
|
326 | 327 | {
|
327 | 328 | unsigned long flags = 0;
|
| 329 | + struct drm_device *dev; |
328 | 330 | int ret;
|
329 | 331 |
|
330 | 332 | if (!ent)
|
@@ -365,7 +367,44 @@ static int radeon_pci_probe(struct pci_dev *pdev,
|
365 | 367 | if (ret)
|
366 | 368 | return ret;
|
367 | 369 |
|
368 |
| - return drm_get_pci_dev(pdev, ent, &kms_driver); |
| 370 | + dev = drm_dev_alloc(&kms_driver, &pdev->dev); |
| 371 | + if (IS_ERR(dev)) |
| 372 | + return PTR_ERR(dev); |
| 373 | + |
| 374 | + ret = pci_enable_device(pdev); |
| 375 | + if (ret) |
| 376 | + goto err_free; |
| 377 | + |
| 378 | + dev->pdev = pdev; |
| 379 | +#ifdef __alpha__ |
| 380 | + dev->hose = pdev->sysdata; |
| 381 | +#endif |
| 382 | + |
| 383 | + pci_set_drvdata(pdev, dev); |
| 384 | + |
| 385 | + if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) |
| 386 | + dev->agp = drm_agp_init(dev); |
| 387 | + if (dev->agp) { |
| 388 | + dev->agp->agp_mtrr = arch_phys_wc_add( |
| 389 | + dev->agp->agp_info.aper_base, |
| 390 | + dev->agp->agp_info.aper_size * |
| 391 | + 1024 * 1024); |
| 392 | + } |
| 393 | + |
| 394 | + ret = drm_dev_register(dev, ent->driver_data); |
| 395 | + if (ret) |
| 396 | + goto err_agp; |
| 397 | + |
| 398 | + return 0; |
| 399 | + |
| 400 | +err_agp: |
| 401 | + if (dev->agp) |
| 402 | + arch_phys_wc_del(dev->agp->agp_mtrr); |
| 403 | + kfree(dev->agp); |
| 404 | + pci_disable_device(pdev); |
| 405 | +err_free: |
| 406 | + drm_dev_put(dev); |
| 407 | + return ret; |
369 | 408 | }
|
370 | 409 |
|
371 | 410 | static void
|
@@ -575,7 +614,7 @@ radeon_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
|
575 | 614 |
|
576 | 615 | static struct drm_driver kms_driver = {
|
577 | 616 | .driver_features =
|
578 |
| - DRIVER_USE_AGP | DRIVER_GEM | DRIVER_RENDER, |
| 617 | + DRIVER_GEM | DRIVER_RENDER, |
579 | 618 | .load = radeon_driver_load_kms,
|
580 | 619 | .open = radeon_driver_open_kms,
|
581 | 620 | .postclose = radeon_driver_postclose_kms,
|
|
0 commit comments