NV services: Difference between revisions
No edit summary |
|||
Line 167: | Line 167: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __out u32 value; | ||
}; | }; | ||
Line 175: | Line 175: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
}; | }; | ||
Line 182: | Line 182: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __in u32 thresh; | ||
s32 | __in s32 timeout; | ||
}; | }; | ||
Line 191: | Line 191: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __in u32 lock; // (0==unlock; 1==lock) | ||
}; | }; | ||
Line 199: | Line 199: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __in u32 num_offsets; | ||
u32 | __in u32 block_size; | ||
u32 | __in u32 offsets; | ||
u32 | __in u32 values; | ||
u32 | __in u32 write; | ||
}; | }; | ||
Line 211: | Line 211: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __in u32 thresh; | ||
s32 | __in s32 timeout; | ||
u32 | __out u32 value; | ||
}; | }; | ||
Line 221: | Line 221: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __out u32 value; | ||
}; | }; | ||
Line 229: | Line 229: | ||
struct { | struct { | ||
u32 | __in u32 event_id; // ranges from 0x01 to 0x3F | ||
}; | }; | ||
Line 236: | Line 236: | ||
struct { | struct { | ||
u32 | __in u32 unk0; | ||
u32 | __in u32 unk1; | ||
s32 __timeout; | __in s32 __timeout; | ||
u32 __event; | __inout u32 __event; // in=event_id; out=result | ||
}; | }; | ||
Line 246: | Line 246: | ||
struct { | struct { | ||
u32 | __in u32 unk0; | ||
u32 | __in u32 unk1; | ||
s32 | __in s32 timeout; | ||
u32 | __inout u32 event; // in=event_id; out=result | ||
}; | }; | ||
Line 256: | Line 256: | ||
struct { | struct { | ||
u32 | __in u32 event_id; // ranges from 0x01 to 0x3F | ||
}; | }; | ||
Line 263: | Line 263: | ||
struct { | struct { | ||
u32 | __in u32 event_id; // ranges from 0x01 to 0x3F | ||
}; | }; | ||
Line 270: | Line 270: | ||
struct { | struct { | ||
u64 | __in u64 events; // 64-bit bitfield where each bit represents one event | ||
}; | }; | ||
Line 316: | Line 316: | ||
struct { | struct { | ||
u32 | __in u32 size; | ||
u32 | __out u32 handle; | ||
}; | }; | ||
Line 324: | Line 324: | ||
struct { | struct { | ||
u32 | __in u32 id; | ||
u32 | __out u32 handle; | ||
}; | }; | ||
Line 332: | Line 332: | ||
struct { | struct { | ||
u32 | __in u32 handle; | ||
u32 | __in u32 heapmask; | ||
u32 | __in u32 flags; // (0=read-only, 1=read-write) | ||
u32 | __in u32 align; | ||
u8 | __in u8 kind; | ||
u8 | u8 pad[7]; | ||
u64 | __in u64 addr; | ||
}; | }; | ||
Line 345: | Line 345: | ||
struct { | struct { | ||
u32 | __in u32 handle; | ||
u32 | u32 pad; | ||
u64 | __out u64 refcount; | ||
u32 | __out u32 size; | ||
u32 | __out u32 flags; // 1=NOT_FREED_YET | ||
}; | }; | ||
Line 356: | Line 356: | ||
struct { | struct { | ||
u32 | __in u32 handle; | ||
u32 | __in u32 param; // 1=SIZE, 2=ALIGNMENT, 3=BASE (returns error), 4=HEAP (always 0x40000000), 5=KIND, 6=COMPR (unused) | ||
u32 | __out u32 result; | ||
}; | }; | ||
Line 365: | Line 365: | ||
struct { | struct { | ||
u32 | __out u32 id; | ||
u32 | __in u32 handle; | ||
}; | }; | ||
Line 566: | Line 566: | ||
struct { | struct { | ||
u32 | __in u32 fd; | ||
}; | }; | ||
Line 573: | Line 573: | ||
struct { | struct { | ||
u32 | __in u32 pages; | ||
u32 | __in u32 page_size; | ||
u32 | __in u32 flags; | ||
u32 | u32 pad; | ||
union { | union { | ||
u64 | __out u64 offset; | ||
u64 | __in u64 align; | ||
}; | }; | ||
}; | }; | ||
Line 585: | Line 585: | ||
=== NVGPU_AS_IOCTL_FREE_SPACE === | === NVGPU_AS_IOCTL_FREE_SPACE === | ||
struct { | struct { | ||
u64 | __in u64 offset; | ||
u32 | __in u32 pages; | ||
u32 | __in u32 page_size; | ||
}; | }; | ||
Line 596: | Line 596: | ||
struct { | struct { | ||
u32 | __in u32 flags; // bit0: fixed_offset, bit2: cacheable | ||
u32 | u32 pad; | ||
u32 | __in u32 nvmap_handle; | ||
u32 | __inout u32 page_size; // 0 means don't care | ||
union { | union { | ||
u64 | __out u64 offset; | ||
u64 | __in u64 align; | ||
}; | }; | ||
}; | }; | ||
Line 612: | Line 612: | ||
struct { | struct { | ||
u32 | __in u32 flags; // bit0: fixed_offset, bit2: cacheable | ||
u32 | __in u32 kind; // -1 is default | ||
u32 | __in u32 nvmap_handle; | ||
u32 | __inout u32 page_size; // 0 means don't care | ||
u64 | __in u64 buffer_offset; | ||
u64 | __in u64 mapping_size; | ||
u64 | __out u64 offset; | ||
}; | }; | ||
Line 628: | Line 628: | ||
struct { | struct { | ||
u32 | __in u32 big_page_size; // depends on GPU's available_big_page_sizes; 0=default | ||
s32 | __in s32 as_fd; // ignored; passes 0 | ||
u32 | __in u32 flags; // ignored; passes 0 | ||
u32 | __in u32 reserved; // ignored; passes 0 | ||
}; | }; | ||
Line 638: | Line 638: | ||
struct va_region { | struct va_region { | ||
u64 | u64 offset; | ||
u32 | u32 page_size; | ||
u32 | u32 pad; | ||
u64 | u64 pages; | ||
}; | }; | ||
struct { | struct { | ||
u64 | u64 not_used; // (contained output user ptr on linux, ignored) | ||
u32 | __inout u32 bufsize; // forced to 2*sizeof(struct va_region) | ||
u32 | u32 pad; | ||
struct va_region | __out struct va_region regions[2]; | ||
}; | }; | ||
Line 655: | Line 655: | ||
struct { | struct { | ||
u32 | __in u32 big_page_size; // depends on GPU's available_big_page_sizes; 0=default | ||
s32 | __in s32 as_fd; // ignored; passes 0 | ||
u32 | __in u32 flags; // ignored; passes 0 | ||
u32 | __in u32 reserved; // ignored; passes 0 | ||
u64 | __in u64 unk0; | ||
u64 | __in u64 unk1; | ||
u64 | __in u64 unk2; | ||
}; | }; | ||
Line 744: | Line 744: | ||
Returns the GPU characteristics. Modified to return inline data instead of using a pointer. | Returns the GPU characteristics. Modified to return inline data instead of using a pointer. | ||
struct | struct gpu_characteristics { | ||
u32 | u32 arch; // 0x120 (NVGPU_GPU_ARCH_GM200) | ||
u32 | u32 impl; // 0xB (NVGPU_GPU_IMPL_GM20B) | ||
u32 | u32 rev; // 0xA1 (Revision A1) | ||
u32 | u32 num_gpc; // 0x1 | ||
u64 | u64 l2_cache_size; // 0x40000 | ||
u64 | u64 on_board_video_memory_size; // 0x0 (not used) | ||
u32 | u32 num_tpc_per_gpc; // 0x2 | ||
u32 | u32 bus_type; // 0x20 (NVGPU_GPU_BUS_TYPE_AXI) | ||
u32 | u32 big_page_size; // 0x20000 | ||
u32 | u32 compression_page_size; // 0x20000 | ||
u32 | u32 pde_coverage_bit_count; // 0x1B | ||
u32 | u32 available_big_page_sizes; // 0x30000 | ||
u32 | u32 gpc_mask; // 0x1 | ||
u32 | u32 sm_arch_sm_version; // 0x503 (Maxwell Generation 5.0.3?) | ||
u32 | u32 sm_arch_spa_version; // 0x503 (Maxwell Generation 5.0.3?) | ||
u32 | u32 sm_arch_warp_count; // 0x80 | ||
u32 | u32 gpu_va_bit_count; // 0x28 | ||
u32 | u32 reserved; // NULL | ||
u64 | u64 flags; // 0x55 | ||
u32 | u32 twod_class; // 0x902D (FERMI_TWOD_A) | ||
u32 | u32 threed_class; // 0xB197 (MAXWELL_B) | ||
u32 | u32 compute_class; // 0xB1C0 (MAXWELL_COMPUTE_B) | ||
u32 | u32 gpfifo_class; // 0xB06F (MAXWELL_CHANNEL_GPFIFO_A) | ||
u32 | u32 inline_to_memory_class; // 0xA140 (KEPLER_INLINE_TO_MEMORY_B) | ||
u32 | u32 dma_copy_class; // 0xB0B5 (MAXWELL_DMA_COPY_A) | ||
u32 | u32 max_fbps_count; // 0x1 | ||
u32 | u32 fbp_en_mask; // 0x0 (disabled) | ||
u32 | u32 max_ltc_per_fbp; // 0x2 | ||
u32 | u32 max_lts_per_ltc; // 0x1 | ||
u32 | u32 max_tex_per_tpc; // 0x0 (not supported) | ||
u32 | u32 max_gpc_count; // 0x1 | ||
u32 | u32 rop_l2_en_mask_0; // 0x21D70 (fuse_status_opt_rop_l2_fbp_r) | ||
u32 | u32 rop_l2_en_mask_1; // 0x0 | ||
u64 | u64 chipname; // 0x6230326D67 ("gm20b") | ||
u64 | u64 gr_compbit_store_base_hw; // 0x0 (not supported) | ||
}; | }; | ||
struct { | struct { | ||
u64 | __inout u64 gpu_characteristics_buf_size; // must not be NULL, but gets overwritten with 0xA0=max_size | ||
u64 | __in u64 gpu_characteristics_buf_addr; // ignored, but must not be NULL | ||
struct | __out struct gpu_characteristics gc; | ||
}; | }; | ||
Line 792: | Line 792: | ||
struct { | struct { | ||
u32 | __in u32 flush; // l2_flush | l2_invalidate << 1 | fb_flush << 2 | ||
u32 | u32 reserved; | ||
}; | }; | ||
Line 800: | Line 800: | ||
struct { | struct { | ||
u32 | __out u32 mask; // always 0x07 | ||
u32 | __out u32 flush; // active flush bit field | ||
}; | }; | ||
Line 891: | Line 891: | ||
struct { | struct { | ||
u32 | __in u32 nvmap_fd; | ||
}; | }; | ||
Line 898: | Line 898: | ||
struct { | struct { | ||
u32 | __in u32 num_entries; | ||
u32 | __in u32 flags; | ||
}; | }; | ||
Line 906: | Line 906: | ||
struct fence { | struct fence { | ||
u32 | u32 id; | ||
u32 | u32 value; | ||
}; | }; | ||
struct gpfifo_entry { | struct gpfifo_entry { | ||
u32 | u32 entry0; | ||
u32 | u32 entry1; | ||
}; | }; | ||
struct { | struct { | ||
u64 | __in u64 gpfifo; // (ignored) pointer to gpfifo fence structs | ||
u32 | __in u32 num_entries; // number of fence objects being submitted | ||
u32 | __in u32 flags; | ||
struct fence | __out struct fence fence_out; // returned new fence object for others to wait on | ||
struct gpfifo_entry | __in struct gpfifo_entry entries[]; // depends on num_entries | ||
}; | }; | ||
Line 927: | Line 927: | ||
struct { | struct { | ||
u32 | __in u32 class_num; // 0x902D=2d, 0xB197=3d, 0xB1C0=compute, 0xA140=kepler, 0xB0B5=DMA, 0xB06F=channel_gpfifo | ||
u32 | __in u32 flags; | ||
u64 | __out u64 obj_id; // (ignored) used for FREE_OBJ_CTX ioctl, which is not supported | ||
}; | }; | ||
Line 936: | Line 936: | ||
struct { | struct { | ||
u64 | __in u64 offset; | ||
u64 | __in u64 size; | ||
u32 | __in u32 mem; // nvmap object handle | ||
u32 | __in u32 padding; | ||
}; | }; | ||
Line 946: | Line 946: | ||
struct { | struct { | ||
u32 | __in u32 priority; // 0x32 is low, 0x64 is medium and 0x96 is high | ||
}; | }; | ||
Line 965: | Line 965: | ||
struct { | struct { | ||
u32 | __in u32 cmd; // 0=disable, 1=enable, 2=clear | ||
u32 | __in u32 unk; // accepts 1 or 2 | ||
}; | }; | ||
Line 973: | Line 973: | ||
struct { | struct { | ||
u64 | __out u64 timestamp; // nanoseconds since Jan. 1, 1970 | ||
u32 | __out u32 info32; // error code | ||
u16 | __out u16 info16; // additional error info | ||
u16 | __inout u16 status; // always 0xFFFF | ||
}; | }; | ||
Line 983: | Line 983: | ||
struct { | struct { | ||
u32 | __in u32 num_entries; | ||
u32 | __in u32 flags; | ||
u32 | __in u32 unk0; // 1 works | ||
u32 | __in u32 unk1; | ||
u32 | __in u32 unk2; | ||
u32 | __in u32 unk3; | ||
u32 | __in u32 unk4; | ||
u32 | __in u32 unk5; | ||
}; | }; | ||