/* * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __NVGPU_ENABLED_H__ #define __NVGPU_ENABLED_H__ struct gk20a; #include /* * Available flags that describe what's enabled and what's not in the GPU. Each * flag here is defined by it's offset in a bitmap. */ #define NVGPU_IS_FMODEL 1 #define NVGPU_DRIVER_IS_DYING 2 #define NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP 3 /* * ECC flags */ /* SM LRF ECC is enabled */ #define NVGPU_ECC_ENABLED_SM_LRF 8 /* SM SHM ECC is enabled */ #define NVGPU_ECC_ENABLED_SM_SHM 9 /* TEX ECC is enabled */ #define NVGPU_ECC_ENABLED_TEX 10 /* L2 ECC is enabled */ #define NVGPU_ECC_ENABLED_LTC 11 /* * MM flags. */ #define NVGPU_MM_UNIFY_ADDRESS_SPACES 16 /* false if vidmem aperture actually points to sysmem */ #define NVGPU_MM_HONORS_APERTURE 17 /* unified or split memory with separate vidmem? */ #define NVGPU_MM_UNIFIED_MEMORY 18 /* kernel mode ce vidmem clearing channels need to be in a tsg */ #define NVGPU_MM_CE_TSG_REQUIRED 19 /* User-space managed address spaces support */ #define NVGPU_SUPPORT_USERSPACE_MANAGED_AS 20 /* IO coherence support is available */ #define NVGPU_SUPPORT_IO_COHERENCE 21 /* MAP_BUFFER_EX with partial mappings */ #define NVGPU_SUPPORT_PARTIAL_MAPPINGS 22 /* MAP_BUFFER_EX with sparse allocations */ #define NVGPU_SUPPORT_SPARSE_ALLOCS 23 /* Direct PTE kind control is supported (map_buffer_ex) */ #define NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL 24 /* * Host flags */ #define NVGPU_HAS_SYNCPOINTS 30 /* sync fence FDs are available in, e.g., submit_gpfifo */ #define NVGPU_SUPPORT_SYNC_FENCE_FDS 31 /* NVGPU_IOCTL_CHANNEL_CYCLE_STATS is available */ #define NVGPU_SUPPORT_CYCLE_STATS 32 /* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */ #define NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT 33 /* Both gpu driver and device support TSG */ #define NVGPU_SUPPORT_TSG 33 /* Fast deterministic submits with no job tracking are supported */ #define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING 34 /* Deterministic submits are supported even with job tracking */ #define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL 35 /* NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST is available */ #define NVGPU_SUPPORT_RESCHEDULE_RUNLIST 36 /* NVGPU_GPU_IOCTL_GET_EVENT_FD is available */ #define NVGPU_SUPPORT_DEVICE_EVENTS 37 /* FECS context switch tracing is available */ #define NVGPU_SUPPORT_FECS_CTXSW_TRACE 38 /* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */ #define NVGPU_SUPPORT_DETERMINISTIC_OPTS 39 /* * Security flags */ #define NVGPU_SEC_SECUREGPCCS 40 #define NVGPU_SEC_PRIVSECURITY 41 /* * PMU flags. */ /* perfmon enabled or disabled for PMU */ #define NVGPU_PMU_PERFMON 48 #define NVGPU_PMU_PSTATE 49 #define NVGPU_PMU_ZBC_SAVE 50 #define NVGPU_PMU_FECS_BOOTSTRAP_DONE 51 #define NVGPU_GPU_CAN_BLCG 52 #define NVGPU_GPU_CAN_SLCG 53 #define NVGPU_GPU_CAN_ELCG 54 /* Clock control support */ #define NVGPU_SUPPORT_CLOCK_CONTROLS 55 /* NVGPU_GPU_IOCTL_GET_VOLTAGE is available */ #define NVGPU_SUPPORT_GET_VOLTAGE 56 /* NVGPU_GPU_IOCTL_GET_CURRENT is available */ #define NVGPU_SUPPORT_GET_CURRENT 57 /* NVGPU_GPU_IOCTL_GET_POWER is available */ #define NVGPU_SUPPORT_GET_POWER 58 /* NVGPU_GPU_IOCTL_GET_TEMPERATURE is available */ #define NVGPU_SUPPORT_GET_TEMPERATURE 59 /* NVGPU_GPU_IOCTL_SET_THERM_ALERT_LIMIT is available */ #define NVGPU_SUPPORT_SET_THERM_ALERT_LIMIT 60 /* whether to run PREOS binary on dGPUs */ #define NVGPU_PMU_RUN_PREOS 61 /* set if ASPM is enabled; only makes sense for PCI */ #define NVGPU_SUPPORT_ASPM 62 /* * Must be greater than the largest bit offset in the above list. */ #define NVGPU_MAX_ENABLED_BITS 64 /** * nvgpu_is_enabled - Check if the passed flag is enabled. * * @g - The GPU. * @flag - Which flag to check. * * Returns true if the passed @flag is true; false otherwise. */ bool nvgpu_is_enabled(struct gk20a *g, int flag); /** * __nvgpu_set_enabled - Set the state of a flag. * * @g - The GPU. * @flag - Which flag to modify. * @state - The state to set the flag to. * * Set the state of the passed @flag to @state. This will return the previous * state of the passed @flag. */ bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state); int nvgpu_init_enabled_flags(struct gk20a *g); #endif