Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 14:21:54 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259101 - head/sys/dev/drm2/radeon
Message-ID:  <201312081421.rB8ELsTt001076@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Dec  8 14:21:54 2013
New Revision: 259101
URL: http://svnweb.freebsd.org/changeset/base/259101

Log:
  drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes
  
  This fixes radeon_agp_init() and gtt_size is now correct. However, this
  is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't
  implemented yet.
  
  Submitted by:	tijl@

Modified:
  head/sys/dev/drm2/radeon/radeon_agp.c

Modified: head/sys/dev/drm2/radeon/radeon_agp.c
==============================================================================
--- head/sys/dev/drm2/radeon/radeon_agp.c	Sun Dec  8 13:56:26 2013	(r259100)
+++ head/sys/dev/drm2/radeon/radeon_agp.c	Sun Dec  8 14:21:54 2013	(r259101)
@@ -153,11 +153,11 @@ int radeon_agp_init(struct radeon_device
 		return ret;
 	}
 
-	if (rdev->ddev->agp->info.ai_aperture_size < 32) {
+	if ((rdev->ddev->agp->info.ai_aperture_size >> 20) < 32) {
 		drm_agp_release(rdev->ddev);
 		dev_warn(rdev->dev, "AGP aperture too small (%zuM) "
 			"need at least 32M, disabling AGP\n",
-			rdev->ddev->agp->info.ai_aperture_size);
+			rdev->ddev->agp->info.ai_aperture_size >> 20);
 		return -EINVAL;
 	}
 
@@ -246,7 +246,7 @@ int radeon_agp_init(struct radeon_device
 	}
 
 	rdev->mc.agp_base = rdev->ddev->agp->info.ai_aperture_base;
-	rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size << 20;
+	rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size;
 	rdev->mc.gtt_start = rdev->mc.agp_base;
 	rdev->mc.gtt_end = rdev->mc.gtt_start + rdev->mc.gtt_size - 1;
 	dev_info(rdev->dev, "GTT: %juM 0x%08jX - 0x%08jX\n",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312081421.rB8ELsTt001076>