From patchwork Thu Jul 10 21:54:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528371 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CFD99F3B4 for ; Thu, 10 Jul 2014 23:33:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25551201B4 for ; Thu, 10 Jul 2014 23:33:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 32465201F2 for ; Thu, 10 Jul 2014 23:33:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF43D6E787; Thu, 10 Jul 2014 16:33:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B6486E163 for ; Thu, 10 Jul 2014 14:56:47 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id z12so190433wgg.12 for ; Thu, 10 Jul 2014 14:56:46 -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=Nhwz7V+cpIuZpqi6AWIo1rdoflzEGyHedVea7KXUMDQ=; b=1DILLWcuSzLQwLd6+Eld9sYVorJuhjRHaWE288M+IVTS+DHr29Rcdhh0cQyBZl1w5d itHZ4UycC66hIWkuIiJ1r5af8OcU3vORMeI3CagGh05RpUh/o9ZeZSLulrElRz2YJAAh 5lhuzpUtzzI7L4P1jT8ILGuqAHypqmp+yonHIDiNdIhnrxCNkXzuyED3FqQG/0GXcfFd +l99kjes2btUIfCkajPT6PRpafRnKLYflbnvsS1D3BnZuLgI1EMDuCAxqdDI0oi0yH0v lmp+kDiRdVdCSCF3eyjnUm5hNC+YIsanEJMKjewQx0t5M/NYR0Bc2mNDokgBL90pDN8C bHTA== X-Received: by 10.194.83.39 with SMTP id n7mr60440765wjy.58.1405029406210; Thu, 10 Jul 2014 14:56:46 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.56.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:56:45 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 60/83] hsa/radeon: Rearrange structures in kfd_ioctl.h Date: Fri, 11 Jul 2014 00:54:16 +0300 Message-Id: <1405029279-6894-32-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , Ben Goz , linux-kernel@vger.kernel.org, Evgeny Pinchuk , Alexey Skidanov , dri-devel@lists.freedesktop.org, linux-api@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This patch rearranges the structures defined in kfd_ioctl.h so that all the uint64_t variables are located at the start of each structure and then all the uint32_t variables are located. Signed-off-by: Oded Gabbay --- include/uapi/linux/kfd_ioctl.h | 51 ++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index 509c4a0..3cedd1a 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h @@ -42,15 +42,15 @@ struct kfd_ioctl_get_version_args { struct kfd_ioctl_create_queue_args { uint64_t ring_base_address; /* to KFD */ + uint64_t write_pointer_address; /* from KFD */ + uint64_t read_pointer_address; /* from KFD */ + uint64_t doorbell_address; /* from KFD */ + uint32_t ring_size; /* to KFD */ uint32_t gpu_id; /* to KFD */ uint32_t queue_type; /* to KFD */ uint32_t queue_percentage; /* to KFD */ uint32_t queue_priority; /* to KFD */ - - uint64_t write_pointer_address; /* from KFD */ - uint64_t read_pointer_address; /* from KFD */ - uint64_t doorbell_address; /* from KFD */ uint32_t queue_id; /* from KFD */ }; @@ -59,8 +59,9 @@ struct kfd_ioctl_destroy_queue_args { }; struct kfd_ioctl_update_queue_args { - uint32_t queue_id; /* to KFD */ uint64_t ring_base_address; /* to KFD */ + + uint32_t queue_id; /* to KFD */ uint32_t ring_size; /* to KFD */ uint32_t queue_percentage; /* to KFD */ uint32_t queue_priority; /* to KFD */ @@ -71,31 +72,33 @@ struct kfd_ioctl_update_queue_args { #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1 struct kfd_ioctl_set_memory_policy_args { + uint64_t alternate_aperture_base; /* to KFD */ + uint64_t alternate_aperture_size; /* to KFD */ + uint32_t gpu_id; /* to KFD */ uint32_t default_policy; /* to KFD */ uint32_t alternate_policy; /* to KFD */ - uint64_t alternate_aperture_base; /* to KFD */ - uint64_t alternate_aperture_size; /* to KFD */ }; struct kfd_ioctl_get_clock_counters_args { - uint32_t gpu_id; /* to KFD */ uint64_t gpu_clock_counter; /* from KFD */ uint64_t cpu_clock_counter; /* from KFD */ uint64_t system_clock_counter; /* from KFD */ uint64_t system_clock_freq; /* from KFD */ + + uint32_t gpu_id; /* to KFD */ }; #define NUM_OF_SUPPORTED_GPUS 7 struct kfd_process_device_apertures { - uint64_t lds_base;/* from KFD */ - uint64_t lds_limit;/* from KFD */ - uint64_t scratch_base;/* from KFD */ - uint64_t scratch_limit;/* from KFD */ - uint64_t gpuvm_base;/* from KFD */ - uint64_t gpuvm_limit;/* from KFD */ - uint32_t gpu_id;/* from KFD */ + uint64_t lds_base; /* from KFD */ + uint64_t lds_limit; /* from KFD */ + uint64_t scratch_base; /* from KFD */ + uint64_t scratch_limit; /* from KFD */ + uint64_t gpuvm_base; /* from KFD */ + uint64_t gpuvm_limit; /* from KFD */ + uint32_t gpu_id; /* from KFD */ }; struct kfd_ioctl_get_process_apertures_args { @@ -104,24 +107,24 @@ struct kfd_ioctl_get_process_apertures_args { }; struct kfd_ioctl_pmc_acquire_access_args { - uint32_t gpu_id; /* to KFD */ - uint64_t trace_id; /* to KFD */ + uint64_t trace_id; /* to KFD */ + uint32_t gpu_id; /* to KFD */ }; struct kfd_ioctl_pmc_release_access_args { - uint32_t gpu_id; /* to KFD */ - uint64_t trace_id; /* to KFD */ + uint64_t trace_id; /* to KFD */ + uint32_t gpu_id; /* to KFD */ }; #define KFD_IOC_MAGIC 'K' -#define KFD_IOC_GET_VERSION _IOR(KFD_IOC_MAGIC, 1, struct kfd_ioctl_get_version_args) -#define KFD_IOC_CREATE_QUEUE _IOWR(KFD_IOC_MAGIC, 2, struct kfd_ioctl_create_queue_args) -#define KFD_IOC_DESTROY_QUEUE _IOWR(KFD_IOC_MAGIC, 3, struct kfd_ioctl_destroy_queue_args) +#define KFD_IOC_GET_VERSION _IOR(KFD_IOC_MAGIC, 1, struct kfd_ioctl_get_version_args) +#define KFD_IOC_CREATE_QUEUE _IOWR(KFD_IOC_MAGIC, 2, struct kfd_ioctl_create_queue_args) +#define KFD_IOC_DESTROY_QUEUE _IOWR(KFD_IOC_MAGIC, 3, struct kfd_ioctl_destroy_queue_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) +#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) #define KFD_IOC_PMC_ACQUIRE_ACCESS _IOW(KFD_IOC_MAGIC, 12, struct kfd_ioctl_pmc_acquire_access_args) #define KFD_IOC_PMC_RELEASE_ACCESS _IOW(KFD_IOC_MAGIC, 13, struct kfd_ioctl_pmc_release_access_args)