vc4_drm.h revision 7cdc0497
13f012e29Smrg/* 23f012e29Smrg * Copyright © 2014-2015 Broadcom 33f012e29Smrg * 43f012e29Smrg * Permission is hereby granted, free of charge, to any person obtaining a 53f012e29Smrg * copy of this software and associated documentation files (the "Software"), 63f012e29Smrg * to deal in the Software without restriction, including without limitation 73f012e29Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 83f012e29Smrg * and/or sell copies of the Software, and to permit persons to whom the 93f012e29Smrg * Software is furnished to do so, subject to the following conditions: 103f012e29Smrg * 113f012e29Smrg * The above copyright notice and this permission notice (including the next 123f012e29Smrg * paragraph) shall be included in all copies or substantial portions of the 133f012e29Smrg * Software. 143f012e29Smrg * 153f012e29Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 163f012e29Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 173f012e29Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 183f012e29Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 193f012e29Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 203f012e29Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 213f012e29Smrg * IN THE SOFTWARE. 223f012e29Smrg */ 233f012e29Smrg 2400a23bdaSmrg#ifndef _VC4_DRM_H_ 2500a23bdaSmrg#define _VC4_DRM_H_ 263f012e29Smrg 273f012e29Smrg#include "drm.h" 283f012e29Smrg 293f012e29Smrg#if defined(__cplusplus) 303f012e29Smrgextern "C" { 313f012e29Smrg#endif 323f012e29Smrg 333f012e29Smrg#define DRM_VC4_SUBMIT_CL 0x00 343f012e29Smrg#define DRM_VC4_WAIT_SEQNO 0x01 353f012e29Smrg#define DRM_VC4_WAIT_BO 0x02 363f012e29Smrg#define DRM_VC4_CREATE_BO 0x03 373f012e29Smrg#define DRM_VC4_MMAP_BO 0x04 383f012e29Smrg#define DRM_VC4_CREATE_SHADER_BO 0x05 393f012e29Smrg#define DRM_VC4_GET_HANG_STATE 0x06 403f012e29Smrg#define DRM_VC4_GET_PARAM 0x07 41d8807b2fSmrg#define DRM_VC4_SET_TILING 0x08 42d8807b2fSmrg#define DRM_VC4_GET_TILING 0x09 4300a23bdaSmrg#define DRM_VC4_LABEL_BO 0x0a 4400a23bdaSmrg#define DRM_VC4_GEM_MADVISE 0x0b 457cdc0497Smrg#define DRM_VC4_PERFMON_CREATE 0x0c 467cdc0497Smrg#define DRM_VC4_PERFMON_DESTROY 0x0d 477cdc0497Smrg#define DRM_VC4_PERFMON_GET_VALUES 0x0e 483f012e29Smrg 493f012e29Smrg#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) 503f012e29Smrg#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) 513f012e29Smrg#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo) 523f012e29Smrg#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo) 533f012e29Smrg#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo) 543f012e29Smrg#define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) 553f012e29Smrg#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) 563f012e29Smrg#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) 57d8807b2fSmrg#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) 58d8807b2fSmrg#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) 5900a23bdaSmrg#define DRM_IOCTL_VC4_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_LABEL_BO, struct drm_vc4_label_bo) 6000a23bdaSmrg#define DRM_IOCTL_VC4_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GEM_MADVISE, struct drm_vc4_gem_madvise) 617cdc0497Smrg#define DRM_IOCTL_VC4_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_CREATE, struct drm_vc4_perfmon_create) 627cdc0497Smrg#define DRM_IOCTL_VC4_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_DESTROY, struct drm_vc4_perfmon_destroy) 637cdc0497Smrg#define DRM_IOCTL_VC4_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_GET_VALUES, struct drm_vc4_perfmon_get_values) 643f012e29Smrg 653f012e29Smrgstruct drm_vc4_submit_rcl_surface { 663f012e29Smrg __u32 hindex; /* Handle index, or ~0 if not present. */ 673f012e29Smrg __u32 offset; /* Offset to start of buffer. */ 683f012e29Smrg /* 693f012e29Smrg * Bits for either render config (color_write) or load/store packet. 703f012e29Smrg * Bits should all be 0 for MSAA load/stores. 713f012e29Smrg */ 723f012e29Smrg __u16 bits; 733f012e29Smrg 743f012e29Smrg#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES (1 << 0) 753f012e29Smrg __u16 flags; 763f012e29Smrg}; 773f012e29Smrg 783f012e29Smrg/** 793f012e29Smrg * struct drm_vc4_submit_cl - ioctl argument for submitting commands to the 3D 803f012e29Smrg * engine. 813f012e29Smrg * 823f012e29Smrg * Drivers typically use GPU BOs to store batchbuffers / command lists and 833f012e29Smrg * their associated state. However, because the VC4 lacks an MMU, we have to 843f012e29Smrg * do validation of memory accesses by the GPU commands. If we were to store 853f012e29Smrg * our commands in BOs, we'd need to do uncached readback from them to do the 863f012e29Smrg * validation process, which is too expensive. Instead, userspace accumulates 873f012e29Smrg * commands and associated state in plain memory, then the kernel copies the 883f012e29Smrg * data to its own address space, and then validates and stores it in a GPU 893f012e29Smrg * BO. 903f012e29Smrg */ 913f012e29Smrgstruct drm_vc4_submit_cl { 923f012e29Smrg /* Pointer to the binner command list. 933f012e29Smrg * 943f012e29Smrg * This is the first set of commands executed, which runs the 953f012e29Smrg * coordinate shader to determine where primitives land on the screen, 963f012e29Smrg * then writes out the state updates and draw calls necessary per tile 973f012e29Smrg * to the tile allocation BO. 983f012e29Smrg */ 993f012e29Smrg __u64 bin_cl; 1003f012e29Smrg 1013f012e29Smrg /* Pointer to the shader records. 1023f012e29Smrg * 1033f012e29Smrg * Shader records are the structures read by the hardware that contain 1043f012e29Smrg * pointers to uniforms, shaders, and vertex attributes. The 1053f012e29Smrg * reference to the shader record has enough information to determine 1063f012e29Smrg * how many pointers are necessary (fixed number for shaders/uniforms, 1073f012e29Smrg * and an attribute count), so those BO indices into bo_handles are 1083f012e29Smrg * just stored as __u32s before each shader record passed in. 1093f012e29Smrg */ 1103f012e29Smrg __u64 shader_rec; 1113f012e29Smrg 1123f012e29Smrg /* Pointer to uniform data and texture handles for the textures 1133f012e29Smrg * referenced by the shader. 1143f012e29Smrg * 1153f012e29Smrg * For each shader state record, there is a set of uniform data in the 1163f012e29Smrg * order referenced by the record (FS, VS, then CS). Each set of 1173f012e29Smrg * uniform data has a __u32 index into bo_handles per texture 1183f012e29Smrg * sample operation, in the order the QPU_W_TMUn_S writes appear in 1193f012e29Smrg * the program. Following the texture BO handle indices is the actual 1203f012e29Smrg * uniform data. 1213f012e29Smrg * 1223f012e29Smrg * The individual uniform state blocks don't have sizes passed in, 1233f012e29Smrg * because the kernel has to determine the sizes anyway during shader 1243f012e29Smrg * code validation. 1253f012e29Smrg */ 1263f012e29Smrg __u64 uniforms; 1273f012e29Smrg __u64 bo_handles; 1283f012e29Smrg 1293f012e29Smrg /* Size in bytes of the binner command list. */ 1303f012e29Smrg __u32 bin_cl_size; 1313f012e29Smrg /* Size in bytes of the set of shader records. */ 1323f012e29Smrg __u32 shader_rec_size; 1333f012e29Smrg /* Number of shader records. 1343f012e29Smrg * 1353f012e29Smrg * This could just be computed from the contents of shader_records and 1363f012e29Smrg * the address bits of references to them from the bin CL, but it 1373f012e29Smrg * keeps the kernel from having to resize some allocations it makes. 1383f012e29Smrg */ 1393f012e29Smrg __u32 shader_rec_count; 1403f012e29Smrg /* Size in bytes of the uniform state. */ 1413f012e29Smrg __u32 uniforms_size; 1423f012e29Smrg 1433f012e29Smrg /* Number of BO handles passed in (size is that times 4). */ 1443f012e29Smrg __u32 bo_handle_count; 1453f012e29Smrg 1463f012e29Smrg /* RCL setup: */ 1473f012e29Smrg __u16 width; 1483f012e29Smrg __u16 height; 1493f012e29Smrg __u8 min_x_tile; 1503f012e29Smrg __u8 min_y_tile; 1513f012e29Smrg __u8 max_x_tile; 1523f012e29Smrg __u8 max_y_tile; 1533f012e29Smrg struct drm_vc4_submit_rcl_surface color_read; 1543f012e29Smrg struct drm_vc4_submit_rcl_surface color_write; 1553f012e29Smrg struct drm_vc4_submit_rcl_surface zs_read; 1563f012e29Smrg struct drm_vc4_submit_rcl_surface zs_write; 1573f012e29Smrg struct drm_vc4_submit_rcl_surface msaa_color_write; 1583f012e29Smrg struct drm_vc4_submit_rcl_surface msaa_zs_write; 1593f012e29Smrg __u32 clear_color[2]; 1603f012e29Smrg __u32 clear_z; 1613f012e29Smrg __u8 clear_s; 1623f012e29Smrg 1633f012e29Smrg __u32 pad:24; 1643f012e29Smrg 1653f012e29Smrg#define VC4_SUBMIT_CL_USE_CLEAR_COLOR (1 << 0) 16600a23bdaSmrg/* By default, the kernel gets to choose the order that the tiles are 16700a23bdaSmrg * rendered in. If this is set, then the tiles will be rendered in a 16800a23bdaSmrg * raster order, with the right-to-left vs left-to-right and 16900a23bdaSmrg * top-to-bottom vs bottom-to-top dictated by 17000a23bdaSmrg * VC4_SUBMIT_CL_RCL_ORDER_INCREASING_*. This allows overlapping 17100a23bdaSmrg * blits to be implemented using the 3D engine. 17200a23bdaSmrg */ 17300a23bdaSmrg#define VC4_SUBMIT_CL_FIXED_RCL_ORDER (1 << 1) 17400a23bdaSmrg#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_X (1 << 2) 17500a23bdaSmrg#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_Y (1 << 3) 1763f012e29Smrg __u32 flags; 1773f012e29Smrg 1783f012e29Smrg /* Returned value of the seqno of this render job (for the 1793f012e29Smrg * wait ioctl). 1803f012e29Smrg */ 1813f012e29Smrg __u64 seqno; 1827cdc0497Smrg 1837cdc0497Smrg /* ID of the perfmon to attach to this job. 0 means no perfmon. */ 1847cdc0497Smrg __u32 perfmonid; 1857cdc0497Smrg 1867cdc0497Smrg /* Syncobj handle to wait on. If set, processing of this render job 1877cdc0497Smrg * will not start until the syncobj is signaled. 0 means ignore. 1887cdc0497Smrg */ 1897cdc0497Smrg __u32 in_sync; 1907cdc0497Smrg 1917cdc0497Smrg /* Syncobj handle to export fence to. If set, the fence in the syncobj 1927cdc0497Smrg * will be replaced with a fence that signals upon completion of this 1937cdc0497Smrg * render job. 0 means ignore. 1947cdc0497Smrg */ 1957cdc0497Smrg __u32 out_sync; 1967cdc0497Smrg 1977cdc0497Smrg __u32 pad2; 1983f012e29Smrg}; 1993f012e29Smrg 2003f012e29Smrg/** 2013f012e29Smrg * struct drm_vc4_wait_seqno - ioctl argument for waiting for 2023f012e29Smrg * DRM_VC4_SUBMIT_CL completion using its returned seqno. 2033f012e29Smrg * 2043f012e29Smrg * timeout_ns is the timeout in nanoseconds, where "0" means "don't 2053f012e29Smrg * block, just return the status." 2063f012e29Smrg */ 2073f012e29Smrgstruct drm_vc4_wait_seqno { 2083f012e29Smrg __u64 seqno; 2093f012e29Smrg __u64 timeout_ns; 2103f012e29Smrg}; 2113f012e29Smrg 2123f012e29Smrg/** 2133f012e29Smrg * struct drm_vc4_wait_bo - ioctl argument for waiting for 2143f012e29Smrg * completion of the last DRM_VC4_SUBMIT_CL on a BO. 2153f012e29Smrg * 2163f012e29Smrg * This is useful for cases where multiple processes might be 2173f012e29Smrg * rendering to a BO and you want to wait for all rendering to be 2183f012e29Smrg * completed. 2193f012e29Smrg */ 2203f012e29Smrgstruct drm_vc4_wait_bo { 2213f012e29Smrg __u32 handle; 2223f012e29Smrg __u32 pad; 2233f012e29Smrg __u64 timeout_ns; 2243f012e29Smrg}; 2253f012e29Smrg 2263f012e29Smrg/** 2273f012e29Smrg * struct drm_vc4_create_bo - ioctl argument for creating VC4 BOs. 2283f012e29Smrg * 2293f012e29Smrg * There are currently no values for the flags argument, but it may be 2303f012e29Smrg * used in a future extension. 2313f012e29Smrg */ 2323f012e29Smrgstruct drm_vc4_create_bo { 2333f012e29Smrg __u32 size; 2343f012e29Smrg __u32 flags; 2353f012e29Smrg /** Returned GEM handle for the BO. */ 2363f012e29Smrg __u32 handle; 2373f012e29Smrg __u32 pad; 2383f012e29Smrg}; 2393f012e29Smrg 2403f012e29Smrg/** 2413f012e29Smrg * struct drm_vc4_mmap_bo - ioctl argument for mapping VC4 BOs. 2423f012e29Smrg * 2433f012e29Smrg * This doesn't actually perform an mmap. Instead, it returns the 2443f012e29Smrg * offset you need to use in an mmap on the DRM device node. This 2453f012e29Smrg * means that tools like valgrind end up knowing about the mapped 2463f012e29Smrg * memory. 2473f012e29Smrg * 2483f012e29Smrg * There are currently no values for the flags argument, but it may be 2493f012e29Smrg * used in a future extension. 2503f012e29Smrg */ 2513f012e29Smrgstruct drm_vc4_mmap_bo { 2523f012e29Smrg /** Handle for the object being mapped. */ 2533f012e29Smrg __u32 handle; 2543f012e29Smrg __u32 flags; 2553f012e29Smrg /** offset into the drm node to use for subsequent mmap call. */ 2563f012e29Smrg __u64 offset; 2573f012e29Smrg}; 2583f012e29Smrg 2593f012e29Smrg/** 2603f012e29Smrg * struct drm_vc4_create_shader_bo - ioctl argument for creating VC4 2613f012e29Smrg * shader BOs. 2623f012e29Smrg * 2633f012e29Smrg * Since allowing a shader to be overwritten while it's also being 2643f012e29Smrg * executed from would allow privlege escalation, shaders must be 2653f012e29Smrg * created using this ioctl, and they can't be mmapped later. 2663f012e29Smrg */ 2673f012e29Smrgstruct drm_vc4_create_shader_bo { 2683f012e29Smrg /* Size of the data argument. */ 2693f012e29Smrg __u32 size; 2703f012e29Smrg /* Flags, currently must be 0. */ 2713f012e29Smrg __u32 flags; 2723f012e29Smrg 2733f012e29Smrg /* Pointer to the data. */ 2743f012e29Smrg __u64 data; 2753f012e29Smrg 2763f012e29Smrg /** Returned GEM handle for the BO. */ 2773f012e29Smrg __u32 handle; 2783f012e29Smrg /* Pad, must be 0. */ 2793f012e29Smrg __u32 pad; 2803f012e29Smrg}; 2813f012e29Smrg 2823f012e29Smrgstruct drm_vc4_get_hang_state_bo { 2833f012e29Smrg __u32 handle; 2843f012e29Smrg __u32 paddr; 2853f012e29Smrg __u32 size; 2863f012e29Smrg __u32 pad; 2873f012e29Smrg}; 2883f012e29Smrg 2893f012e29Smrg/** 2903f012e29Smrg * struct drm_vc4_hang_state - ioctl argument for collecting state 2913f012e29Smrg * from a GPU hang for analysis. 2923f012e29Smrg*/ 2933f012e29Smrgstruct drm_vc4_get_hang_state { 2943f012e29Smrg /** Pointer to array of struct drm_vc4_get_hang_state_bo. */ 2953f012e29Smrg __u64 bo; 2963f012e29Smrg /** 2973f012e29Smrg * On input, the size of the bo array. Output is the number 2983f012e29Smrg * of bos to be returned. 2993f012e29Smrg */ 3003f012e29Smrg __u32 bo_count; 3013f012e29Smrg 3023f012e29Smrg __u32 start_bin, start_render; 3033f012e29Smrg 3043f012e29Smrg __u32 ct0ca, ct0ea; 3053f012e29Smrg __u32 ct1ca, ct1ea; 3063f012e29Smrg __u32 ct0cs, ct1cs; 3073f012e29Smrg __u32 ct0ra0, ct1ra0; 3083f012e29Smrg 3093f012e29Smrg __u32 bpca, bpcs; 3103f012e29Smrg __u32 bpoa, bpos; 3113f012e29Smrg 3123f012e29Smrg __u32 vpmbase; 3133f012e29Smrg 3143f012e29Smrg __u32 dbge; 3153f012e29Smrg __u32 fdbgo; 3163f012e29Smrg __u32 fdbgb; 3173f012e29Smrg __u32 fdbgr; 3183f012e29Smrg __u32 fdbgs; 3193f012e29Smrg __u32 errstat; 3203f012e29Smrg 3213f012e29Smrg /* Pad that we may save more registers into in the future. */ 3223f012e29Smrg __u32 pad[16]; 3233f012e29Smrg}; 3243f012e29Smrg 3253f012e29Smrg#define DRM_VC4_PARAM_V3D_IDENT0 0 3263f012e29Smrg#define DRM_VC4_PARAM_V3D_IDENT1 1 3273f012e29Smrg#define DRM_VC4_PARAM_V3D_IDENT2 2 3283f012e29Smrg#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 329037b3c26Smrg#define DRM_VC4_PARAM_SUPPORTS_ETC1 4 330037b3c26Smrg#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5 33100a23bdaSmrg#define DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER 6 33200a23bdaSmrg#define DRM_VC4_PARAM_SUPPORTS_MADVISE 7 3337cdc0497Smrg#define DRM_VC4_PARAM_SUPPORTS_PERFMON 8 3343f012e29Smrg 3353f012e29Smrgstruct drm_vc4_get_param { 3363f012e29Smrg __u32 param; 3373f012e29Smrg __u32 pad; 3383f012e29Smrg __u64 value; 3393f012e29Smrg}; 3403f012e29Smrg 341d8807b2fSmrgstruct drm_vc4_get_tiling { 342d8807b2fSmrg __u32 handle; 343d8807b2fSmrg __u32 flags; 344d8807b2fSmrg __u64 modifier; 345d8807b2fSmrg}; 346d8807b2fSmrg 347d8807b2fSmrgstruct drm_vc4_set_tiling { 348d8807b2fSmrg __u32 handle; 349d8807b2fSmrg __u32 flags; 350d8807b2fSmrg __u64 modifier; 351d8807b2fSmrg}; 352d8807b2fSmrg 35300a23bdaSmrg/** 35400a23bdaSmrg * struct drm_vc4_label_bo - Attach a name to a BO for debug purposes. 35500a23bdaSmrg */ 35600a23bdaSmrgstruct drm_vc4_label_bo { 35700a23bdaSmrg __u32 handle; 35800a23bdaSmrg __u32 len; 35900a23bdaSmrg __u64 name; 36000a23bdaSmrg}; 36100a23bdaSmrg 36200a23bdaSmrg/* 36300a23bdaSmrg * States prefixed with '__' are internal states and cannot be passed to the 36400a23bdaSmrg * DRM_IOCTL_VC4_GEM_MADVISE ioctl. 36500a23bdaSmrg */ 36600a23bdaSmrg#define VC4_MADV_WILLNEED 0 36700a23bdaSmrg#define VC4_MADV_DONTNEED 1 36800a23bdaSmrg#define __VC4_MADV_PURGED 2 36900a23bdaSmrg#define __VC4_MADV_NOTSUPP 3 37000a23bdaSmrg 37100a23bdaSmrgstruct drm_vc4_gem_madvise { 37200a23bdaSmrg __u32 handle; 37300a23bdaSmrg __u32 madv; 37400a23bdaSmrg __u32 retained; 37500a23bdaSmrg __u32 pad; 37600a23bdaSmrg}; 37700a23bdaSmrg 3787cdc0497Smrgenum { 3797cdc0497Smrg VC4_PERFCNT_FEP_VALID_PRIMS_NO_RENDER, 3807cdc0497Smrg VC4_PERFCNT_FEP_VALID_PRIMS_RENDER, 3817cdc0497Smrg VC4_PERFCNT_FEP_CLIPPED_QUADS, 3827cdc0497Smrg VC4_PERFCNT_FEP_VALID_QUADS, 3837cdc0497Smrg VC4_PERFCNT_TLB_QUADS_NOT_PASSING_STENCIL, 3847cdc0497Smrg VC4_PERFCNT_TLB_QUADS_NOT_PASSING_Z_AND_STENCIL, 3857cdc0497Smrg VC4_PERFCNT_TLB_QUADS_PASSING_Z_AND_STENCIL, 3867cdc0497Smrg VC4_PERFCNT_TLB_QUADS_ZERO_COVERAGE, 3877cdc0497Smrg VC4_PERFCNT_TLB_QUADS_NON_ZERO_COVERAGE, 3887cdc0497Smrg VC4_PERFCNT_TLB_QUADS_WRITTEN_TO_COLOR_BUF, 3897cdc0497Smrg VC4_PERFCNT_PLB_PRIMS_OUTSIDE_VIEWPORT, 3907cdc0497Smrg VC4_PERFCNT_PLB_PRIMS_NEED_CLIPPING, 3917cdc0497Smrg VC4_PERFCNT_PSE_PRIMS_REVERSED, 3927cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_IDLE_CYCLES, 3937cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_VERTEX_COORD_SHADING, 3947cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_FRAGMENT_SHADING, 3957cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_EXEC_VALID_INST, 3967cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_TMUS, 3977cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_SCOREBOARD, 3987cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_VARYINGS, 3997cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_INST_CACHE_HIT, 4007cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_INST_CACHE_MISS, 4017cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_HIT, 4027cdc0497Smrg VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_MISS, 4037cdc0497Smrg VC4_PERFCNT_TMU_TOTAL_TEXT_QUADS_PROCESSED, 4047cdc0497Smrg VC4_PERFCNT_TMU_TOTAL_TEXT_CACHE_MISS, 4057cdc0497Smrg VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VDW_STALLED, 4067cdc0497Smrg VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VCD_STALLED, 4077cdc0497Smrg VC4_PERFCNT_L2C_TOTAL_L2_CACHE_HIT, 4087cdc0497Smrg VC4_PERFCNT_L2C_TOTAL_L2_CACHE_MISS, 4097cdc0497Smrg VC4_PERFCNT_NUM_EVENTS, 4107cdc0497Smrg}; 4117cdc0497Smrg 4127cdc0497Smrg#define DRM_VC4_MAX_PERF_COUNTERS 16 4137cdc0497Smrg 4147cdc0497Smrgstruct drm_vc4_perfmon_create { 4157cdc0497Smrg __u32 id; 4167cdc0497Smrg __u32 ncounters; 4177cdc0497Smrg __u8 events[DRM_VC4_MAX_PERF_COUNTERS]; 4187cdc0497Smrg}; 4197cdc0497Smrg 4207cdc0497Smrgstruct drm_vc4_perfmon_destroy { 4217cdc0497Smrg __u32 id; 4227cdc0497Smrg}; 4237cdc0497Smrg 4247cdc0497Smrg/* 4257cdc0497Smrg * Returns the values of the performance counters tracked by this 4267cdc0497Smrg * perfmon (as an array of ncounters u64 values). 4277cdc0497Smrg * 4287cdc0497Smrg * No implicit synchronization is performed, so the user has to 4297cdc0497Smrg * guarantee that any jobs using this perfmon have already been 4307cdc0497Smrg * completed (probably by blocking on the seqno returned by the 4317cdc0497Smrg * last exec that used the perfmon). 4327cdc0497Smrg */ 4337cdc0497Smrgstruct drm_vc4_perfmon_get_values { 4347cdc0497Smrg __u32 id; 4357cdc0497Smrg __u64 values_ptr; 4367cdc0497Smrg}; 4377cdc0497Smrg 4383f012e29Smrg#if defined(__cplusplus) 4393f012e29Smrg} 4403f012e29Smrg#endif 4413f012e29Smrg 44200a23bdaSmrg#endif /* _VC4_DRM_H_ */ 443