From 90aeab9dee07a63e4bac6d92646dfd80e65d2edd Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 10 Nov 2017 05:02:37 -0800 Subject: gpu: nvgpu: define preemption modes in common code We use linux specific graphics/compute preemption modes defined in uapi header (and of below form) in all over common code NVGPU_GRAPHICS_PREEMPTION_MODE_* NVGPU_COMPUTE_PREEMPTION_MODE_* Since common code should be independent of linux specific code, define new modes of the form in common code and used them everywhere NVGPU_PREEMPTION_MODE_GRAPHICS_* NVGPU_PREEMPTION_MODE_COMPUTE_* Add required parser functions to convert both the modes into each other For linux IOCTL NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE, we need to convert linux specific modes into common modes first before passing them to common code And to pass gpu characteristics to user space we need to first convert common modes into linux specific modes and then pass them to user space Jira NVGPU-392 Change-Id: I8c62c6859bdc1baa5b44eb31c7020e42d2462c8c Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1596930 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ioctl_channel.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_channel.h') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.h b/drivers/gpu/nvgpu/common/linux/ioctl_channel.h index 48caf9df..235d84ef 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.h +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.h @@ -32,4 +32,9 @@ extern const struct file_operations gk20a_channel_ops; u32 nvgpu_event_id_to_ioctl_channel_event_id(u32 event_id); u32 nvgpu_get_common_runlist_level(u32 level); + +u32 nvgpu_get_ioctl_graphics_preempt_mode_flags(u32 graphics_preempt_mode_flags); +u32 nvgpu_get_ioctl_compute_preempt_mode_flags(u32 compute_preempt_mode_flags); +u32 nvgpu_get_ioctl_graphics_preempt_mode(u32 graphics_preempt_mode); +u32 nvgpu_get_ioctl_compute_preempt_mode(u32 compute_preempt_mode); #endif -- cgit v1.2.2