All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] drm/radeon/kms: move mtrr range add and memory information
@ 2009-09-10 19:47 Jerome Glisse
  2009-09-11  5:52 ` Dave Airlie
  0 siblings, 1 reply; 2+ messages in thread
From: Jerome Glisse @ 2009-09-10 19:47 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, Jerome Glisse

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.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
---
 drivers/gpu/drm/radeon/radeon.h        |   10 ++++++++++
 drivers/gpu/drm/radeon/radeon_device.c |    8 --------
 drivers/gpu/drm/radeon/radeon_object.c |    7 +++++++
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 23ede0e..8cb2b81 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -892,6 +892,16 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
 
 
 /*
+ * Printing helpers
+ */
+#define PINF(s, arg...) printk(KERN_INFO "radeon " s, ##arg)
+#define PWRN(s, arg...) \
+	printk(KERN_WARNING "radeon (WR:%s:%d) " s, __FILE__, __LINE__, ##arg)
+#define PERR(s, arg...) \
+	printk(KERN_ERR "radeon (ER:%s:%d) " s, __FILE__, __LINE__, ##arg)
+
+
+/*
  * ASICs macro.
  */
 #define radeon_init(rdev) (rdev)->asic->init((rdev))
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 72f6262..07ef8b6 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -598,14 +598,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) {
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index b85fb83..0100b3b 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -369,6 +369,13 @@ 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);
+	PINF("Detected VRAM RAM=%lluM, BAR=%lluM\n",
+		rdev->mc.mc_vram_size >> 20, rdev->mc.aper_size >> 20);
+	PINF("RAM width %dbits %cDR\n",
+			rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
 	return radeon_ttm_init(rdev);
 }
 
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] drm/radeon/kms: move mtrr range add and memory information
  2009-09-10 19:47 [PATCH 2/3] drm/radeon/kms: move mtrr range add and memory information Jerome Glisse
@ 2009-09-11  5:52 ` Dave Airlie
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Airlie @ 2009-09-11  5:52 UTC (permalink / raw)
  To: Jerome Glisse; +Cc: airlied, linux-kernel, dri-devel

>  
>  /*
> + * Printing helpers
> + */
> +#define PINF(s, arg...) printk(KERN_INFO "radeon " s, ##arg)
> +#define PWRN(s, arg...) \
> +	printk(KERN_WARNING "radeon (WR:%s:%d) " s, __FILE__, __LINE__, ##arg)
> +#define PERR(s, arg...) \
> +	printk(KERN_ERR "radeon (ER:%s:%d) " s, __FILE__, __LINE__, ##arg)
> +

eh? no.

No more printf wrappers please, use DRM_*, or make them better,
or use drv_* or make them better.

but no sneaking stuff like this in a patch that doesn't mention it
introduces printf wrapping.

Dave.

> +
> +/*
>   * ASICs macro.
>   */
>  #define radeon_init(rdev) (rdev)->asic->init((rdev))
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 72f6262..07ef8b6 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -598,14 +598,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) {
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index b85fb83..0100b3b 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -369,6 +369,13 @@ 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);
> +	PINF("Detected VRAM RAM=%lluM, BAR=%lluM\n",
> +		rdev->mc.mc_vram_size >> 20, rdev->mc.aper_size >> 20);
> +	PINF("RAM width %dbits %cDR\n",
> +			rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
>  	return radeon_ttm_init(rdev);
>  }
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-11  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10 19:47 [PATCH 2/3] drm/radeon/kms: move mtrr range add and memory information Jerome Glisse
2009-09-11  5:52 ` Dave Airlie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.