diff mbox

drm/radeon: Make vramlimit parameter actually work.

Message ID 1313767459-7796-3-git-send-email-michel@daenzer.net (mailing list archive)
State Accepted
Headers show

Commit Message

Michel Dänzer Aug. 19, 2011, 3:24 p.m. UTC
From: Michel Dänzer <michel.daenzer@amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/radeon/radeon_device.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Alex Deucher Aug. 19, 2011, 6:57 p.m. UTC | #1
2011/8/19 Michel Dänzer <michel@daenzer.net>:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/radeon/radeon_device.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 7cfaa7e..f67d719 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -300,6 +300,8 @@ void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64
>                mc->mc_vram_size = mc->aper_size;
>        }
>        mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
> +       if (radeon_vram_limit && radeon_vram_limit < mc->real_vram_size)
> +               mc->real_vram_size = radeon_vram_limit;
>        dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n",
>                        mc->mc_vram_size >> 20, mc->vram_start,
>                        mc->vram_end, mc->real_vram_size >> 20);
> --
> 1.7.5.4
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 7cfaa7e..f67d719 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -300,6 +300,8 @@  void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64
 		mc->mc_vram_size = mc->aper_size;
 	}
 	mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
+	if (radeon_vram_limit && radeon_vram_limit < mc->real_vram_size)
+		mc->real_vram_size = radeon_vram_limit;
 	dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n",
 			mc->mc_vram_size >> 20, mc->vram_start,
 			mc->vram_end, mc->real_vram_size >> 20);