Re: [PATCH] drm/radeon: let's use GB for vm_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 18, 2014 at 12:10 PM, Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
> On Fri, Jul 18, 2014 at 7:56 AM, Christian König
> <deathsimple@xxxxxxxxxxx> wrote:
>> From: Christian König <christian.koenig@xxxxxxx>
>>
>> VM sizes smaller than 1GB doesn't make much sense anyway.
>>
>> Signed-off-by: Christian König <christian.koenig@xxxxxxx>
>
> Applied to my 3.16 tree.

Actually there was a small typo.  I applied the attached version instead.

Alex

>
> Alex
>
>> ---
>>  drivers/gpu/drm/radeon/radeon_device.c | 14 +++++++-------
>>  drivers/gpu/drm/radeon/radeon_drv.c    |  4 ++--
>>  2 files changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
>> index 03686fa..a8537d7 100644
>> --- a/drivers/gpu/drm/radeon/radeon_device.c
>> +++ b/drivers/gpu/drm/radeon/radeon_device.c
>> @@ -1056,22 +1056,22 @@ static void radeon_check_arguments(struct radeon_device *rdev)
>>         if (!radeon_check_pot_argument(radeon_vm_size)) {
>>                 dev_warn(rdev->dev, "VM size (%d) must be a power of 2\n",
>>                          radeon_vm_size);
>> -               radeon_vm_size = 4096;
>> +               radeon_vm_size = 4;
>>         }
>>
>> -       if (radeon_vm_size < 4) {
>> -               dev_warn(rdev->dev, "VM size (%d) to small, min is 4MB\n",
>> +       if (radeon_vm_size < 1) {
>> +               dev_warn(rdev->dev, "VM size (%d) to small, min is 1GB\n",
>>                          radeon_vm_size);
>> -               radeon_vm_size = 4096;
>> +               radeon_vm_size = 4;
>>         }
>>
>>         /*
>>          * Max GPUVM size for Cayman, SI and CI are 40 bits.
>>          */
>> -       if (radeon_vm_size > 1024*1024) {
>> +       if (radeon_vm_size > 1024) {
>>                 dev_warn(rdev->dev, "VM size (%d) to large, max is 1TB\n",
>>                          radeon_vm_size);
>> -               radeon_vm_size = 4096;
>> +               radeon_vm_size = 4;
>>         }
>>
>>         /* defines number of bits in page table versus page directory,
>> @@ -1238,7 +1238,7 @@ int radeon_device_init(struct radeon_device *rdev,
>>         /* Adjust VM size here.
>>          * Max GPUVM size for cayman+ is 40 bits.
>>          */
>> -       rdev->vm_manager.max_pfn = radeon_vm_size << 8;
>> +       rdev->vm_manager.max_pfn = radeon_vm_size << 18;
>>
>>         /* Set asic functions */
>>         r = radeon_asic_init(rdev);
>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
>> index cb14213..e9e3610 100644
>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>> @@ -173,7 +173,7 @@ int radeon_dpm = -1;
>>  int radeon_aspm = -1;
>>  int radeon_runtime_pm = -1;
>>  int radeon_hard_reset = 0;
>> -int radeon_vm_size = 4096;
>> +int radeon_vm_size = 4;
>>  int radeon_vm_block_size = 9;
>>  int radeon_deep_color = 0;
>>
>> @@ -243,7 +243,7 @@ module_param_named(runpm, radeon_runtime_pm, int, 0444);
>>  MODULE_PARM_DESC(hard_reset, "PCI config reset (1 = force enable, 0 = disable (default))");
>>  module_param_named(hard_reset, radeon_hard_reset, int, 0444);
>>
>> -MODULE_PARM_DESC(vm_size, "VM address space size in megabytes (default 4GB)");
>> +MODULE_PARM_DESC(vm_size, "VM address space size in gigabytes (default 4GB)");
>>  module_param_named(vm_size, radeon_vm_size, int, 0444);
>>
>>  MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)");
>> --
>> 1.9.1
>>
From 8f603354d1a6262ac60231cc62b09b4278ace180 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@xxxxxxx>
Date: Fri, 18 Jul 2014 13:56:56 +0200
Subject: [PATCH] drm/radeon: let's use GB for vm_size (v2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

VM sizes smaller than 1GB doesn't make much sense anyway.

v2: fix typo and grammer

Signed-off-by: Christian König <christian.koenig@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
 drivers/gpu/drm/radeon/radeon_device.c | 22 +++++++++++-----------
 drivers/gpu/drm/radeon/radeon_drv.c    |  4 ++--
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 03686fa..697add2 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1056,36 +1056,36 @@ static void radeon_check_arguments(struct radeon_device *rdev)
 	if (!radeon_check_pot_argument(radeon_vm_size)) {
 		dev_warn(rdev->dev, "VM size (%d) must be a power of 2\n",
 			 radeon_vm_size);
-		radeon_vm_size = 4096;
+		radeon_vm_size = 4;
 	}
 
-	if (radeon_vm_size < 4) {
-		dev_warn(rdev->dev, "VM size (%d) to small, min is 4MB\n",
+	if (radeon_vm_size < 1) {
+		dev_warn(rdev->dev, "VM size (%d) to small, min is 1GB\n",
 			 radeon_vm_size);
-		radeon_vm_size = 4096;
+		radeon_vm_size = 4;
 	}
 
        /*
         * Max GPUVM size for Cayman, SI and CI are 40 bits.
         */
-	if (radeon_vm_size > 1024*1024) {
-		dev_warn(rdev->dev, "VM size (%d) to large, max is 1TB\n",
+	if (radeon_vm_size > 1024) {
+		dev_warn(rdev->dev, "VM size (%d) too large, max is 1TB\n",
 			 radeon_vm_size);
-		radeon_vm_size = 4096;
+		radeon_vm_size = 4;
 	}
 
 	/* defines number of bits in page table versus page directory,
 	 * a page is 4KB so we have 12 bits offset, minimum 9 bits in the
 	 * page table and the remaining bits are in the page directory */
 	if (radeon_vm_block_size < 9) {
-		dev_warn(rdev->dev, "VM page table size (%d) to small\n",
+		dev_warn(rdev->dev, "VM page table size (%d) too small\n",
 			 radeon_vm_block_size);
 		radeon_vm_block_size = 9;
 	}
 
 	if (radeon_vm_block_size > 24 ||
-	    radeon_vm_size < (1ull << radeon_vm_block_size)) {
-		dev_warn(rdev->dev, "VM page table size (%d) to large\n",
+	    (radeon_vm_size * 1024) < (1ull << radeon_vm_block_size)) {
+		dev_warn(rdev->dev, "VM page table size (%d) too large\n",
 			 radeon_vm_block_size);
 		radeon_vm_block_size = 9;
 	}
@@ -1238,7 +1238,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	/* Adjust VM size here.
 	 * Max GPUVM size for cayman+ is 40 bits.
 	 */
-	rdev->vm_manager.max_pfn = radeon_vm_size << 8;
+	rdev->vm_manager.max_pfn = radeon_vm_size << 18;
 
 	/* Set asic functions */
 	r = radeon_asic_init(rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index cb14213..e9e3610 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -173,7 +173,7 @@ int radeon_dpm = -1;
 int radeon_aspm = -1;
 int radeon_runtime_pm = -1;
 int radeon_hard_reset = 0;
-int radeon_vm_size = 4096;
+int radeon_vm_size = 4;
 int radeon_vm_block_size = 9;
 int radeon_deep_color = 0;
 
@@ -243,7 +243,7 @@ module_param_named(runpm, radeon_runtime_pm, int, 0444);
 MODULE_PARM_DESC(hard_reset, "PCI config reset (1 = force enable, 0 = disable (default))");
 module_param_named(hard_reset, radeon_hard_reset, int, 0444);
 
-MODULE_PARM_DESC(vm_size, "VM address space size in megabytes (default 4GB)");
+MODULE_PARM_DESC(vm_size, "VM address space size in gigabytes (default 4GB)");
 module_param_named(vm_size, radeon_vm_size, int, 0444);
 
 MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)");
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux