diff options
author | Flora Cui <Flora.Cui@amd.com> | 2017-06-19 23:08:35 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-06-29 12:43:49 -0400 |
commit | dbfe85ea496728ccf7731601084853f760be77d7 (patch) | |
tree | 7029e2119b04924de3deb34f90dbb8e75f0ebfd8 /drivers/gpu/drm/amd/amdgpu | |
parent | 552c8f76afe7d24c1c1415ec951dea56d553d59c (diff) |
drm/amdgpu: Fix the exported always on CU bitmap
Newer asics with 4 SEs are not able to fit the entire bitmask in the
original field, use an array instead.
v2: keep cu_ao_mask for backward compatibility.
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 |
7 files changed, 21 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 12d61edb3597..ea8242e6a2f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1028,12 +1028,15 @@ struct amdgpu_gfx_config { | |||
1028 | }; | 1028 | }; |
1029 | 1029 | ||
1030 | struct amdgpu_cu_info { | 1030 | struct amdgpu_cu_info { |
1031 | uint32_t number; /* total active CU number */ | ||
1032 | uint32_t ao_cu_mask; | ||
1033 | uint32_t max_waves_per_simd; | 1031 | uint32_t max_waves_per_simd; |
1034 | uint32_t wave_front_size; | 1032 | uint32_t wave_front_size; |
1035 | uint32_t max_scratch_slots_per_cu; | 1033 | uint32_t max_scratch_slots_per_cu; |
1036 | uint32_t lds_size; | 1034 | uint32_t lds_size; |
1035 | |||
1036 | /* total active CU number */ | ||
1037 | uint32_t number; | ||
1038 | uint32_t ao_cu_mask; | ||
1039 | uint32_t ao_cu_bitmap[4][4]; | ||
1037 | uint32_t bitmap[4][4]; | 1040 | uint32_t bitmap[4][4]; |
1038 | }; | 1041 | }; |
1039 | 1042 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 3e5d550c5bd0..aef43b5334af 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -67,9 +67,10 @@ | |||
67 | * - 3.15.0 - Export more gpu info for gfx9 | 67 | * - 3.15.0 - Export more gpu info for gfx9 |
68 | * - 3.16.0 - Add reserved vmid support | 68 | * - 3.16.0 - Add reserved vmid support |
69 | * - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS. | 69 | * - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS. |
70 | * - 3.18.0 - Export gpu always on cu bitmap | ||
70 | */ | 71 | */ |
71 | #define KMS_DRIVER_MAJOR 3 | 72 | #define KMS_DRIVER_MAJOR 3 |
72 | #define KMS_DRIVER_MINOR 17 | 73 | #define KMS_DRIVER_MINOR 18 |
73 | #define KMS_DRIVER_PATCHLEVEL 0 | 74 | #define KMS_DRIVER_PATCHLEVEL 0 |
74 | 75 | ||
75 | int amdgpu_vram_limit = 0; | 76 | int amdgpu_vram_limit = 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 12497a40ef92..b0b23101d1c8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -594,6 +594,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
594 | dev_info.cu_active_number = adev->gfx.cu_info.number; | 594 | dev_info.cu_active_number = adev->gfx.cu_info.number; |
595 | dev_info.cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; | 595 | dev_info.cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; |
596 | dev_info.ce_ram_size = adev->gfx.ce_ram_size; | 596 | dev_info.ce_ram_size = adev->gfx.ce_ram_size; |
597 | memcpy(&dev_info.cu_ao_bitmap[0], &adev->gfx.cu_info.ao_cu_bitmap[0], | ||
598 | sizeof(adev->gfx.cu_info.ao_cu_bitmap)); | ||
597 | memcpy(&dev_info.cu_bitmap[0], &adev->gfx.cu_info.bitmap[0], | 599 | memcpy(&dev_info.cu_bitmap[0], &adev->gfx.cu_info.bitmap[0], |
598 | sizeof(adev->gfx.cu_info.bitmap)); | 600 | sizeof(adev->gfx.cu_info.bitmap)); |
599 | dev_info.vram_type = adev->mc.vram_type; | 601 | dev_info.vram_type = adev->mc.vram_type; |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c index 7b0b3cf16334..5173ca1fd159 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | |||
@@ -3535,7 +3535,9 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev) | |||
3535 | mask <<= 1; | 3535 | mask <<= 1; |
3536 | } | 3536 | } |
3537 | active_cu_number += counter; | 3537 | active_cu_number += counter; |
3538 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | 3538 | if (i < 2 && j < 2) |
3539 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | ||
3540 | cu_info->ao_cu_bitmap[i][j] = ao_bitmap; | ||
3539 | } | 3541 | } |
3540 | } | 3542 | } |
3541 | 3543 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index ec754288f146..37b45e4403d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -5427,7 +5427,9 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev) | |||
5427 | mask <<= 1; | 5427 | mask <<= 1; |
5428 | } | 5428 | } |
5429 | active_cu_number += counter; | 5429 | active_cu_number += counter; |
5430 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | 5430 | if (i < 2 && j < 2) |
5431 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | ||
5432 | cu_info->ao_cu_bitmap[i][j] = ao_bitmap; | ||
5431 | } | 5433 | } |
5432 | } | 5434 | } |
5433 | gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); | 5435 | gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 9a268272d38e..a1ef7f6307b9 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -7087,7 +7087,9 @@ static void gfx_v8_0_get_cu_info(struct amdgpu_device *adev) | |||
7087 | mask <<= 1; | 7087 | mask <<= 1; |
7088 | } | 7088 | } |
7089 | active_cu_number += counter; | 7089 | active_cu_number += counter; |
7090 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | 7090 | if (i < 2 && j < 2) |
7091 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | ||
7092 | cu_info->ao_cu_bitmap[i][j] = ao_bitmap; | ||
7091 | } | 7093 | } |
7092 | } | 7094 | } |
7093 | gfx_v8_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); | 7095 | gfx_v8_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 209bf0188e06..2e6f203fab9e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -4459,7 +4459,9 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev, | |||
4459 | mask <<= 1; | 4459 | mask <<= 1; |
4460 | } | 4460 | } |
4461 | active_cu_number += counter; | 4461 | active_cu_number += counter; |
4462 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | 4462 | if (i < 2 && j < 2) |
4463 | ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); | ||
4464 | cu_info->ao_cu_bitmap[i][j] = ao_bitmap; | ||
4463 | } | 4465 | } |
4464 | } | 4466 | } |
4465 | gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); | 4467 | gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); |