summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_kms.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 58876bb4ef2a..0473583dcdac 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -32,7 +32,6 @@
#include <linux/uaccess.h>
#include <linux/vga_switcheroo.h>
-#include <drm/drm_agpsupport.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
@@ -80,10 +79,10 @@ void radeon_driver_unload_kms(struct drm_device *dev)
radeon_modeset_fini(rdev);
radeon_device_fini(rdev);
- if (dev->agp)
- arch_phys_wc_del(dev->agp->agp_mtrr);
- kfree(dev->agp);
- dev->agp = NULL;
+ if (rdev->agp)
+ arch_phys_wc_del(rdev->agp->agp_mtrr);
+ kfree(rdev->agp);
+ rdev->agp = NULL;
done_free:
kfree(rdev);
@@ -119,6 +118,15 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
rdev->hose = pdev->sysdata;
#endif
+ if (pci_find_capability(pdev, PCI_CAP_ID_AGP))
+ rdev->agp = radeon_agp_head_init(rdev->ddev);
+ if (rdev->agp) {
+ rdev->agp->agp_mtrr = arch_phys_wc_add(
+ rdev->agp->agp_info.aper_base,
+ rdev->agp->agp_info.aper_size *
+ 1024 * 1024);
+ }
+
/* update BUS flag */
if (pci_find_capability(pdev, PCI_CAP_ID_AGP)) {
flags |= RADEON_IS_AGP;