[PATCH 2/4] amdkfd: Add number of watch points to topology

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

 



From: Alexey Skidanov <Alexey.Skidanov@xxxxxxx>

This patch adds the number of watch points to the node capabilities in the
topology module

Reviewed-by: Oded Gabbay <oded.gabbay@xxxxxxx>
Signed-off-by: Alexey Skidanov <Alexey.Skidanov@xxxxxxx>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c   |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h     |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 13 +++++++++++++
 3 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 43884eb..436c31c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -32,6 +32,7 @@
 static const struct kfd_device_info kaveri_device_info = {
 	.max_pasid_bits = 16,
 	.ih_ring_entry_size = 4 * sizeof(uint32_t),
+	.num_of_watch_points = 4,
 	.mqd_size_aligned = MQD_SIZE_ALIGNED
 };
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index f9fb81e..ba2bba8 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 {
 struct kfd_device_info {
 	unsigned int max_pasid_bits;
 	size_t ih_ring_entry_size;
+	uint8_t num_of_watch_points;
 	uint16_t mqd_size_aligned;
 };
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index b11792d..da34e1f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -27,6 +27,7 @@
 #include <linux/acpi.h>
 #include <linux/hash.h>
 #include <linux/cpufreq.h>
+#include <linux/log2.h>
 
 #include "kfd_priv.h"
 #include "kfd_crat.h"
@@ -634,6 +635,7 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 	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 */
 	buffer[0] = 0;
@@ -708,6 +710,17 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
 				dev->node_props.location_id);
 
 		if (dev->gpu) {
+			log_max_watch_addr =
+				__ilog2_u32(dev->gpu->device_info->num_of_watch_points);
+
+			if (log_max_watch_addr) {
+				dev->node_props.capability |=
+						HSA_CAP_WATCH_POINTS_SUPPORTED;
+				dev->node_props.capability |=
+					(log_max_watch_addr << HSA_CAP_WATCH_POINTS_TOTALBITS_SHIFT) &
+					HSA_CAP_WATCH_POINTS_TOTALBITS_MASK;
+			}
+
 			sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute",
 					kfd2kgd->get_max_engine_clock_in_mhz(
 						dev->gpu->kgd));
-- 
1.9.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