drm/radeon/kms: resume AGP by calling init.
authorDave Airlie <airlied@redhat.com>
Thu, 5 Nov 2009 05:39:10 +0000 (15:39 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 24 Nov 2009 03:01:47 +0000 (13:01 +1000)
AGP resume was broken since we moved to the new init path,
because we never re-enabled AGP on these systems at resume time.

This patch just calls the AGP resume call which just does the reinit
at resume time like the old path did.

Since AGP is pretty much gpu independant I did it outside
the gpu specific code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_agp.c
drivers/gpu/drm/radeon/radeon_device.c

index 757f5cd37744cc40163338a121c7ae2b4abc6467..224506a2f7b1ae6d53d5b68347a4a7889a262a2c 100644 (file)
@@ -519,6 +519,7 @@ typedef int (*radeon_packet3_check_t)(struct radeon_cs_parser *p,
  * AGP
  */
 int radeon_agp_init(struct radeon_device *rdev);
+void radeon_agp_resume(struct radeon_device *rdev);
 void radeon_agp_fini(struct radeon_device *rdev);
 
 
index 23ea9955ac596f28423fb28781e76a975e7c3995..54bf49a6d676b6a53c1e301ec5db855d2cf7f4fb 100644 (file)
@@ -237,6 +237,18 @@ int radeon_agp_init(struct radeon_device *rdev)
 #endif
 }
 
+void radeon_agp_resume(struct radeon_device *rdev)
+{
+#if __OS_HAS_AGP
+       int r;
+       if (rdev->flags & RADEON_IS_AGP) {
+               r = radeon_agp_init(rdev);
+               if (r)
+                       dev_warn(rdev->dev, "radeon AGP reinit failed\n");
+       }
+#endif
+}
+
 void radeon_agp_fini(struct radeon_device *rdev)
 {
 #if __OS_HAS_AGP
index e3f9edfa40fe8a5d63b64eee70e91345c4a1bd7b..41bb76fbe734f282dadbfee6d70ba1e046e6ecee 100644 (file)
@@ -688,6 +688,8 @@ int radeon_resume_kms(struct drm_device *dev)
                return -1;
        }
        pci_set_master(dev->pdev);
+       /* resume AGP if in use */
+       radeon_agp_resume(rdev);
        radeon_resume(rdev);
        radeon_restore_bios_scratch_regs(rdev);
        fb_set_suspend(rdev->fbdev_info, 0);