drm/amdkfd: Delete the VF device info usage
Subsystems (3)
PATCH 1/2 drm/amdkfd: Delete the VF device info usage
The VF device info should be the same as the regular one.
Change-Id Ia3f8e1deac10af57fef59e35e39353e809f52d5d
Signed-off-by Yong Zhao <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 58 ++----------------------- 1 file changed, 3 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -55
@@ -146,24 +146,6 @@ static const struct kfd_device_info fiji_device_info = { .num_sdma_queues_per_engine = 2, }; -static const struct kfd_device_info fiji_vf_device_info = { - .asic_family =CHIP_FIJI , - .max_pasid_bits =16 , - .max_no_of_hqd =24 , - .doorbell_size =4 , - .ih_ring_entry_size =4 *sizeof (uint32_t ), - .event_interrupt_class = &event_interrupt_class_cik, - .num_of_watch_points =4 , - .mqd_size_aligned =MQD_SIZE_ALIGNED , - .supports_cwsr = true, - .needs_iommu_device = false, - .needs_pci_atomics = false, - .num_sdma_engines =2 , - .num_xgmi_sdma_engines =0 , - .num_sdma_queues_per_engine =2 , -}; - -static const struct kfd_device_info polaris10_device_info = { .asic_family =CHIP_POLARIS10 , .max_pasid_bits =16 ,
@@ -181,23 +163,6 @@ static const struct kfd_device_info polaris10_device_info = { .num_sdma_queues_per_engine = 2, }; -static const struct kfd_device_info polaris10_vf_device_info = { - .asic_family =CHIP_POLARIS10 , - .max_pasid_bits =16 , - .max_no_of_hqd =24 , - .doorbell_size =4 , - .ih_ring_entry_size =4 *sizeof (uint32_t ), - .event_interrupt_class = &event_interrupt_class_cik, - .num_of_watch_points =4 , - .mqd_size_aligned =MQD_SIZE_ALIGNED , - .supports_cwsr = true, - .needs_iommu_device = false, - .needs_pci_atomics = false, - .num_sdma_engines =2 , - .num_xgmi_sdma_engines =0 , - .num_sdma_queues_per_engine =2 , -}; -static const struct kfd_device_info polaris11_device_info = { .asic_family =CHIP_POLARIS11 , .max_pasid_bits =16 ,
@@ -266,23 +231,6 @@ static const struct kfd_device_info vega10_device_info = { .num_sdma_queues_per_engine = 2, }; -static const struct kfd_device_info vega10_vf_device_info = { - .asic_family =CHIP_VEGA10 , - .max_pasid_bits =16 , - .max_no_of_hqd =24 , - .doorbell_size =8 , - .ih_ring_entry_size =8 *sizeof (uint32_t ), - .event_interrupt_class = &event_interrupt_class_v9, - .num_of_watch_points =4 , - .mqd_size_aligned =MQD_SIZE_ALIGNED , - .supports_cwsr = true, - .needs_iommu_device = false, - .needs_pci_atomics = false, - .num_sdma_engines =2 , - .num_xgmi_sdma_engines =0 , - .num_sdma_queues_per_engine =2 , -}; -static const struct kfd_device_info vega12_device_info = { .asic_family =CHIP_VEGA12 , .max_pasid_bits =16 ,
@@ -408,7 +356,7 @@ static const struct kfd_deviceid supported_devices[] = { { 0x6938, &tonga_device_info }, /* Tonga */ { 0x6939, &tonga_device_info }, /* Tonga */ { 0x7300, &fiji_device_info }, /* Fiji */ - { 0x730F, &fiji_vf_device_info }, /* Fiji vf*/ + { 0x730F, &fiji_device_info }, /* Fiji vf*/ { 0x67C0, &polaris10_device_info }, /* Polaris10 */ { 0x67C1, &polaris10_device_info }, /* Polaris10 */ { 0x67C2, &polaris10_device_info }, /* Polaris10 */
@@ -419,7 +367,7 @@ static const struct kfd_deviceid supported_devices[] = { { 0x67CA, &polaris10_device_info }, /* Polaris10 */ { 0x67CC, &polaris10_device_info }, /* Polaris10 */ { 0x67CF, &polaris10_device_info }, /* Polaris10 */ - { 0x67D0, &polaris10_vf_device_info }, /* Polaris10 vf*/ + { 0x67D0, &polaris10_device_info }, /* Polaris10 vf*/ { 0x67DF, &polaris10_device_info }, /* Polaris10 */ { 0x6FDF, &polaris10_device_info }, /* Polaris10 */ { 0x67E0, &polaris11_device_info }, /* Polaris11 */
@@ -452,7 +400,7 @@ static const struct kfd_deviceid supported_devices[] = { { 0x6869, &vega10_device_info }, /* Vega10 */ { 0x686A, &vega10_device_info }, /* Vega10 */ { 0x686B, &vega10_device_info }, /* Vega10 */ - { 0x686C, &vega10_vf_device_info }, /* Vega10 vf*/ + { 0x686C, &vega10_device_info }, /* Vega10 vf*/ { 0x686D, &vega10_device_info }, /* Vega10 */ { 0x686E, &vega10_device_info }, /* Vega10 */ { 0x686F, &vega10_device_info }, /* Vega10 */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 drm/amdkfd: Fill the name field in node topology with asic name
The name field in node topology has not been used. We re-purpose it to hold the asic name, which can be queried by user space applications through sysfs.
Change-Id I74f4f5487db169004a9d27ea15abe99261c86220
Signed-off-by Yong Zhao <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 15 +++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 16 ++++++---------- drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 4 ++-- 4 files changed, 24 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +15 -0
@@ -42,6 +42,7 @@ static atomic_t kfd_locked = ATOMIC_INIT(0);#ifdef KFD_SUPPORT_IOMMU_V2 static const struct kfd_device_info kaveri_device_info = { .asic_family =CHIP_KAVERI , + .asic_name ="kaveri" , .max_pasid_bits =16 ,/* max num of queues for KV.TODO should be a dynamic value */ .max_no_of_hqd = 24,
@@ -60,6 +61,7 @@ static const struct kfd_device_info kaveri_device_info = {static const struct kfd_device_info carrizo_device_info = { .asic_family =CHIP_CARRIZO , + .asic_name ="carrizo" , .max_pasid_bits =16 ,/* max num of queues for CZ.TODO should be a dynamic value */ .max_no_of_hqd =24 ,
@@ -78,6 +80,7 @@ static const struct kfd_device_info carrizo_device_info = {static const struct kfd_device_info raven_device_info = { .asic_family =CHIP_RAVEN , + .asic_name ="raven" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
@@ -96,6 +99,7 @@ static const struct kfd_device_info raven_device_info = {static const struct kfd_device_info hawaii_device_info = { .asic_family =CHIP_HAWAII , + .asic_name ="hawaii" , .max_pasid_bits =16 ,/* max num of queues for KV.TODO should be a dynamic value */ .max_no_of_hqd =24 ,
@@ -114,6 +118,7 @@ static const struct kfd_device_info hawaii_device_info = {static const struct kfd_device_info tonga_device_info = { .asic_family =CHIP_TONGA , + .asic_name ="tonga" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -131,6 +136,7 @@ static const struct kfd_device_info tonga_device_info = {static const struct kfd_device_info fiji_device_info = { .asic_family =CHIP_FIJI , + .asic_name ="fiji" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -148,6 +154,7 @@ static const struct kfd_device_info fiji_device_info = {static const struct kfd_device_info polaris10_device_info = { .asic_family =CHIP_POLARIS10 , + .asic_name ="polaris10" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -165,6 +172,7 @@ static const struct kfd_device_info polaris10_device_info = {static const struct kfd_device_info polaris11_device_info = { .asic_family =CHIP_POLARIS11 , + .asic_name ="polaris11" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -182,6 +190,7 @@ static const struct kfd_device_info polaris11_device_info = {static const struct kfd_device_info polaris12_device_info = { .asic_family =CHIP_POLARIS12 , + .asic_name ="polaris12" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -199,6 +208,7 @@ static const struct kfd_device_info polaris12_device_info = {static const struct kfd_device_info vegam_device_info = { .asic_family =CHIP_VEGAM , + .asic_name ="vegam" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =4 ,
@@ -216,6 +226,7 @@ static const struct kfd_device_info vegam_device_info = {static const struct kfd_device_info vega10_device_info = { .asic_family =CHIP_VEGA10 , + .asic_name ="vega10" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
@@ -233,6 +244,7 @@ static const struct kfd_device_info vega10_device_info = {static const struct kfd_device_info vega12_device_info = { .asic_family =CHIP_VEGA12 , + .asic_name ="vega12" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
@@ -250,6 +262,7 @@ static const struct kfd_device_info vega12_device_info = {static const struct kfd_device_info vega20_device_info = { .asic_family =CHIP_VEGA20 , + .asic_name ="vega20" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
@@ -267,6 +280,7 @@ static const struct kfd_device_info vega20_device_info = {static const struct kfd_device_info arcturus_device_info = { .asic_family =CHIP_ARCTURUS , + .asic_name ="arcturus" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
@@ -284,6 +298,7 @@ static const struct kfd_device_info arcturus_device_info = {static const struct kfd_device_info navi10_device_info = { .asic_family =CHIP_NAVI10 , + .asic_name ="navi10" , .max_pasid_bits =16 , .max_no_of_hqd =24 , .doorbell_size =8 ,
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
@@ -195,6 +195,7 @@ struct kfd_event_interrupt_class {struct kfd_device_info {enum amd_asic_type asic_family; +const char *asic_name;const struct kfd_event_interrupt_class *event_interrupt_class;unsigned int max_pasid_bits;unsigned int max_no_of_hqd;
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +6 -10
@@ -406,8 +406,6 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr, char *buffer) {struct kfd_topology_device *dev; -char public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE ]; -uint32_t i;uint32_t log_max_watch_addr;/* Making sure that the buffer is an empty string */
@@ -422,14 +420,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,if (strcmp (attr->name,"name" ) ==0 ) { dev = container_of(attr, struct kfd_topology_device, attr_name); -for (i =0 ; i <KFD_TOPOLOGY_PUBLIC_NAME_SIZE ; i++) { - public_name[i] = - (char )dev->node_props.marketing_name[i]; -if (dev->node_props.marketing_name[i] ==0 ) -break ; - } - public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE -1 ] =0x0 ; -return sysfs_show_str_val (buffer, public_name); + +return sysfs_show_str_val (buffer, dev->node_props.name); } dev = container_of(attr, struct kfd_topology_device,
@@ -1274,6 +1266,10 @@ int kfd_topology_add_device(struct kfd_dev *gpu)*/ amdgpu_amdkfd_get_cu_info (dev->gpu->kgd, &cu_info); + +strncpy (dev->node_props.name, gpu->device_info->asic_name, +KFD_TOPOLOGY_PUBLIC_NAME_SIZE ); + dev->node_props.simd_arrays_per_engine = cu_info.num_shader_arrays_per_engine;
drivers/gpu/drm/amd/amdkfd/kfd_topology.h +2 -2
@@ -27,7 +27,7 @@#include <linux/list.h> #include "kfd_crat.h" -#define KFD_TOPOLOGY_PUBLIC_NAME_SIZE 128 +#define KFD_TOPOLOGY_PUBLIC_NAME_SIZE 32#define HSA_CAP_HOT_PLUGGABLE 0x00000001#define HSA_CAP_ATS_PRESENT 0x00000002
@@ -81,7 +81,7 @@ struct kfd_node_properties {int32_t drm_render_minor;uint32_t num_sdma_engines;uint32_t num_sdma_xgmi_engines; -uint16_t marketing_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE ]; +char name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE ]; };#define HSA_MEM_HEAP_TYPE_SYSTEM 0
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx