From 1f2fcb56fb9a8b8fc402da57318a7c3fbc17b057 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Fri, 10 Jun 2016 09:38:41 +0530 Subject: video: tegra: host: nvdla: add IOCTL stub - adds basic IOCTL stub for device ctrl node - register newly added fops to ctrl node Jira DLA-20 Change-Id: I87e764f47dc8b5e96c087b84c1baad909bfcfbf7 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1150326 GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad --- include/linux/nvhost_nvdla_ioctl.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/linux/nvhost_nvdla_ioctl.h (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h new file mode 100644 index 000000000..220ff0e21 --- /dev/null +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -0,0 +1,33 @@ +/* + * include/linux/nvhost_nvdla_ioctl.h + * + * Tegra NvDLA Driver + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, see . + */ + +#ifndef __LINUX_NVHOST_NVDLA_IOCTL_H +#define __LINUX_NVHOST_NVDLA_IOCTL_H + +#include +#include + +#if !defined(__KERNEL__) +#define __user +#endif + +#define NVHOST_NVDLA_IOCTL_MAGIC 'D' + +#endif /* __LINUX_NVHOST_NVDLA_IOCTL_H */ -- cgit v1.2.2 From 45b35f35547473681cb536f6c0ae6988deca30f2 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Thu, 23 Jun 2016 14:02:10 +0530 Subject: video: tegra: host: nvdla: add ping cmd ioctl - this adds first IOCTL for NvDLA for ping cmd - this ping cmd added to make sure that, falcon and memory read/write are working. - Through IOCTL, pass ping number to falcon via KMD - From falcon, for CRC check update mailbox and writeback with multiplier. Jira DLA-20 Change-Id: I9cd1bb57d42d00b03907d7cb45750dcec0b2df7b Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1170198 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad --- include/linux/nvhost_nvdla_ioctl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 220ff0e21..633facb2a 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -28,6 +28,20 @@ #define __user #endif +struct nvdla_ctrl_ping_args { + __u32 in_challenge; + __u32 out_response; +}; + #define NVHOST_NVDLA_IOCTL_MAGIC 'D' +#define NVDLA_IOCTL_CTRL_PING \ + _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 1, struct nvdla_ctrl_ping_args) + +#define NVDLA_IOCTL_CTRL_LAST \ + _IOC_NR(NVDLA_IOCTL_CTRL_PING) + +#define NVDLA_IOCTL_CTRL_MAX_ARG_SIZE \ + sizeof(struct nvdla_ctrl_ping_args) + #endif /* __LINUX_NVHOST_NVDLA_IOCTL_H */ -- cgit v1.2.2 From 1c7ca4fd69f129b13fb07f655a453af2d5cd12f6 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Fri, 1 Jul 2016 21:18:47 +0530 Subject: video: tegra: host: add buffer pin and unpin for nvdla - Using nvhost buffer management framework API's support Buffer pin and unpin for multiple buffer handles. Jira DLA-21 Change-Id: I029dfae698a699caa6e19ef6e7e3c0641b9de782 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1174651 Reviewed-by: Prashant Gaikwad --- include/linux/nvhost_nvdla_ioctl.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 633facb2a..b5b6c676b 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -33,15 +33,25 @@ struct nvdla_ctrl_ping_args { __u32 out_response; }; +struct nvdla_ctrl_pin_unpin_args { + __u64 buffers; + __u32 num_buffers; + __u32 reserved; +}; + #define NVHOST_NVDLA_IOCTL_MAGIC 'D' #define NVDLA_IOCTL_CTRL_PING \ _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 1, struct nvdla_ctrl_ping_args) +#define NVDLA_IOCTL_CTRL_PIN \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 2, struct nvdla_ctrl_pin_unpin_args) +#define NVDLA_IOCTL_CTRL_UNPIN \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_ctrl_pin_unpin_args) #define NVDLA_IOCTL_CTRL_LAST \ - _IOC_NR(NVDLA_IOCTL_CTRL_PING) + _IOC_NR(NVDLA_IOCTL_CTRL_UNPIN) #define NVDLA_IOCTL_CTRL_MAX_ARG_SIZE \ - sizeof(struct nvdla_ctrl_ping_args) + sizeof(struct nvdla_ctrl_pin_unpin_args) #endif /* __LINUX_NVHOST_NVDLA_IOCTL_H */ -- cgit v1.2.2 From 99b319a13e559bc8eec488ec35cb50ed23d0e68b Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Mon, 25 Jul 2016 14:58:10 +0530 Subject: video: tegra: host: dla: add submit IOCTL - add initial task submit stub Jira DLA-19 Change-Id: Iea249cfd14cf186b984d1f296373740f80429c3d Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1191493 --- include/linux/nvhost_nvdla_ioctl.h | 62 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index b5b6c676b..06f4f1011 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -39,6 +39,63 @@ struct nvdla_ctrl_pin_unpin_args { __u32 reserved; }; +struct nvdla_ctrl_submit_args { + __u64 tasks; + __u16 num_tasks; +#define MAX_TASKS_PER_SUBMIT 32 +#define NVDLA_SUBMIT_FLAGS_ATOMIC (1 << 0) + __u16 flags; + __u32 version; +}; + +struct nvdla_ctrl_ioctl_submit_task { + __u8 num_prefences; + __u8 num_postfences; + __u8 num_input_task_status; + __u8 num_output_task_status; + __u16 flags; + __u16 reserved; + + __u64 prefences; + __u64 postfences; + + __u64 input_task_status; + __u64 output_task_status; + + __u32 num_operations; + __u32 num_addresses; + __u64 operation_desc; + + __u64 surface_desc; + __u64 address_list; +}; + +struct nvdla_fence { + __u32 type; +#define NVDLA_FENCE_TYPE_SYNCPT 0 +#define NVDLA_FENCE_TYPE_SYNC_FD 1 + __u32 syncpoint_index; + __u32 syncpoint_value; + __u32 sync_fd; +}; + +struct nvdla_task_surface { + __u64 format; + __u32 handle; + __u32 offset; +}; + +struct nvdla_task_roi { + __u32 handle; + __u32 offset; +}; + +struct nvdla_task_status_handle { + __u32 handle; + __u32 reserved; + __u64 offset; +}; + #define NVHOST_NVDLA_IOCTL_MAGIC 'D' #define NVDLA_IOCTL_CTRL_PING \ @@ -47,9 +104,10 @@ struct nvdla_ctrl_pin_unpin_args { _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 2, struct nvdla_ctrl_pin_unpin_args) #define NVDLA_IOCTL_CTRL_UNPIN \ _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_ctrl_pin_unpin_args) - +#define NVDLA_IOCTL_CTRL_SUBMIT \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_ctrl_submit_args) #define NVDLA_IOCTL_CTRL_LAST \ - _IOC_NR(NVDLA_IOCTL_CTRL_UNPIN) + _IOC_NR(NVDLA_IOCTL_CTRL_SUBMIT) #define NVDLA_IOCTL_CTRL_MAX_ARG_SIZE \ sizeof(struct nvdla_ctrl_pin_unpin_args) -- cgit v1.2.2 From 37febd472a4920976c841fadb37a9a2aae76d0f4 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Wed, 27 Jul 2016 14:19:08 +0530 Subject: video: tegra: host: dla: add basic tasklist support - fix include files path in makefile - fix ioctl include header file path - update comments in doxygen format add support to submit task to engine as per tasklist management protocol - maintain list of tasks under assigned queue with ref counts - allocates task to maintain list of fences and update them - dma alloc task descriptor and action list and update them - submit tasks one by one and send received fence back to application - register for syncpoint notifier with nvhost for completion of fence - on fence completion interrupt handler, cleanup task Jira DLA-52 Change-Id: Ibe385f47dc9f17dda79cca3daf29b89218dc7289 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1191495 Reviewed-by: Prashant Gaikwad GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- include/linux/nvhost_nvdla_ioctl.h | 69 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 17 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 06f4f1011..1db5d710e 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -28,17 +28,42 @@ #define __user #endif +/** + * struct nvdla_ctrl_ping_args structure for ping data + * + * @in_challenge challenge data to be sent + * @out_response response/CRC on challenge data from engine + * + */ struct nvdla_ctrl_ping_args { __u32 in_challenge; __u32 out_response; }; + +/** + * struct nvdla_ctrl_pin_unpin_args strcture args for buffer pin/unpin + * + * @buffers list of buffers to pin/unpin'ed + * @num_buffers number of buffers count + * @reserved reserved for future use + * + */ struct nvdla_ctrl_pin_unpin_args { __u64 buffers; __u32 num_buffers; __u32 reserved; }; +/** + * struct nvdla_ctrl_submit_args structure for task submit + * + * @tasks pointer to task list + * @num_tasks number of tasks count + * @flags flags for task submit, like atomic + * @version version of task structure + * + */ struct nvdla_ctrl_submit_args { __u64 tasks; __u16 num_tasks; @@ -48,6 +73,25 @@ struct nvdla_ctrl_submit_args { __u32 version; }; +/** + * struct nvdla_ctrl_ioctl_submit_task structure for single task information + * + * @num_prefences number of pre-fences in task + * @num_postfences number of post-fences in task + * @num_input_task_status number of input task status + * @num_output_task_status number of output task status + * @flags flags for bitwise task info embeddeing + * @reserved reserved for future use + * @prefences pointer to pre-fence struct table + * @postfences pointer to post-fence struct table + * @input_task_status pointer to input task status struct table + * @output_task_status pointer to output task status struct table + * @num_operations number of operations for a task + * @num_addresses total number of addressed passed in structure + * @surface_desc pointer to surface descriptor + * @address_list pointer to address list + * + */ struct nvdla_ctrl_ioctl_submit_task { __u8 num_prefences; __u8 num_postfences; @@ -70,6 +114,14 @@ struct nvdla_ctrl_ioctl_submit_task { __u64 address_list; }; +/** + * struct nvdla_fence structure for passing fence information + * + * @type type of fence: syncpoint, Linux Sync Fd + * @syncpoint_index syncpoint id + * @syncpoint_value value of syncpoint id + * @sync_fd Linux sync FD handle + */ struct nvdla_fence { __u32 type; #define NVDLA_FENCE_TYPE_SYNCPT 0 @@ -79,23 +131,6 @@ struct nvdla_fence { __u32 sync_fd; }; -struct nvdla_task_surface { - __u64 format; - __u32 handle; - __u32 offset; -}; - -struct nvdla_task_roi { - __u32 handle; - __u32 offset; -}; - -struct nvdla_task_status_handle { - __u32 handle; - __u32 reserved; - __u64 offset; -}; - #define NVHOST_NVDLA_IOCTL_MAGIC 'D' #define NVDLA_IOCTL_CTRL_PING \ -- cgit v1.2.2 From c4e510fb1451c3af2bea2352725e8d1607e8b5b7 Mon Sep 17 00:00:00 2001 From: Prashant Gaikwad Date: Thu, 15 Sep 2016 01:29:18 +0530 Subject: video: tegra: host: nvdla: add offset to memory handles Use offset and memory handle to calculate IOVA address for descriptors. It allows using single buffer in user space for all descriptors. Jira DLA-176 Change-Id: I141efa7fc8662be8aa4b5c3bd2ea7a369a90769a Signed-off-by: Prashant Gaikwad Reviewed-on: http://git-master/r/1220956 --- include/linux/nvhost_nvdla_ioctl.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 1db5d710e..b0774d633 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -73,6 +73,18 @@ struct nvdla_ctrl_submit_args { __u32 version; }; +/** + * struct nvdla_ctrl_mem_handle structure for memory handles + * + * @handle handle to buffer allocated in userspace + * @offset offset in buffer + * + */ +struct nvdla_ctrl_mem_handle { + __u32 handle; + __u32 offset; +}; + /** * struct nvdla_ctrl_ioctl_submit_task structure for single task information * @@ -88,7 +100,8 @@ struct nvdla_ctrl_submit_args { * @output_task_status pointer to output task status struct table * @num_operations number of operations for a task * @num_addresses total number of addressed passed in structure - * @surface_desc pointer to surface descriptor + * @operation_desc pointer to operation descriptor list + * @surface_desc pointer to surface descriptor list * @address_list pointer to address list * */ @@ -108,10 +121,9 @@ struct nvdla_ctrl_ioctl_submit_task { __u32 num_operations; __u32 num_addresses; - __u64 operation_desc; - - __u64 surface_desc; - __u64 address_list; + struct nvdla_ctrl_mem_handle operation_desc; + struct nvdla_ctrl_mem_handle surface_desc; + struct nvdla_ctrl_mem_handle address_list; }; /** -- cgit v1.2.2 From d77caf2cba2e02a3fcd8960f41ca8cc4c12bf26d Mon Sep 17 00:00:00 2001 From: Prashant Gaikwad Date: Thu, 15 Sep 2016 19:58:01 +0530 Subject: video: tegra: host: nvdla: add more info to task Add below information to task descriptor - Address list - LUT data - Dynamic ROI Jira DLA-176 Change-Id: I067025da34a68a2d81c5e3829ac76c516ed8754b Signed-off-by: Prashant Gaikwad Reviewed-on: http://git-master/r/1221382 --- include/linux/nvhost_nvdla_ioctl.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index b0774d633..aba5ff554 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -120,9 +120,16 @@ struct nvdla_ctrl_ioctl_submit_task { __u64 output_task_status; __u32 num_operations; - __u32 num_addresses; + __u32 num_luts; struct nvdla_ctrl_mem_handle operation_desc; struct nvdla_ctrl_mem_handle surface_desc; + struct nvdla_ctrl_mem_handle lut_data; + + __u8 dynamic_roi; + struct nvdla_ctrl_mem_handle roi_desc_array; + struct nvdla_ctrl_mem_handle surface; + + __u32 num_addresses; struct nvdla_ctrl_mem_handle address_list; }; -- cgit v1.2.2 From 842fb9099d984d12eae833e22cbd4bdcd3fecbf6 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Thu, 1 Dec 2016 16:52:59 +0530 Subject: video: tegra: host: dla: correct IOCTL parameters names - this is cosmetic change to remove _ctrl_ from interface fields and params Change-Id: Ibb2aad75755fea158015f9f756c5b844a8984ded Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1263102 GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad --- include/linux/nvhost_nvdla_ioctl.h | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index aba5ff554..41a4918fe 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -29,34 +29,34 @@ #endif /** - * struct nvdla_ctrl_ping_args structure for ping data + * struct nvdla_ping_args structure for ping data * * @in_challenge challenge data to be sent * @out_response response/CRC on challenge data from engine * */ -struct nvdla_ctrl_ping_args { +struct nvdla_ping_args { __u32 in_challenge; __u32 out_response; }; /** - * struct nvdla_ctrl_pin_unpin_args strcture args for buffer pin/unpin + * struct nvdla_pin_unpin_args strcture args for buffer pin/unpin * * @buffers list of buffers to pin/unpin'ed * @num_buffers number of buffers count * @reserved reserved for future use * */ -struct nvdla_ctrl_pin_unpin_args { +struct nvdla_pin_unpin_args { __u64 buffers; __u32 num_buffers; __u32 reserved; }; /** - * struct nvdla_ctrl_submit_args structure for task submit + * struct nvdla_submit_args structure for task submit * * @tasks pointer to task list * @num_tasks number of tasks count @@ -64,7 +64,7 @@ struct nvdla_ctrl_pin_unpin_args { * @version version of task structure * */ -struct nvdla_ctrl_submit_args { +struct nvdla_submit_args { __u64 tasks; __u16 num_tasks; #define MAX_TASKS_PER_SUBMIT 32 @@ -74,19 +74,19 @@ struct nvdla_ctrl_submit_args { }; /** - * struct nvdla_ctrl_mem_handle structure for memory handles + * struct nvdla_mem_handle structure for memory handles * * @handle handle to buffer allocated in userspace * @offset offset in buffer * */ -struct nvdla_ctrl_mem_handle { +struct nvdla_mem_handle { __u32 handle; __u32 offset; }; /** - * struct nvdla_ctrl_ioctl_submit_task structure for single task information + * struct nvdla_ioctl_submit_task structure for single task information * * @num_prefences number of pre-fences in task * @num_postfences number of post-fences in task @@ -105,7 +105,7 @@ struct nvdla_ctrl_mem_handle { * @address_list pointer to address list * */ -struct nvdla_ctrl_ioctl_submit_task { +struct nvdla_ioctl_submit_task { __u8 num_prefences; __u8 num_postfences; __u8 num_input_task_status; @@ -121,16 +121,16 @@ struct nvdla_ctrl_ioctl_submit_task { __u32 num_operations; __u32 num_luts; - struct nvdla_ctrl_mem_handle operation_desc; - struct nvdla_ctrl_mem_handle surface_desc; - struct nvdla_ctrl_mem_handle lut_data; + struct nvdla_mem_handle operation_desc; + struct nvdla_mem_handle surface_desc; + struct nvdla_mem_handle lut_data; __u8 dynamic_roi; - struct nvdla_ctrl_mem_handle roi_desc_array; - struct nvdla_ctrl_mem_handle surface; + struct nvdla_mem_handle roi_desc_array; + struct nvdla_mem_handle surface; __u32 num_addresses; - struct nvdla_ctrl_mem_handle address_list; + struct nvdla_mem_handle address_list; }; /** @@ -152,18 +152,18 @@ struct nvdla_fence { #define NVHOST_NVDLA_IOCTL_MAGIC 'D' -#define NVDLA_IOCTL_CTRL_PING \ - _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 1, struct nvdla_ctrl_ping_args) -#define NVDLA_IOCTL_CTRL_PIN \ - _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 2, struct nvdla_ctrl_pin_unpin_args) -#define NVDLA_IOCTL_CTRL_UNPIN \ - _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_ctrl_pin_unpin_args) -#define NVDLA_IOCTL_CTRL_SUBMIT \ - _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_ctrl_submit_args) -#define NVDLA_IOCTL_CTRL_LAST \ - _IOC_NR(NVDLA_IOCTL_CTRL_SUBMIT) - -#define NVDLA_IOCTL_CTRL_MAX_ARG_SIZE \ - sizeof(struct nvdla_ctrl_pin_unpin_args) +#define NVDLA_IOCTL_PING \ + _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 1, struct nvdla_ping_args) +#define NVDLA_IOCTL_PIN \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 2, struct nvdla_pin_unpin_args) +#define NVDLA_IOCTL_UNPIN \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_pin_unpin_args) +#define NVDLA_IOCTL_SUBMIT \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_submit_args) +#define NVDLA_IOCTL_LAST \ + _IOC_NR(NVDLA_IOCTL_SUBMIT) + +#define NVDLA_IOCTL_MAX_ARG_SIZE \ + sizeof(struct nvdla_pin_unpin_args) #endif /* __LINUX_NVHOST_NVDLA_IOCTL_H */ -- cgit v1.2.2 From d56b20c03b25fa0422cd4da0775de69a8016b58b Mon Sep 17 00:00:00 2001 From: Prashant Gaikwad Date: Wed, 23 Nov 2016 17:54:20 +0530 Subject: video: tegra: host: nvdla: update task descriptor All network related information is now added to network descriptor which is created by UMD and used by firmware. Remove that information from task descriptor and keep only address list in task descriptor for IOVA translation. Jira DLA-148 Change-Id: Ie25e5297a58cd0320f8ae994c1bd1fa670306594 Signed-off-by: Prashant Gaikwad Reviewed-on: http://git-master/r/1267278 Reviewed-by: Automatic_Commit_Validation_User --- include/linux/nvhost_nvdla_ioctl.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 41a4918fe..5e9d82bd1 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -98,10 +98,7 @@ struct nvdla_mem_handle { * @postfences pointer to post-fence struct table * @input_task_status pointer to input task status struct table * @output_task_status pointer to output task status struct table - * @num_operations number of operations for a task * @num_addresses total number of addressed passed in structure - * @operation_desc pointer to operation descriptor list - * @surface_desc pointer to surface descriptor list * @address_list pointer to address list * */ @@ -119,16 +116,6 @@ struct nvdla_ioctl_submit_task { __u64 input_task_status; __u64 output_task_status; - __u32 num_operations; - __u32 num_luts; - struct nvdla_mem_handle operation_desc; - struct nvdla_mem_handle surface_desc; - struct nvdla_mem_handle lut_data; - - __u8 dynamic_roi; - struct nvdla_mem_handle roi_desc_array; - struct nvdla_mem_handle surface; - __u32 num_addresses; struct nvdla_mem_handle address_list; }; -- cgit v1.2.2 From a4ccef286a37ddfcc16b9bb5a11b7fd6bbe3cd10 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Tue, 20 Dec 2016 17:09:24 +0530 Subject: video: tegra: host: dla: add semaphore support for prefences - this adds semaphore/memsignal support in prefences - while updating task descriptor, does pinning of UMD semaphore handle and received dma_addr added as preaction Jira DLA-161 Change-Id: If3695b0cca29d485c04b93a83848d50ad81dd9fd Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1274302 Reviewed-by: Prashant Gaikwad GVS: Gerrit_Virtual_Submit --- include/linux/nvhost_nvdla_ioctl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 5e9d82bd1..e5eef1554 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -132,9 +132,13 @@ struct nvdla_fence { __u32 type; #define NVDLA_FENCE_TYPE_SYNCPT 0 #define NVDLA_FENCE_TYPE_SYNC_FD 1 +#define NVDLA_FENCE_TYPE_SEMAPHORE 2 __u32 syncpoint_index; __u32 syncpoint_value; __u32 sync_fd; + __u32 sem_handle; + __u32 sem_offset; + __u32 sem_val; }; #define NVHOST_NVDLA_IOCTL_MAGIC 'D' -- cgit v1.2.2 From e478d722d85da23a75d929faf8274cc5c52cbeba Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Wed, 21 Dec 2016 10:17:57 +0530 Subject: video: tegra: host: dla: add TIMESTAMP semaphore - this adds TIMESTAMP semaphore for postactions - TIMESTAMP semaphore is similar to default SEMAPHORE with added field to update timestamp Jira DLA-197 Change-Id: I2e663c7bfcf5e75727c9ac3a1c41ce333e45cf15 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1274611 Reviewed-by: Prashant Gaikwad GVS: Gerrit_Virtual_Submit --- include/linux/nvhost_nvdla_ioctl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index e5eef1554..8cb7bfc45 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -133,6 +133,7 @@ struct nvdla_fence { #define NVDLA_FENCE_TYPE_SYNCPT 0 #define NVDLA_FENCE_TYPE_SYNC_FD 1 #define NVDLA_FENCE_TYPE_SEMAPHORE 2 +#define NVDLA_FENCE_TYPE_TS_SEMAPHORE 3 __u32 syncpoint_index; __u32 syncpoint_value; __u32 sync_fd; -- cgit v1.2.2 From bf0d9672c51320ce3066b0112228a5f0480d5603 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Thu, 22 Dec 2016 12:15:13 +0530 Subject: video: tegra: host: dla: add support for input task status - input task status notifier added as preactions and if task status of preaction matches with task status then task can proceed for execution - this adds support adding input status notifier: alloc memory for task and task descriptor, copy and pin user memory, send IOVA of status notifier user memory to engine Jira DLA-62 Change-Id: Ibfa3ea0a15dd173fc279ac58b1ab85d2c2e77d82 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1275539 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/nvhost_nvdla_ioctl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 8cb7bfc45..60f823a93 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -142,6 +142,20 @@ struct nvdla_fence { __u32 sem_val; }; +/** + * struct nvdla_status_notify structure for passing status notify information + * + * @handle handle to buffer allocated in userspace + * @offset offset in buffer + * @status status + * + */ +struct nvdla_status_notify { + __u32 handle; + __u32 offset; + __u32 status; +}; + #define NVHOST_NVDLA_IOCTL_MAGIC 'D' #define NVDLA_IOCTL_PING \ -- cgit v1.2.2 From 5a0dfce1b2803937fe6f780fbe6ad1f99ed5bfba Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Thu, 29 Dec 2016 16:43:56 +0530 Subject: video: tegra: host: dla: add queue operations cmd - define and add ioctl to set queue operations like, suspend and resume. - on validating user argument, pass command to engine to suspend and resume. - on receiving this command, firmware just update queue status as sent and doesn't interrupt ongoing task or queue work. Jira DLA-218 Change-Id: I13f5d8822d920961277884c64534daaf64d812be Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1278192 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Prashant Gaikwad GVS: Gerrit_Virtual_Submit --- include/linux/nvhost_nvdla_ioctl.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 60f823a93..02926b1fd 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -3,7 +3,7 @@ * * Tegra NvDLA Driver * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -28,6 +28,18 @@ #define __user #endif +/** + * struct nvdla_queue_stat_args strcture + * + * @status queue status flags + * + */ +struct nvdla_queue_status_args { +#define NVDLA_QUEUE_FLAGS_SUSPEND (1 << 0) +#define NVDLA_QUEUE_FLAGS_RESUME (1 << 1) + __u64 status; +}; + /** * struct nvdla_ping_args structure for ping data * @@ -166,8 +178,10 @@ struct nvdla_status_notify { _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 3, struct nvdla_pin_unpin_args) #define NVDLA_IOCTL_SUBMIT \ _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_submit_args) +#define NVDLA_IOCTL_SET_QUEUE_STATUS \ + _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 5, struct nvdla_queue_status_args) #define NVDLA_IOCTL_LAST \ - _IOC_NR(NVDLA_IOCTL_SUBMIT) + _IOC_NR(NVDLA_IOCTL_SET_QUEUE_STATUS) #define NVDLA_IOCTL_MAX_ARG_SIZE \ sizeof(struct nvdla_pin_unpin_args) -- cgit v1.2.2 From ce5b38eb1218f3dd6d4275fc704cbf256af8d159 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Mon, 2 Jan 2017 11:37:23 +0200 Subject: video: tegra: host: Add device data for NVENC1 Add the device data structure and required class ID and MLOCK ID defines for NVENC1. Jira HOSTX-158 Signed-off-by: Mikko Perttunen Change-Id: Icbd88c93557fe4a34d377a1119f36efbf84e1dca Reviewed-on: http://git-master/r/1287441 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/nvhost_ioctl_t194.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/linux/nvhost_ioctl_t194.h (limited to 'include/linux') diff --git a/include/linux/nvhost_ioctl_t194.h b/include/linux/nvhost_ioctl_t194.h new file mode 100644 index 000000000..0b7ee446f --- /dev/null +++ b/include/linux/nvhost_ioctl_t194.h @@ -0,0 +1,30 @@ +/* + * include/linux/nvhost_ioctl_t194.h + * + * Tegra graphics host driver + * + * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __LINUX_NVHOST_IOCTL_T194_H +#define __LINUX_NVHOST_IOCTL_T194_H + +enum nvhost_module_id_t194 { + NVHOST_MODULE_NVENC1 = 12, +}; + +#endif -- cgit v1.2.2 From 616b709f02dd0cda47ae0ba02b1b3eb0ffb1e389 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Tue, 24 Jan 2017 15:42:49 +0530 Subject: video: tegra: host: dla: remove updating user bufffer with IOVA This patch addresses two fixes: [1] Removes updating user buffers with IOVA. - In address translation of address list of a tasks, handle and offset were replaced with actual IOVA into user buffer and same buffer was shared with engine. This approach is error prone. - To fix this issue, kernel keeps IOVA list and shares with engine. - In task submit, mem_handle list from user and updated in kernel copy of task. - and while pinning user buffers, engine shared list updated with actual dma address retrieved from submit pin call. [2] Remove dynamic allocation required in address translation - Required memory of 'kernel copy address list' and 'engine shared address list' both allocated from queue memory pool. - and assigned and released along with task data. DLA-286 Change-Id: I4d5a322adaff25e6e587d3305847540757850c77 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1293124 Reviewed-by: Prashant Gaikwad GVS: Gerrit_Virtual_Submit --- include/linux/nvhost_nvdla_ioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 02926b1fd..56044c85f 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -119,6 +119,8 @@ struct nvdla_ioctl_submit_task { __u8 num_postfences; __u8 num_input_task_status; __u8 num_output_task_status; +#define NVDLA_MAX_BUFFERS_PER_TASK (256) + __u32 num_addresses; __u16 flags; __u16 reserved; @@ -127,9 +129,7 @@ struct nvdla_ioctl_submit_task { __u64 input_task_status; __u64 output_task_status; - - __u32 num_addresses; - struct nvdla_mem_handle address_list; + __u64 address_list; }; /** -- cgit v1.2.2 From aa9280900f4b3148f807c3f88d21144a655d2f5d Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Wed, 8 Feb 2017 16:55:31 +0200 Subject: video: tegra: host: Add device data for NVDEC1 Add the device data structure and required class ID and MLOCK ID defines for NVDEC1. Jira HOSTX-177 Change-Id: Ib3676ac02e08157d2c88424394810a5dd97400b6 Signed-off-by: Mikko Perttunen Reviewed-on: http://git-master/r/1301453 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/nvhost_ioctl_t194.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/nvhost_ioctl_t194.h b/include/linux/nvhost_ioctl_t194.h index 0b7ee446f..6606c84dd 100644 --- a/include/linux/nvhost_ioctl_t194.h +++ b/include/linux/nvhost_ioctl_t194.h @@ -25,6 +25,7 @@ enum nvhost_module_id_t194 { NVHOST_MODULE_NVENC1 = 12, + NVHOST_MODULE_NVDEC1 = 13, }; #endif -- cgit v1.2.2 From 301048cb839a1310e65240ddb97f94163c5b5459 Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Thu, 23 Mar 2017 08:43:34 +0530 Subject: video: tegra: host: dla: add IOCTL to send fw version and q status - Add IOCTL to send DLA firmware version. - If DLA engine is not powered on before IOCTL call, poweron engine and send version. - Add IOCTL to send queue status, like current fence Jira DLA-316 Jira DLA-336 Change-Id: I2367446f99809253c4b765b751d66712f969442c Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/1326511 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad Reviewed-by: Amit Sharma (SW-TEGRA) --- include/linux/nvhost_nvdla_ioctl.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index 56044c85f..aa5fe61de 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -85,6 +85,28 @@ struct nvdla_submit_args { __u32 version; }; +/** + * struct nvdla_get_fw_ver_args strcture + * + * @version Firmware version + * + */ +struct nvdla_get_fw_ver_args { + __u32 version; +}; + +/** + * struct nvdla_get_q_status_args strcture + * + * @id queue id + * @fence fence assigned to queue + * + */ +struct nvdla_get_q_status_args { + __u32 id; + __u64 fence; +}; + /** * struct nvdla_mem_handle structure for memory handles * @@ -180,8 +202,12 @@ struct nvdla_status_notify { _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 4, struct nvdla_submit_args) #define NVDLA_IOCTL_SET_QUEUE_STATUS \ _IOW(NVHOST_NVDLA_IOCTL_MAGIC, 5, struct nvdla_queue_status_args) +#define NVDLA_IOCTL_GET_FIRMWARE_VERSION \ + _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 6, struct nvdla_get_fw_ver_args) +#define NVDLA_IOCTL_GET_QUEUE_STATUS \ + _IOWR(NVHOST_NVDLA_IOCTL_MAGIC, 7, struct nvdla_get_q_status_args) #define NVDLA_IOCTL_LAST \ - _IOC_NR(NVDLA_IOCTL_SET_QUEUE_STATUS) + _IOC_NR(NVDLA_IOCTL_GET_QUEUE_STATUS) #define NVDLA_IOCTL_MAX_ARG_SIZE \ sizeof(struct nvdla_pin_unpin_args) -- cgit v1.2.2 From 45e5983944477dbb47e6a7cbf8f0a56833cf33bc Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 12 May 2017 12:35:40 +0530 Subject: video: tegra: host: move exported APIs to public header Exported APIs like below are defined in private header file nvhost_syncpt_unit_interface.h nvhost_syncpt_unit_interface_get_aperture() nvhost_syncpt_unit_interface_get_byte_offset() This causes linking problems if these functions are needed by some other driver outside nvhost Hence move these exported APIs into a new public header in include/linux/nvhost_t194.h Change-Id: Ib70177da71c2cc6aee1c6da2668b0a92ea01ccf7 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1480588 Reviewed-by: Arto Merilainen GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu Tested-by: Seshendra Gadagottu Reviewed-by: Terje Bergstrom --- include/linux/nvhost_t194.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/linux/nvhost_t194.h (limited to 'include/linux') diff --git a/include/linux/nvhost_t194.h b/include/linux/nvhost_t194.h new file mode 100644 index 000000000..f7b7dbdeb --- /dev/null +++ b/include/linux/nvhost_t194.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __LINUX_NVHOST_T194_H__ +#define __LINUX_NVHOST_T194_H__ + +int nvhost_syncpt_unit_interface_get_aperture( + struct platform_device *host_pdev, + phys_addr_t *base, + size_t *size); + +u32 nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id); + +#endif /* __LINUX_NVHOST_T194_H__ */ -- cgit v1.2.2 From 21d2d79170398113d8eb63abb3e931e322cf035d Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Mon, 24 Apr 2017 13:56:20 +0530 Subject: video: tegra: host: nvdla: add task timeout support - pass task timeout parameter from user to engine for book keeping of task runtime - as stack framesize crossing limit of 2048 bytes, reduce number of maximum task can be submitted in one go. Jira DLA-374 Bug 200302518 Change-Id: I99d3706d9d80ac0201529d68c0a959cdd22a1488 Signed-off-by: Shridhar Rasal Signed-off-by: Prashant Gaikwad Reviewed-on: http://git-master/r/1468355 Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Inamdar Sharif Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- include/linux/nvhost_nvdla_ioctl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/nvhost_nvdla_ioctl.h b/include/linux/nvhost_nvdla_ioctl.h index aa5fe61de..60893e813 100644 --- a/include/linux/nvhost_nvdla_ioctl.h +++ b/include/linux/nvhost_nvdla_ioctl.h @@ -79,7 +79,7 @@ struct nvdla_pin_unpin_args { struct nvdla_submit_args { __u64 tasks; __u16 num_tasks; -#define MAX_TASKS_PER_SUBMIT 32 +#define MAX_TASKS_PER_SUBMIT 24 #define NVDLA_SUBMIT_FLAGS_ATOMIC (1 << 0) __u16 flags; __u32 version; @@ -134,6 +134,7 @@ struct nvdla_mem_handle { * @output_task_status pointer to output task status struct table * @num_addresses total number of addressed passed in structure * @address_list pointer to address list + * @timeout task timeout * */ struct nvdla_ioctl_submit_task { @@ -152,6 +153,7 @@ struct nvdla_ioctl_submit_task { __u64 input_task_status; __u64 output_task_status; __u64 address_list; + __u64 timeout; }; /** -- cgit v1.2.2