From: Oded Gabbay <oded.gabbay@amd.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 2/4] amdkfd: Add number of watch points to topology
Date: Sun, 14 Dec 2014 15:35:18 +0200 [thread overview]
Message-ID: <1418564120-19523-2-git-send-email-oded.gabbay@amd.com> (raw)
In-Reply-To: <1418564120-19523-1-git-send-email-oded.gabbay@amd.com>
From: Alexey Skidanov <Alexey.Skidanov@amd.com>
This patch adds the number of watch points to the node capabilities in the
topology module
Reviewed-by: Oded Gabbay <oded.gabbay@amd.com>
Signed-off-by: Alexey Skidanov <Alexey.Skidanov@amd.com>
---
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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-12-14 13:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 13:35 [PATCH 1/4] amdkfd: fix error printing in kfd_ioctl() Oded Gabbay
2014-12-14 13:35 ` Oded Gabbay [this message]
2014-12-14 13:35 ` [PATCH 3/4] amdkfd: Remove duplicate include Oded Gabbay
2014-12-14 13:35 ` [PATCH 4/4] amdkfd: Process-device data creation and lookup split Oded Gabbay
2014-12-14 14:10 ` [PATCH 1/4] amdkfd: fix error printing in kfd_ioctl() Christian König
2014-12-14 14:20 ` Oded Gabbay
2014-12-15 7:59 ` Daniel Vetter
2014-12-15 8:32 ` Dave Airlie
2014-12-15 13:48 ` Oded Gabbay
2014-12-29 12:44 ` Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418564120-19523-2-git-send-email-oded.gabbay@amd.com \
--to=oded.gabbay@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox