From patchwork Sun May 10 09:28:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 6371391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 55FD39F32E for ; Sun, 10 May 2015 09:29:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 791E82037F for ; Sun, 10 May 2015 09:29:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A86BD2037E for ; Sun, 10 May 2015 09:29:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D34DF6E1F7; Sun, 10 May 2015 02:29:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 1051F6E1F7 for ; Sun, 10 May 2015 02:29:15 -0700 (PDT) Received: by oiko83 with SMTP id o83so86036348oik.1 for ; Sun, 10 May 2015 02:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FkE09yYDn0+FGQKGMw56xDM5JM3GZ4hrzrYAMIaWr+k=; b=tvjfWWQbfa5pYhcToNe7XD0WlMpVkI+CICKLKmSxuf2T9BJ6xm8SXd2vWL/obXY09Z DoSfNH1eA6R9A73JHG0+Ub2se5g7B3Da0QBBdYoREOoCm+XWRJXKisJukuRg97Ta6WVh 3TEYK5fZmZCIQ4b4OkVbXY08Nlujd4MhS2APJy3zj2xqNSNBxI9FtEBVkEp9tsET20v4 Ikqu+mx8N/Ji1VXSGmHGXizLgE3HCGD/GfgpNxG/BnIXI7NCb6RHGPTdxTEOBHPBLDxQ ZwP5Gn+wl0JRAfdJasxXuX5wBtP7DH7X565ZLPmn8yzvZKUTZHYYZ+8fvQ+Ze01kt/Zt g3gA== X-Received: by 10.202.214.197 with SMTP id n188mr4050952oig.75.1431250154805; Sun, 10 May 2015 02:29:14 -0700 (PDT) Received: from tlv-gabbay-ws.amd.com ([2.52.187.57]) by mx.google.com with ESMTPSA id u193sm6743508oia.18.2015.05.10.02.29.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 May 2015 02:29:14 -0700 (PDT) From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 8/9] drm/amdkfd: Implement events IOCTLs Date: Sun, 10 May 2015 12:28:31 +0300 Message-Id: <1431250112-28828-9-git-send-email-oded.gabbay@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431250112-28828-1-git-send-email-oded.gabbay@gmail.com> References: <1431250112-28828-1-git-send-email-oded.gabbay@gmail.com> Cc: Andrew Lewycky , Oded Gabbay X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrew Lewycky Signed-off-by: Andrew Lewycky Signed-off-by: Oded Gabbay --- 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) \