mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: David Airlie <airlied@linux.ie>,
	Alex Deucher <alexander.deucher@amd.com>,
	Jerome Glisse <j.glisse@gmail.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	John Bridgman <John.Bridgman@amd.com>,
	Andrew Lewycky <Andrew.Lewycky@amd.com>,
	Joerg Roedel <joro@8bytes.org>, Ben Goz <ben.goz@amd.com>,
	Oded Gabbay <oded.gabbay@amd.com>,
	Evgeny Pinchuk <evgeny.pinchuk@amd.com>,
	Alexey Skidanov <Alexey.Skidanov@amd.com>,
	linux-api@vger.kernel.org
Subject: [PATCH 55/83] hsa/radeon: Add IOCTL for update queue
Date: Fri, 11 Jul 2014 00:54:11 +0300	[thread overview]
Message-ID: <1405029279-6894-27-git-send-email-oded.gabbay@amd.com> (raw)
In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com>

From: Ben Goz <ben.goz@amd.com>

This patch adds a new IOCTL that enables the user to perform update to an HSA
queue.

Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
 drivers/gpu/hsa/radeon/cik_mqds.h                  |  1 -
 drivers/gpu/hsa/radeon/kfd_chardev.c               | 29 ++++++++++++++++++++++
 drivers/gpu/hsa/radeon/kfd_device_queue_manager.c  |  1 -
 drivers/gpu/hsa/radeon/kfd_device_queue_manager.h  |  1 -
 drivers/gpu/hsa/radeon/kfd_hw_pointer_store.c      |  1 -
 drivers/gpu/hsa/radeon/kfd_hw_pointer_store.h      |  1 -
 drivers/gpu/hsa/radeon/kfd_kernel_queue.c          |  1 -
 drivers/gpu/hsa/radeon/kfd_kernel_queue.h          |  1 -
 drivers/gpu/hsa/radeon/kfd_mqd_manager.c           |  1 -
 drivers/gpu/hsa/radeon/kfd_mqd_manager.h           |  1 -
 drivers/gpu/hsa/radeon/kfd_packet_manager.c        | 23 ++++++++++++++---
 drivers/gpu/hsa/radeon/kfd_process_queue_manager.c |  1 -
 drivers/gpu/hsa/radeon/kfd_queue.c                 |  1 -
 include/uapi/linux/kfd_ioctl.h                     |  9 +++++++
 14 files changed, 58 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/hsa/radeon/cik_mqds.h b/drivers/gpu/hsa/radeon/cik_mqds.h
index 58945c8..35a35b4 100644
--- a/drivers/gpu/hsa/radeon/cik_mqds.h
+++ b/drivers/gpu/hsa/radeon/cik_mqds.h
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #ifndef CIK_MQDS_H_
diff --git a/drivers/gpu/hsa/radeon/kfd_chardev.c b/drivers/gpu/hsa/radeon/kfd_chardev.c
index bb2ef02..9a77332 100644
--- a/drivers/gpu/hsa/radeon/kfd_chardev.c
+++ b/drivers/gpu/hsa/radeon/kfd_chardev.c
@@ -230,6 +230,31 @@ kfd_ioctl_destroy_queue(struct file *filp, struct kfd_process *p, void __user *a
 	return retval;
 }
 
+static int
+kfd_ioctl_update_queue(struct file *filp, struct kfd_process *p, void __user *arg)
+{
+	int retval;
+	struct kfd_ioctl_update_queue_args args;
+	struct queue_properties properties;
+
+	if (copy_from_user(&args, arg, sizeof(args)))
+		return -EFAULT;
+
+	properties.queue_address = args.ring_base_address;
+	properties.queue_size = args.ring_size;
+	properties.queue_percent = args.queue_percentage;
+	properties.priority = args.queue_priority;
+
+	pr_debug("kfd: updating queue id %d for PASID %d\n", args.queue_id, p->pasid);
+
+	mutex_lock(&p->mutex);
+
+	retval = pqm_update_queue(&p->pqm, args.queue_id, &properties);
+
+	mutex_unlock(&p->mutex);
+
+	return retval;
+}
 
 static long
 kfd_ioctl_set_memory_policy(struct file *filep, struct kfd_process *p, void __user *arg)
@@ -398,6 +423,10 @@ kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 		err = kfd_ioctl_get_process_apertures(filep, process, (void __user *)arg);
 		break;
 
+	case KFD_IOC_UPDATE_QUEUE:
+		err = kfd_ioctl_update_queue(filep, process, (void __user *)arg);
+		break;
+
 	default:
 		dev_err(kfd_device,
 			"unknown ioctl cmd 0x%x, arg 0x%lx)\n",
diff --git a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c
index 9e21074..c2d91c9 100644
--- a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c
+++ b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/slab.h>
diff --git a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.h b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.h
index 0529a96..fe9ef10 100644
--- a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.h
+++ b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.h
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #ifndef DEVICE_QUEUE_MANAGER_H_
diff --git a/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.c b/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.c
index 1372fb2..4e71f7d 100644
--- a/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.c
+++ b/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/types.h>
diff --git a/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.h b/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.h
index be1d6cb..f384b7f 100644
--- a/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.h
+++ b/drivers/gpu/hsa/radeon/kfd_hw_pointer_store.h
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #ifndef HW_POINTER_STORE_H_
diff --git a/drivers/gpu/hsa/radeon/kfd_kernel_queue.c b/drivers/gpu/hsa/radeon/kfd_kernel_queue.c
index 61f420f..aa64693e 100644
--- a/drivers/gpu/hsa/radeon/kfd_kernel_queue.c
+++ b/drivers/gpu/hsa/radeon/kfd_kernel_queue.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/types.h>
diff --git a/drivers/gpu/hsa/radeon/kfd_kernel_queue.h b/drivers/gpu/hsa/radeon/kfd_kernel_queue.h
index 339376c..963e861 100644
--- a/drivers/gpu/hsa/radeon/kfd_kernel_queue.h
+++ b/drivers/gpu/hsa/radeon/kfd_kernel_queue.h
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #ifndef KERNEL_QUEUE_H_
diff --git a/drivers/gpu/hsa/radeon/kfd_mqd_manager.c b/drivers/gpu/hsa/radeon/kfd_mqd_manager.c
index 14b248f..a3e9f7c 100644
--- a/drivers/gpu/hsa/radeon/kfd_mqd_manager.c
+++ b/drivers/gpu/hsa/radeon/kfd_mqd_manager.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/printk.h>
diff --git a/drivers/gpu/hsa/radeon/kfd_mqd_manager.h b/drivers/gpu/hsa/radeon/kfd_mqd_manager.h
index e7b39ee..8e7a5fd 100644
--- a/drivers/gpu/hsa/radeon/kfd_mqd_manager.h
+++ b/drivers/gpu/hsa/radeon/kfd_mqd_manager.h
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #ifndef MQD_MANAGER_H_
diff --git a/drivers/gpu/hsa/radeon/kfd_packet_manager.c b/drivers/gpu/hsa/radeon/kfd_packet_manager.c
index 4967b7c..3fc8c34 100644
--- a/drivers/gpu/hsa/radeon/kfd_packet_manager.c
+++ b/drivers/gpu/hsa/radeon/kfd_packet_manager.c
@@ -1,9 +1,26 @@
 /*
- * packet_manager.c
+ * Copyright 2014 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  *
- *  Created on: Mar 16, 2014
- *      Author: ben
  */
+
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include "kfd_device_queue_manager.h"
diff --git a/drivers/gpu/hsa/radeon/kfd_process_queue_manager.c b/drivers/gpu/hsa/radeon/kfd_process_queue_manager.c
index 6e38ca4..fe74dd7 100644
--- a/drivers/gpu/hsa/radeon/kfd_process_queue_manager.c
+++ b/drivers/gpu/hsa/radeon/kfd_process_queue_manager.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/slab.h>
diff --git a/drivers/gpu/hsa/radeon/kfd_queue.c b/drivers/gpu/hsa/radeon/kfd_queue.c
index 78fe180..2d22cc1 100644
--- a/drivers/gpu/hsa/radeon/kfd_queue.c
+++ b/drivers/gpu/hsa/radeon/kfd_queue.c
@@ -19,7 +19,6 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Author: Ben Goz
  */
 
 #include <linux/slab.h>
diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h
index 5134880..d58231d 100644
--- a/include/uapi/linux/kfd_ioctl.h
+++ b/include/uapi/linux/kfd_ioctl.h
@@ -58,6 +58,14 @@ struct kfd_ioctl_destroy_queue_args {
 	uint32_t queue_id;		/* to KFD */
 };
 
+struct kfd_ioctl_update_queue_args {
+	uint32_t queue_id;		/* to KFD */
+	uint64_t ring_base_address;	/* to KFD */
+	uint32_t ring_size;		/* to KFD */
+	uint32_t queue_percentage;	/* to KFD */
+	uint32_t queue_priority;	/* to KFD */
+};
+
 /* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
 #define KFD_IOC_CACHE_POLICY_COHERENT 0
 #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
@@ -103,6 +111,7 @@ struct kfd_ioctl_get_process_apertures_args {
 #define KFD_IOC_SET_MEMORY_POLICY	_IOW(KFD_IOC_MAGIC, 4, struct kfd_ioctl_set_memory_policy_args)
 #define KFD_IOC_GET_CLOCK_COUNTERS	_IOWR(KFD_IOC_MAGIC, 5, struct kfd_ioctl_get_clock_counters_args)
 #define KFD_IOC_GET_PROCESS_APERTURES _IOR(KFD_IOC_MAGIC, 6, struct kfd_ioctl_get_process_apertures_args)
+#define KFD_IOC_UPDATE_QUEUE	_IOW(KFD_IOC_MAGIC, 7, struct kfd_ioctl_update_queue_args)
 
 #pragma pack(pop)
 
-- 
1.9.1


  parent reply	other threads:[~2014-07-10 21:56 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 21:53 [PATCH 29/83] hsa/radeon: Fix memory size allocated for HPD Oded Gabbay
2014-07-10 21:53 ` [PATCH 30/83] hsa/radeon: Fix list of supported devices Oded Gabbay
2014-07-10 21:53 ` [PATCH 31/83] drm/radeon: extending kfd-kgd interface Oded Gabbay
2014-07-10 21:53 ` [PATCH 32/83] hsa/radeon: implementing IOCTL for clock counters Oded Gabbay
2014-07-11 20:34   ` Jerome Glisse
2014-07-10 21:53 ` [PATCH 33/83] hsa/radeon: Fix coding style in cik_int.h Oded Gabbay
2014-07-10 21:53 ` [PATCH 34/83] drm/radeon: adding synchronization for GRBM GFX Oded Gabbay
2014-07-10 21:53 ` [PATCH 35/83] hsa/radeon: Print ioctl commnad only in debug mode Oded Gabbay
2014-07-10 21:53 ` [PATCH 36/83] hsa/radeon: fixing clock counters bug Oded Gabbay
2014-07-10 21:53 ` [PATCH 37/83] hsa/radeon: Print ISR info only in debug mode Oded Gabbay
2014-07-10 21:53 ` [PATCH 38/83] hsa/radeon: Workaround for a bug in amd_iommu Oded Gabbay
2014-07-11  8:42   ` Joerg Roedel
2014-07-10 21:53 ` [PATCH 39/83] drm/radeon: Extending kfd interface Oded Gabbay
2014-07-10 21:53 ` [PATCH 40/83] hsa/radeon: Adding max clock speeds to topology Oded Gabbay
2014-07-10 21:53 ` [PATCH 41/83] hsa/radeon: Alternating the source of max clock Oded Gabbay
2014-07-10 21:53 ` [PATCH 42/83] hsa/radeon: 32-bit processes support Oded Gabbay
2014-07-10 21:53 ` [PATCH 43/83] hsa/radeon: NULL pointer dereference bug workaround Oded Gabbay
2014-07-10 21:54 ` [PATCH 44/83] hsa/radeon: HSA64/HSA32 modes support Oded Gabbay
2014-07-11 20:41   ` Jerome Glisse
2014-07-10 21:54 ` [PATCH 45/83] hsa/radeon: debugging print statements Oded Gabbay
2014-07-10 21:54 ` [PATCH 46/83] hsa/radeon: Add queue and hw_pointer_store modules Oded Gabbay
2014-07-10 21:54 ` [PATCH 47/83] hsa/radeon: Add support allocating kernel doorbells Oded Gabbay
2014-07-10 21:54 ` [PATCH 48/83] hsa/radeon: Add mqd_manager module Oded Gabbay
2014-07-10 21:54 ` [PATCH 49/83] hsa/radeon: Add kernel queue support for KFD Oded Gabbay
2014-07-10 21:54 ` [PATCH 50/83] hsa/radeon: Add module parameter of scheduling policy Oded Gabbay
2014-07-10 21:54 ` [PATCH 51/83] hsa/radeon: Add packet manager module Oded Gabbay
2014-07-10 21:54 ` [PATCH 52/83] hsa/radeon: Add process queue " Oded Gabbay
2014-07-10 21:54 ` [PATCH 53/83] hsa/radeon: Add device " Oded Gabbay
2014-07-10 21:54 ` [PATCH 54/83] hsa/radeon: Switch to new queue scheduler Oded Gabbay
2014-07-10 21:54 ` Oded Gabbay [this message]
2014-07-10 21:54 ` [PATCH 56/83] hsa/radeon: Queue Management integration with Memory Management Oded Gabbay
2014-07-10 21:54 ` [PATCH 57/83] hsa/radeon: Eliminate warnings in compilation Oded Gabbay
2014-07-10 21:54 ` [PATCH 58/83] hsa/radeon: Various kernel styling fixes Oded Gabbay
2014-07-10 21:54 ` [PATCH 59/83] hsa/radeon: Exclusive access for perf. counters Oded Gabbay
2014-07-10 21:54 ` [PATCH 60/83] hsa/radeon: Rearrange structures in kfd_ioctl.h Oded Gabbay
2014-07-10 21:54 ` [PATCH 61/83] hsa/radeon: change another pr_info to pr_debug Oded Gabbay
2014-07-10 21:54 ` [PATCH 62/83] hsa/radeon: Fix timeout calculation in sync_with_hw Oded Gabbay
2014-07-10 21:54 ` [PATCH 63/83] hsa/radeon: Update module information and version Oded Gabbay
2014-07-10 21:54 ` [PATCH 64/83] hsa/radeon: update queue fault handling Oded Gabbay
2014-07-10 21:54 ` [PATCH 65/83] hsa/radeon: fixing a bug to support 32b processes Oded Gabbay
2014-07-10 21:54 ` [PATCH 66/83] hsa/radeon: Fix number of pipes per ME Oded Gabbay
2014-07-10 21:54 ` [PATCH 67/83] hsa/radeon: Removing hw pointer store module Oded Gabbay
2014-07-10 21:54 ` [PATCH 68/83] hsa/radeon: Update module version to 0.6.0 Oded Gabbay
2014-07-10 21:54 ` [PATCH 69/83] hsa/radeon: Fix initialization of sh_mem registers Oded Gabbay
2014-07-10 21:54 ` [PATCH 70/83] hsa/radeon: Fix compilation warnings Oded Gabbay
2014-07-10 21:54 ` [PATCH 71/83] hsa/radeon: Remove old scheduler code Oded Gabbay
2014-07-10 21:54 ` [PATCH 72/83] hsa/radeon: Static analysis (smatch) fixes Oded Gabbay
2014-07-10 21:54 ` [PATCH 73/83] hsa/radeon: Adding qcm fence return status Oded Gabbay
2014-07-10 21:54 ` [PATCH 74/83] hsa/radeon: Adding some error messages Oded Gabbay
2014-07-10 21:54 ` [PATCH 75/83] hsa/radeon: Fixing minor issues with kernel queues (DIQ) Oded Gabbay
2014-07-10 21:54 ` [PATCH 76/83] hsa/radeon: Check oversubscription before destroying runlist Oded Gabbay
2014-07-10 21:54 ` [PATCH 77/83] hsa/radeon: Add local memory to topology Oded Gabbay
2014-07-10 21:54 ` [PATCH 78/83] hsa/radeon: Don't verify cksum when parsing CRAT table Oded Gabbay
2014-07-10 21:54 ` [PATCH 79/83] hsa/radeon: Update module version to 0.6.1 Oded Gabbay
2014-07-10 21:54 ` [PATCH 80/83] drm/radeon: Add register access functions to kfd2kgd interface Oded Gabbay
2014-07-10 21:54 ` [PATCH 81/83] hsa/radeon: Eliminating all direct register accesses Oded Gabbay
2014-07-10 21:54 ` [PATCH 82/83] drm/radeon: Remove lock functions from kfd2kgd interface Oded Gabbay
2014-07-10 21:54 ` [PATCH 83/83] hsa/radeon: Update module version to 0.6.2 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=1405029279-6894-27-git-send-email-oded.gabbay@amd.com \
    --to=oded.gabbay@gmail.com \
    --cc=Alexey.Skidanov@amd.com \
    --cc=Andrew.Lewycky@amd.com \
    --cc=John.Bridgman@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=ben.goz@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evgeny.pinchuk@amd.com \
    --cc=j.glisse@gmail.com \
    --cc=joro@8bytes.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oded.gabbay@amd.com \
    /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

Powered by JetHome