diff options
| author | Alexey Skidanov <Alexey.Skidanov@amd.com> | 2014-10-13 09:35:12 -0400 |
|---|---|---|
| committer | Oded Gabbay <oded.gabbay@amd.com> | 2015-01-09 15:25:55 -0500 |
| commit | f7c826ad380b59baff190044c024b62091128145 (patch) | |
| tree | 9c79daa69085fb4bedafabe681f3700eaf255133 /drivers/gpu/drm/amd | |
| parent | c93546a5e32bd788c22aefa072385f3784551c13 (diff) | |
drm/amdkfd: Add number of watch points to topology
This patch adds the number of watch points to the node capabilities in the
topology module
Signed-off-by: Alexey Skidanov <Alexey.Skidanov@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 155 |
3 files changed, 86 insertions, 71 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 43884ebd4303..436c31ca7710 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | static const struct kfd_device_info kaveri_device_info = { | 32 | static const struct kfd_device_info kaveri_device_info = { |
| 33 | .max_pasid_bits = 16, | 33 | .max_pasid_bits = 16, |
| 34 | .ih_ring_entry_size = 4 * sizeof(uint32_t), | 34 | .ih_ring_entry_size = 4 * sizeof(uint32_t), |
| 35 | .num_of_watch_points = 4, | ||
| 35 | .mqd_size_aligned = MQD_SIZE_ALIGNED | 36 | .mqd_size_aligned = MQD_SIZE_ALIGNED |
| 36 | }; | 37 | }; |
| 37 | 38 | ||
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index f9fb81e3bb09..ba2bba8b5731 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h | |||
| @@ -107,6 +107,7 @@ enum cache_policy { | |||
| 107 | struct kfd_device_info { | 107 | struct kfd_device_info { |
| 108 | unsigned int max_pasid_bits; | 108 | unsigned int max_pasid_bits; |
| 109 | size_t ih_ring_entry_size; | 109 | size_t ih_ring_entry_size; |
| 110 | uint8_t num_of_watch_points; | ||
| 110 | uint16_t mqd_size_aligned; | 111 | uint16_t mqd_size_aligned; |
| 111 | }; | 112 | }; |
| 112 | 113 | ||
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index b11792d7e70e..4886dde7d1fb 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/acpi.h> | 27 | #include <linux/acpi.h> |
| 28 | #include <linux/hash.h> | 28 | #include <linux/hash.h> |
| 29 | #include <linux/cpufreq.h> | 29 | #include <linux/cpufreq.h> |
| 30 | #include <linux/log2.h> | ||
| 30 | 31 | ||
| 31 | #include "kfd_priv.h" | 32 | #include "kfd_priv.h" |
| 32 | #include "kfd_crat.h" | 33 | #include "kfd_crat.h" |
| @@ -630,10 +631,10 @@ static struct kobj_type cache_type = { | |||
| 630 | static ssize_t node_show(struct kobject *kobj, struct attribute *attr, | 631 | static ssize_t node_show(struct kobject *kobj, struct attribute *attr, |
| 631 | char *buffer) | 632 | char *buffer) |
| 632 | { | 633 | { |
| 633 | ssize_t ret; | ||
| 634 | struct kfd_topology_device *dev; | 634 | struct kfd_topology_device *dev; |
| 635 | char public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE]; | 635 | char public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE]; |
| 636 | uint32_t i; | 636 | uint32_t i; |
| 637 | uint32_t log_max_watch_addr; | ||
| 637 | 638 | ||
| 638 | /* Making sure that the buffer is an empty string */ | 639 | /* Making sure that the buffer is an empty string */ |
| 639 | buffer[0] = 0; | 640 | buffer[0] = 0; |
| @@ -641,8 +642,10 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr, | |||
| 641 | if (strcmp(attr->name, "gpu_id") == 0) { | 642 | if (strcmp(attr->name, "gpu_id") == 0) { |
| 642 | dev = container_of(attr, struct kfd_topology_device, | 643 | dev = container_of(attr, struct kfd_topology_device, |
| 643 | attr_gpuid); | 644 | attr_gpuid); |
| 644 | ret = sysfs_show_32bit_val(buffer, dev->gpu_id); | 645 | return sysfs_show_32bit_val(buffer, dev->gpu_id); |
| 645 | } else if (strcmp(attr->name, "name") == 0) { | 646 | } |
| 647 | |||
| 648 | if (strcmp(attr->name, "name") == 0) { | ||
| 646 | dev = container_of(attr, struct kfd_topology_device, | 649 | dev = container_of(attr, struct kfd_topology_device, |
| 647 | attr_name); | 650 | attr_name); |
| 648 | for (i = 0; i < KFD_TOPOLOGY_PUBLIC_NAME_SIZE; i++) { | 651 | for (i = 0; i < KFD_TOPOLOGY_PUBLIC_NAME_SIZE; i++) { |
| @@ -652,80 +655,90 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr, | |||
| 652 | break; | 655 | break; |
| 653 | } | 656 | } |
| 654 | public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE-1] = 0x0; | 657 | public_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE-1] = 0x0; |
| 655 | ret = sysfs_show_str_val(buffer, public_name); | 658 | return sysfs_show_str_val(buffer, public_name); |
| 656 | } else { | 659 | } |
| 657 | dev = container_of(attr, struct kfd_topology_device, | ||
| 658 | attr_props); | ||
| 659 | sysfs_show_32bit_prop(buffer, "cpu_cores_count", | ||
| 660 | dev->node_props.cpu_cores_count); | ||
| 661 | sysfs_show_32bit_prop(buffer, "simd_count", | ||
| 662 | dev->node_props.simd_count); | ||
| 663 | |||
| 664 | if (dev->mem_bank_count < dev->node_props.mem_banks_count) { | ||
| 665 | pr_warn("kfd: mem_banks_count truncated from %d to %d\n", | ||
| 666 | dev->node_props.mem_banks_count, | ||
| 667 | dev->mem_bank_count); | ||
| 668 | sysfs_show_32bit_prop(buffer, "mem_banks_count", | ||
| 669 | dev->mem_bank_count); | ||
| 670 | } else { | ||
| 671 | sysfs_show_32bit_prop(buffer, "mem_banks_count", | ||
| 672 | dev->node_props.mem_banks_count); | ||
| 673 | } | ||
| 674 | 660 | ||
| 675 | sysfs_show_32bit_prop(buffer, "caches_count", | 661 | dev = container_of(attr, struct kfd_topology_device, |
| 676 | dev->node_props.caches_count); | 662 | attr_props); |
| 677 | sysfs_show_32bit_prop(buffer, "io_links_count", | 663 | sysfs_show_32bit_prop(buffer, "cpu_cores_count", |
| 678 | dev->node_props.io_links_count); | 664 | dev->node_props.cpu_cores_count); |
| 679 | sysfs_show_32bit_prop(buffer, "cpu_core_id_base", | 665 | sysfs_show_32bit_prop(buffer, "simd_count", |
| 680 | dev->node_props.cpu_core_id_base); | 666 | dev->node_props.simd_count); |
| 681 | sysfs_show_32bit_prop(buffer, "simd_id_base", | 667 | |
| 682 | dev->node_props.simd_id_base); | 668 | if (dev->mem_bank_count < dev->node_props.mem_banks_count) { |
| 683 | sysfs_show_32bit_prop(buffer, "capability", | 669 | pr_warn("kfd: mem_banks_count truncated from %d to %d\n", |
| 684 | dev->node_props.capability); | 670 | dev->node_props.mem_banks_count, |
| 685 | sysfs_show_32bit_prop(buffer, "max_waves_per_simd", | 671 | dev->mem_bank_count); |
| 686 | dev->node_props.max_waves_per_simd); | 672 | sysfs_show_32bit_prop(buffer, "mem_banks_count", |
| 687 | sysfs_show_32bit_prop(buffer, "lds_size_in_kb", | 673 | dev->mem_bank_count); |
| 688 | dev->node_props.lds_size_in_kb); | 674 | } else { |
| 689 | sysfs_show_32bit_prop(buffer, "gds_size_in_kb", | 675 | sysfs_show_32bit_prop(buffer, "mem_banks_count", |
| 690 | dev->node_props.gds_size_in_kb); | 676 | dev->node_props.mem_banks_count); |
| 691 | sysfs_show_32bit_prop(buffer, "wave_front_size", | 677 | } |
| 692 | dev->node_props.wave_front_size); | ||
| 693 | sysfs_show_32bit_prop(buffer, "array_count", | ||
| 694 | dev->node_props.array_count); | ||
| 695 | sysfs_show_32bit_prop(buffer, "simd_arrays_per_engine", | ||
| 696 | dev->node_props.simd_arrays_per_engine); | ||
| 697 | sysfs_show_32bit_prop(buffer, "cu_per_simd_array", | ||
| 698 | dev->node_props.cu_per_simd_array); | ||
| 699 | sysfs_show_32bit_prop(buffer, "simd_per_cu", | ||
| 700 | dev->node_props.simd_per_cu); | ||
| 701 | sysfs_show_32bit_prop(buffer, "max_slots_scratch_cu", | ||
| 702 | dev->node_props.max_slots_scratch_cu); | ||
| 703 | sysfs_show_32bit_prop(buffer, "vendor_id", | ||
| 704 | dev->node_props.vendor_id); | ||
| 705 | sysfs_show_32bit_prop(buffer, "device_id", | ||
| 706 | dev->node_props.device_id); | ||
| 707 | sysfs_show_32bit_prop(buffer, "location_id", | ||
| 708 | dev->node_props.location_id); | ||
| 709 | |||
| 710 | if (dev->gpu) { | ||
| 711 | sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute", | ||
| 712 | kfd2kgd->get_max_engine_clock_in_mhz( | ||
| 713 | dev->gpu->kgd)); | ||
| 714 | sysfs_show_64bit_prop(buffer, "local_mem_size", | ||
| 715 | kfd2kgd->get_vmem_size(dev->gpu->kgd)); | ||
| 716 | |||
| 717 | sysfs_show_32bit_prop(buffer, "fw_version", | ||
| 718 | kfd2kgd->get_fw_version( | ||
| 719 | dev->gpu->kgd, | ||
| 720 | KGD_ENGINE_MEC1)); | ||
| 721 | 678 | ||
| 679 | sysfs_show_32bit_prop(buffer, "caches_count", | ||
| 680 | dev->node_props.caches_count); | ||
| 681 | sysfs_show_32bit_prop(buffer, "io_links_count", | ||
| 682 | dev->node_props.io_links_count); | ||
| 683 | sysfs_show_32bit_prop(buffer, "cpu_core_id_base", | ||
| 684 | dev->node_props.cpu_core_id_base); | ||
| 685 | sysfs_show_32bit_prop(buffer, "simd_id_base", | ||
| 686 | dev->node_props.simd_id_base); | ||
| 687 | sysfs_show_32bit_prop(buffer, "capability", | ||
| 688 | dev->node_props.capability); | ||
| 689 | sysfs_show_32bit_prop(buffer, "max_waves_per_simd", | ||
| 690 | dev->node_props.max_waves_per_simd); | ||
| 691 | sysfs_show_32bit_prop(buffer, "lds_size_in_kb", | ||
| 692 | dev->node_props.lds_size_in_kb); | ||
| 693 | sysfs_show_32bit_prop(buffer, "gds_size_in_kb", | ||
