drm/radeon/kms: move mtrr range add and memory information
authorJerome Glisse <jglisse@redhat.com>
Fri, 11 Sep 2009 11:00:43 +0000 (13:00 +0200)
committerDave Airlie <airlied@redhat.com>
Mon, 14 Sep 2009 06:10:00 +0000 (16:10 +1000)
Move mtrr range and memory information printing to radeon_object_init,
this are memory information and initialization common to all GPU and
they better fit in this function. Will also prevent code duplication
with upcoming init path changes.

airlied: fixed warning introduced

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_object.c

index 633acf71400bd26fc47e56c4e5a9f75de8e5ec9c..ece097c3e079f8ed84cbcee2585cab3a42dbe48d 100644 (file)
@@ -604,14 +604,6 @@ int radeon_device_init(struct radeon_device *rdev,
                /* Get vram informations */
                radeon_vram_info(rdev);
 
-               /* Add an MTRR for the VRAM */
-               rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size,
-                               MTRR_TYPE_WRCOMB, 1);
-               DRM_INFO("Detected VRAM RAM=%uM, BAR=%uM\n",
-                               (unsigned)(rdev->mc.mc_vram_size >> 20),
-                               (unsigned)(rdev->mc.aper_size >> 20));
-               DRM_INFO("RAM width %dbits %cDR\n",
-                               rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
                /* Initialize memory controller (also test AGP) */
                r = radeon_mc_init(rdev);
                if (r) {
index b85fb83d7ae84610f77a031ff1cdb53bfc0e099f..1500d5bc7af55f1424495188704036c93706f2ce 100644 (file)
@@ -369,6 +369,14 @@ void radeon_object_force_delete(struct radeon_device *rdev)
 
 int radeon_object_init(struct radeon_device *rdev)
 {
+       /* Add an MTRR for the VRAM */
+       rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size,
+                       MTRR_TYPE_WRCOMB, 1);
+       DRM_INFO("Detected VRAM RAM=%lluM, BAR=%lluM\n",
+               rdev->mc.mc_vram_size >> 20,
+               (unsigned long long)rdev->mc.aper_size >> 20);
+       DRM_INFO("RAM width %dbits %cDR\n",
+                       rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
        return radeon_ttm_init(rdev);
 }