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/gk20a/gr_gk20a.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index b437838f..3377df5d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -61,6 +61,13 @@ (PAGE_SIZE/(PATCH_CTX_SLOTS_REQUIRED_PER_ENTRY * sizeof(u32))) #define PATCH_CTX_ENTRIES_FROM_SIZE(size) (size/sizeof(u32)) +#define NVGPU_PREEMPTION_MODE_GRAPHICS_WFI (1 << 0) +#define NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP (1 << 1) + +#define NVGPU_PREEMPTION_MODE_COMPUTE_WFI (1 << 0) +#define NVGPU_PREEMPTION_MODE_COMPUTE_CTA (1 << 1) +#define NVGPU_PREEMPTION_MODE_COMPUTE_CILP (1 << 2) + struct channel_gk20a; struct nvgpu_warpstate; @@ -403,7 +410,6 @@ struct gr_gk20a { bool sw_ready; bool skip_ucode_init; - struct nvgpu_preemption_modes_rec preemption_mode_rec; #ifdef CONFIG_ARCH_TEGRA_18x_SOC struct gr_t18x t18x; #endif -- cgit v1.2.2