dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Andrew Lewycky <Andrew.Lewycky@amd.com>,
	Oded Gabbay <oded.gabbay@amd.com>
Subject: [PATCH v2 8/9] drm/amdkfd: Implement events IOCTLs
Date: Sun, 10 May 2015 12:28:31 +0300	[thread overview]
Message-ID: <1431250112-28828-9-git-send-email-oded.gabbay@gmail.com> (raw)
In-Reply-To: <1431250112-28828-1-git-send-email-oded.gabbay@gmail.com>

From: Andrew Lewycky <Andrew.Lewycky@amd.com>

Signed-off-by: Andrew Lewycky <Andrew.Lewycky@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 36 +++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 6dd8948..b2c6109 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -519,31 +519,57 @@ static int kfd_ioctl_get_process_apertures(struct file *filp,
 static int kfd_ioctl_create_event(struct file *filp, struct kfd_process *p,
 					void *data)
 {
-	return -ENODEV;
+	struct kfd_ioctl_create_event_args *args = data;
+	int err;
+
+	err = kfd_event_create(filp, p, args->event_type,
+				args->auto_reset != 0, args->node_id,
+				&args->event_id, &args->event_trigger_data,
+				&args->event_page_offset,
+				&args->event_slot_index);
+
+	return err;
 }
 
 static int kfd_ioctl_destroy_event(struct file *filp, struct kfd_process *p,
 					void *data)
 {
-	return -ENODEV;
+	struct kfd_ioctl_destroy_event_args *args = data;
+
+	return kfd_event_destroy(p, args->event_id);
 }
 
 static int kfd_ioctl_set_event(struct file *filp, struct kfd_process *p,
 				void *data)
 {
-	return -ENODEV;
+	struct kfd_ioctl_set_event_args *args = data;
+
+	return kfd_set_event(p, args->event_id);
 }
 
 static int kfd_ioctl_reset_event(struct file *filp, struct kfd_process *p,
 				void *data)
 {
-	return -ENODEV;
+	struct kfd_ioctl_reset_event_args *args = data;
+
+	return kfd_reset_event(p, args->event_id);
 }
 
 static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p,
 				void *data)
 {
-	return -ENODEV;
+	struct kfd_ioctl_wait_events_args *args = data;
+	enum kfd_event_wait_result wait_result;
+	int err;
+
+	err = kfd_wait_on_events(p, args->num_events,
+			(void __user *)args->events_ptr,
+			(args->wait_for_all != 0),
+			args->timeout, &wait_result);
+
+	args->wait_result = wait_result;
+
+	return err;
 }
 
 #define AMDKFD_IOCTL_DEF(ioctl, _func, _flags) \
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-05-10  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10  9:28 [PATCH v2 0/9] Add Interrupts & Events modules to amdkfd Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 1/9] drm/radeon: Add init interrupt kfd->kgd interface Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 2/9] drm/amdkfd: Add interrupt handling module Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 3/9] drm/amdkfd: add events IOCTL set definitions Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 4/9] drm/amdkfd: Add the events module Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 5/9] drm/amdkfd: Add memory exception handling Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 6/9] drm/amdkfd: Add bad opcode " Oded Gabbay
2015-05-10  9:28 ` [PATCH v2 7/9] drm/amdkfd: Add module parameter of send_sigterm Oded Gabbay
2015-05-10  9:28 ` Oded Gabbay [this message]
2015-05-10  9:28 ` [PATCH v2 9/9] drm/amdkfd: change driver version to 0.7.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=1431250112-28828-9-git-send-email-oded.gabbay@gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=Andrew.Lewycky@amd.com \
    --cc=dri-devel@lists.freedesktop.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