lkml.org 
[lkml]   [2014]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18/83] hsa/radeon: Enable interrupts in KFD scheduler
Date
This patch enables the use of interrupts in the KFD scheduler when the
scheduler performs its initialization.

It also disables the interrupts when the scheduler stops its work.

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
drivers/gpu/hsa/radeon/kfd_sched_cik_static.c | 28 +++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c
index 5d42e88..9add5e5 100644
--- a/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c
+++ b/drivers/gpu/hsa/radeon/kfd_sched_cik_static.c
@@ -486,6 +486,32 @@ static void cik_static_destroy(struct kfd_scheduler *scheduler)
kfree(priv);
}

+static void
+enable_interrupts(struct cik_static_private *priv)
+{
+ unsigned int i;
+
+ lock_srbm_index(priv);
+ for (i = 0; i < priv->num_pipes; i++) {
+ pipe_select(priv, i);
+ WRITE_REG(priv->dev, CPC_INT_CNTL, DEQUEUE_REQUEST_INT_ENABLE);
+ }
+ unlock_srbm_index(priv);
+}
+
+static void
+disable_interrupts(struct cik_static_private *priv)
+{
+ unsigned int i;
+
+ lock_srbm_index(priv);
+ for (i = 0; i < priv->num_pipes; i++) {
+ pipe_select(priv, i);
+ WRITE_REG(priv->dev, CPC_INT_CNTL, 0);
+ }
+ unlock_srbm_index(priv);
+}
+
static void cik_static_start(struct kfd_scheduler *scheduler)
{
struct cik_static_private *priv = kfd_scheduler_to_private(scheduler);
@@ -495,6 +521,7 @@ static void cik_static_start(struct kfd_scheduler *scheduler)

init_pipes(priv);
init_ats(priv);
+ enable_interrupts(priv);
}

static void cik_static_stop(struct kfd_scheduler *scheduler)
@@ -502,6 +529,7 @@ static void cik_static_stop(struct kfd_scheduler *scheduler)
struct cik_static_private *priv = kfd_scheduler_to_private(scheduler);

exit_ats(priv);
+ disable_interrupts(priv);

radeon_kfd_vidmem_ungpumap(priv->dev, priv->hpd_mem);
radeon_kfd_vidmem_ungpumap(priv->dev, priv->mqd_mem);
--
1.9.1


\
 
 \ /
  Last update: 2014-07-11 13:41    [W:0.457 / U:4.348 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site