drm/amdgpu: set adev->num_vmhubs for gmc6,7,8

Submitted by Alex Deucher on Aug. 23, 2019, 2:45 p.m.

Details

Message ID 20190823144514.21354-1-alexander.deucher@amd.com
State New
Headers show
Series "drm/amdgpu: set adev->num_vmhubs for gmc6,7,8" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Alex Deucher Aug. 23, 2019, 2:45 p.m.
So that we properly handle them on older asics.

Fixes: 3ff985485b29 ("drm/amdgpu: Export function to flush TLB of specific vm hub")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 ++
 3 files changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index 564fb1ce292f..3264548e375c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -839,6 +839,8 @@  static int gmc_v6_0_sw_init(void *handle)
 	int dma_bits;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	adev->num_vmhubs = 1;
+
 	if (adev->flags & AMD_IS_APU) {
 		adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
 	} else {
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 9e6a23304fd7..cc0aa178eb2d 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -959,6 +959,8 @@  static int gmc_v7_0_sw_init(void *handle)
 	int dma_bits;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	adev->num_vmhubs = 1;
+
 	if (adev->flags & AMD_IS_APU) {
 		adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
 	} else {
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index f7d6a07ba4e1..88f3a171452f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -1079,6 +1079,8 @@  static int gmc_v8_0_sw_init(void *handle)
 	int dma_bits;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	adev->num_vmhubs = 1;
+
 	if (adev->flags & AMD_IS_APU) {
 		adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
 	} else {

Comments

Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com>

BR,
Xiaojie

> On Aug 23, 2019, at 10:45 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> 
> So that we properly handle them on older asics.
> 
> Fixes: 3ff985485b29 ("drm/amdgpu: Export function to flush TLB of specific vm hub")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++
> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 ++
> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 ++
> 3 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> index 564fb1ce292f..3264548e375c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> @@ -839,6 +839,8 @@ static int gmc_v6_0_sw_init(void *handle)
>    int dma_bits;
>    struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> 
> +    adev->num_vmhubs = 1;
> +
>    if (adev->flags & AMD_IS_APU) {
>        adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>    } else {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index 9e6a23304fd7..cc0aa178eb2d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -959,6 +959,8 @@ static int gmc_v7_0_sw_init(void *handle)
>    int dma_bits;
>    struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> 
> +    adev->num_vmhubs = 1;
> +
>    if (adev->flags & AMD_IS_APU) {
>        adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>    } else {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index f7d6a07ba4e1..88f3a171452f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -1079,6 +1079,8 @@ static int gmc_v8_0_sw_init(void *handle)
>    int dma_bits;
>    struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> 
> +    adev->num_vmhubs = 1;
> +
>    if (adev->flags & AMD_IS_APU) {
>        adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>    } else {
> -- 
> 2.20.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by: Christian König <christian.koenig@amd.com>

Am 23.08.19 um 17:21 schrieb Yuan, Xiaojie:
> Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
>
> BR,
> Xiaojie
>
>> On Aug 23, 2019, at 10:45 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
>>
>> So that we properly handle them on older asics.
>>
>> Fixes: 3ff985485b29 ("drm/amdgpu: Export function to flush TLB of specific vm hub")
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++
>> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 ++
>> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 ++
>> 3 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> index 564fb1ce292f..3264548e375c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> @@ -839,6 +839,8 @@ static int gmc_v6_0_sw_init(void *handle)
>>     int dma_bits;
>>     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>
>> +    adev->num_vmhubs = 1;
>> +
>>     if (adev->flags & AMD_IS_APU) {
>>         adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>>     } else {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> index 9e6a23304fd7..cc0aa178eb2d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> @@ -959,6 +959,8 @@ static int gmc_v7_0_sw_init(void *handle)
>>     int dma_bits;
>>     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>
>> +    adev->num_vmhubs = 1;
>> +
>>     if (adev->flags & AMD_IS_APU) {
>>         adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>>     } else {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> index f7d6a07ba4e1..88f3a171452f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> @@ -1079,6 +1079,8 @@ static int gmc_v8_0_sw_init(void *handle)
>>     int dma_bits;
>>     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>
>> +    adev->num_vmhubs = 1;
>> +
>>     if (adev->flags & AMD_IS_APU) {
>>         adev->gmc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
>>     } else {
>> -- 
>> 2.20.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx