37 #include <drm/drm_os_solaris.h> |
37 #include <drm/drm_os_solaris.h> |
38 |
38 |
39 /* Please note that modifications to all structs defined here are |
39 /* Please note that modifications to all structs defined here are |
40 * subject to backwards-compatibility constraints. |
40 * subject to backwards-compatibility constraints. |
41 */ |
41 */ |
|
42 |
|
43 /** |
|
44 * DOC: uevents generated by i915 on it's device node |
|
45 * |
|
46 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch |
|
47 * event from the gpu l3 cache. Additional information supplied is ROW, |
|
48 * BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep |
|
49 * track of these events and if a specific cache-line seems to have a |
|
50 * persistent error remap it with the l3 remapping tool supplied in |
|
51 * intel-gpu-tools. The value supplied with the event is always 1. |
|
52 * |
|
53 * I915_ERROR_UEVENT - Generated upon error detection, currently only via |
|
54 * hangcheck. The error detection event is a good indicator of when things |
|
55 * began to go badly. The value supplied with the event is a 1 upon error |
|
56 * detection, and a 0 upon reset completion, signifying no more error |
|
57 * exists. NOTE: Disabling hangcheck or reset via module parameter will |
|
58 * cause the related events to not be seen. |
|
59 * |
|
60 * I915_RESET_UEVENT - Event is generated just before an attempt to reset the |
|
61 * the GPU. The value supplied with the event is always 1. NOTE: Disable |
|
62 * reset via module parameter will cause this event to not be seen. |
|
63 */ |
|
64 #define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR" |
|
65 #define I915_ERROR_UEVENT "ERROR" |
|
66 #define I915_RESET_UEVENT "RESET" |
42 |
67 |
43 /* Each region is a minimum of 16k, and there are at most 255 of them. |
68 /* Each region is a minimum of 16k, and there are at most 255 of them. |
44 */ |
69 */ |
45 #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use |
70 #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use |
46 * of chars for next/prev indices */ |
71 * of chars for next/prev indices */ |
153 #define I915_BOX_FLIP 0x2 |
179 #define I915_BOX_FLIP 0x2 |
154 #define I915_BOX_WAIT 0x4 |
180 #define I915_BOX_WAIT 0x4 |
155 #define I915_BOX_TEXTURE_LOAD 0x8 |
181 #define I915_BOX_TEXTURE_LOAD 0x8 |
156 #define I915_BOX_LOST_CONTEXT 0x10 |
182 #define I915_BOX_LOST_CONTEXT 0x10 |
157 |
183 |
158 /* I915 specific ioctls |
184 /* |
159 * The device specific ioctl range is 0x40 to 0x79. |
185 * i915 specific ioctls. |
|
186 * |
|
187 * The device specific ioctl range is [DRM_COMMAND_BASE, DRM_COMMAND_END) ie |
|
188 * [0x40, 0xa0) (a0 is excluded). The numbers below are defined as offset |
|
189 * against DRM_COMMAND_BASE and should be between [0x0, 0x60). |
160 */ |
190 */ |
161 #define DRM_I915_INIT 0x00 |
191 #define DRM_I915_INIT 0x00 |
162 #define DRM_I915_FLUSH 0x01 |
192 #define DRM_I915_FLUSH 0x01 |
163 #define DRM_I915_FLIP 0x02 |
193 #define DRM_I915_FLIP 0x02 |
164 #define DRM_I915_BATCHBUFFER 0x03 |
194 #define DRM_I915_BATCHBUFFER 0x03 |
204 #define DRM_I915_GEM_CONTEXT_CREATE 0x2d |
234 #define DRM_I915_GEM_CONTEXT_CREATE 0x2d |
205 #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e |
235 #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e |
206 #define DRM_I915_GEM_SET_CACHING 0x2f |
236 #define DRM_I915_GEM_SET_CACHING 0x2f |
207 #define DRM_I915_GEM_GET_CACHING 0x30 |
237 #define DRM_I915_GEM_GET_CACHING 0x30 |
208 #define DRM_I915_REG_READ 0x31 |
238 #define DRM_I915_REG_READ 0x31 |
|
239 #define DRM_I915_GET_RESET_STATS 0x32 |
|
240 #define DRM_I915_GEM_USERPTR 0x33 |
|
241 #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 |
|
242 #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 |
209 |
243 |
210 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
244 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
211 #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
245 #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
212 #define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) |
246 #define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) |
213 #define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) |
247 #define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) |
214 #define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) |
248 #define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) |
215 #define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) |
249 #define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) |
216 #define DRM_IOCTL_I915_GETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) |
250 #define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) |
217 #define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) |
251 #define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) |
218 #define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) |
252 #define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) |
219 #define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) |
253 #define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) |
220 #define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) |
254 #define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) |
221 #define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) |
255 #define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) |
222 #define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) |
256 #define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) |
223 #define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) |
257 #define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) |
224 #define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) |
258 #define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) |
225 #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) |
259 #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) |
226 #define DRM_IOCTL_I915_HWS_ADDR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, drm_i915_hws_addr_t) |
260 #define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init) |
227 #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) |
261 #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) |
228 #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) |
262 #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) |
229 #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) |
263 #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) |
230 #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) |
264 #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) |
231 #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) |
265 #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) |
248 #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) |
282 #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) |
249 #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) |
283 #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) |
250 #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) |
284 #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) |
251 #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) |
285 #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) |
252 #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) |
286 #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) |
253 #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) |
287 #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) |
254 #define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) |
288 #define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) |
255 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) |
289 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) |
256 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) |
290 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) |
257 #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) |
291 #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) |
|
292 #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) |
|
293 #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) |
|
294 #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) |
|
295 #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) |
258 |
296 |
259 #ifdef _MULTI_DATAMODEL |
297 #ifdef _MULTI_DATAMODEL |
260 #define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \ |
298 #define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \ |
261 [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = _copyin32, .copyout32 = _copyout32} |
299 [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = _copyin32, .copyout32 = _copyout32} |
262 #else |
300 #else |
263 #define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \ |
301 #define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \ |
264 [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = NULL, .copyout32 = NULL} |
302 [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = NULL, .copyout32 = NULL, .name = ##_func} |
265 #endif |
303 #endif |
266 |
304 |
267 /* Allow drivers to submit batchbuffers directly to hardware, relying |
305 /* Allow drivers to submit batchbuffers directly to hardware, relying |
268 * on the security mechanisms provided by hardware. |
306 * on the security mechanisms provided by hardware. |
269 */ |
307 */ |
271 int start; /* agp offset */ |
309 int start; /* agp offset */ |
272 int used; /* nr bytes in use */ |
310 int used; /* nr bytes in use */ |
273 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ |
311 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ |
274 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ |
312 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ |
275 int num_cliprects; /* mulitpass with multiple cliprects? */ |
313 int num_cliprects; /* mulitpass with multiple cliprects? */ |
276 struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */ |
314 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */ |
277 } drm_i915_batchbuffer_t; |
315 } drm_i915_batchbuffer_t; |
278 |
316 |
279 typedef struct drm_i915_batchbuffer32 { |
317 typedef struct drm_i915_batchbuffer32 { |
280 int start; /* agp offset */ |
318 int start; /* agp offset */ |
281 int used; /* nr bytes in use */ |
319 int used; /* nr bytes in use */ |
287 |
325 |
288 /* As above, but pass a pointer to userspace buffer which can be |
326 /* As above, but pass a pointer to userspace buffer which can be |
289 * validated by the kernel prior to sending to hardware. |
327 * validated by the kernel prior to sending to hardware. |
290 */ |
328 */ |
291 typedef struct _drm_i915_cmdbuffer { |
329 typedef struct _drm_i915_cmdbuffer { |
292 char __user *buf; /* pointer to userspace command buffer */ |
330 char *buf; /* pointer to userspace command buffer */ |
293 int sz; /* nr bytes in buf */ |
331 int sz; /* nr bytes in buf */ |
294 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ |
332 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ |
295 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ |
333 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ |
296 int num_cliprects; /* mulitpass with multiple cliprects? */ |
334 int num_cliprects; /* mulitpass with multiple cliprects? */ |
297 struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */ |
335 struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */ |
298 } drm_i915_cmdbuffer_t; |
336 } drm_i915_cmdbuffer_t; |
299 |
337 |
300 typedef struct drm_i915_cmdbuffer32 { |
338 typedef struct drm_i915_cmdbuffer32 { |
301 caddr32_t buf; /* pointer to userspace command buffer */ |
339 caddr32_t buf; /* pointer to userspace command buffer */ |
302 int sz; /* nr bytes in buf */ |
340 int sz; /* nr bytes in buf */ |
336 #define I915_PARAM_HAS_RELAXED_FENCING 12 |
374 #define I915_PARAM_HAS_RELAXED_FENCING 12 |
337 #define I915_PARAM_HAS_COHERENT_RINGS 13 |
375 #define I915_PARAM_HAS_COHERENT_RINGS 13 |
338 #define I915_PARAM_HAS_EXEC_CONSTANTS 14 |
376 #define I915_PARAM_HAS_EXEC_CONSTANTS 14 |
339 #define I915_PARAM_HAS_RELAXED_DELTA 15 |
377 #define I915_PARAM_HAS_RELAXED_DELTA 15 |
340 #define I915_PARAM_HAS_GEN7_SOL_RESET 16 |
378 #define I915_PARAM_HAS_GEN7_SOL_RESET 16 |
341 #define I915_PARAM_HAS_LLC 17 |
379 #define I915_PARAM_HAS_LLC 17 |
342 #define I915_PARAM_HAS_ALIASING_PPGTT 18 |
380 #define I915_PARAM_HAS_ALIASING_PPGTT 18 |
343 #define I915_PARAM_HAS_WAIT_TIMEOUT 19 |
381 #define I915_PARAM_HAS_WAIT_TIMEOUT 19 |
344 #define I915_PARAM_HAS_SEMAPHORES 20 |
382 #define I915_PARAM_HAS_SEMAPHORES 20 |
345 #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 |
383 #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 |
346 #define I915_PARAM_HAS_VEBOX 22 |
384 #define I915_PARAM_HAS_VEBOX 22 |
347 #define I915_PARAM_HAS_SECURE_BATCHES 23 |
385 #define I915_PARAM_HAS_SECURE_BATCHES 23 |
348 #define I915_PARAM_HAS_PINNED_BATCHES 24 |
386 #define I915_PARAM_HAS_PINNED_BATCHES 24 |
349 #define I915_PARAM_HAS_EXEC_NO_RELOC 25 |
387 #define I915_PARAM_HAS_EXEC_NO_RELOC 25 |
350 #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 |
388 #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 |
|
389 #define I915_PARAM_HAS_WT 27 |
|
390 #define I915_PARAM_CMD_PARSER_VERSION 28 |
|
391 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 |
|
392 #define I915_PARAM_MMAP_VERSION 30 |
|
393 #define I915_PARAM_HAS_BSD2 31 |
|
394 #define I915_PARAM_REVISION 32 |
|
395 #define I915_PARAM_SUBSLICE_TOTAL 33 |
|
396 #define I915_PARAM_EU_TOTAL 34 |
|
397 #define I915_PARAM_HAS_GPU_RESET 35 |
|
398 #define I915_PARAM_HAS_RESOURCE_STREAMER 36 |
|
399 #define I915_PARAM_HAS_EXEC_SOFTPIN 37 |
351 |
400 |
352 typedef struct drm_i915_getparam { |
401 typedef struct drm_i915_getparam { |
353 int param; |
402 __s32 param; |
354 int __user *value; |
403 /* |
|
404 * WARNING: Using pointers instead of fixed-size u64 means we need to write |
|
405 * compat32 code. Don't repeat this mistake. |
|
406 */ |
|
407 int *value; |
355 } drm_i915_getparam_t; |
408 } drm_i915_getparam_t; |
356 |
409 |
357 typedef struct drm_i915_getparam32 { |
410 typedef struct drm_i915_getparam32 { |
358 int param; |
411 int param; |
359 caddr32_t value; |
412 caddr32_t value; |
672 |
733 |
673 /** Required alignment in graphics aperture */ |
734 /** Required alignment in graphics aperture */ |
674 __u64 alignment; |
735 __u64 alignment; |
675 |
736 |
676 /** |
737 /** |
677 * Returned value of the updated offset of the object, for future |
738 * When the EXEC_OBJECT_PINNED flag is specified this is populated by |
678 * presumed_offset writes. |
739 * the user with the GTT offset at which this object will be pinned. |
|
740 * When the I915_EXEC_NO_RELOC flag is specified this must contain the |
|
741 * presumed_offset of the object. |
|
742 * During execbuffer2 the kernel populates it with the value of the |
|
743 * current GTT offset of the object, for future presumed_offset writes. |
679 */ |
744 */ |
680 __u64 offset; |
745 __u64 offset; |
681 |
746 |
682 #define EXEC_OBJECT_NEEDS_FENCE (1<<0) |
747 #define EXEC_OBJECT_NEEDS_FENCE (1<<0) |
683 #define EXEC_OBJECT_NEEDS_GTT (1<<1) |
748 #define EXEC_OBJECT_NEEDS_GTT (1<<1) |
684 #define EXEC_OBJECT_WRITE (1<<2) |
749 #define EXEC_OBJECT_WRITE (1<<2) |
685 #define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1) |
750 #define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) |
|
751 #define EXEC_OBJECT_PINNED (1<<4) |
|
752 #define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1) |
686 __u64 flags; |
753 __u64 flags; |
|
754 |
687 __u64 rsvd1; |
755 __u64 rsvd1; |
688 __u64 rsvd2; |
756 __u64 rsvd2; |
689 }; |
757 }; |
690 |
758 |
691 struct drm_i915_gem_execbuffer2 { |
759 struct drm_i915_gem_execbuffer2 { |
741 * coherent with the CS before execution. If this flag is passed, |
809 * coherent with the CS before execution. If this flag is passed, |
742 * userspace assumes the responsibility for ensuring the same. |
810 * userspace assumes the responsibility for ensuring the same. |
743 */ |
811 */ |
744 #define I915_EXEC_IS_PINNED (1<<10) |
812 #define I915_EXEC_IS_PINNED (1<<10) |
745 |
813 |
746 /** Provide a hint to the kernel that the command stream and auxilliary |
814 /** Provide a hint to the kernel that the command stream and auxiliary |
747 * state buffers already holds the correct presumed addresses and so the |
815 * state buffers already holds the correct presumed addresses and so the |
748 * relocation process may be skipped if no buffers need to be moved in |
816 * relocation process may be skipped if no buffers need to be moved in |
749 * preparation for the execbuffer. |
817 * preparation for the execbuffer. |
750 */ |
818 */ |
751 #define I915_EXEC_NO_RELOC (1<<11) |
819 #define I915_EXEC_NO_RELOC (1<<11) |
753 /** Use the reloc.handle as an index into the exec object array rather |
821 /** Use the reloc.handle as an index into the exec object array rather |
754 * than as the per-file handle. |
822 * than as the per-file handle. |
755 */ |
823 */ |
756 #define I915_EXEC_HANDLE_LUT (1<<12) |
824 #define I915_EXEC_HANDLE_LUT (1<<12) |
757 |
825 |
758 #define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) |
826 /** Used for switching BSD rings on the platforms with two BSD rings */ |
|
827 #define I915_EXEC_BSD_MASK (3<<13) |
|
828 #define I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */ |
|
829 #define I915_EXEC_BSD_RING1 (1<<13) |
|
830 #define I915_EXEC_BSD_RING2 (2<<13) |
|
831 |
|
832 /** Tell the kernel that the batchbuffer is processed by |
|
833 * the resource streamer. |
|
834 */ |
|
835 #define I915_EXEC_RESOURCE_STREAMER (1<<15) |
|
836 |
|
837 #define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_RESOURCE_STREAMER<<1) |
759 |
838 |
760 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
839 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
761 #define i915_execbuffer2_set_context_id(eb2, context) \ |
840 #define i915_execbuffer2_set_context_id(eb2, context) \ |
762 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK |
841 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK |
763 #define i915_execbuffer2_get_context_id(eb2) \ |
842 #define i915_execbuffer2_get_context_id(eb2) \ |
791 * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) |
870 * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) |
792 */ |
871 */ |
793 __u32 busy; |
872 __u32 busy; |
794 }; |
873 }; |
795 |
874 |
|
875 /** |
|
876 * I915_CACHING_NONE |
|
877 * |
|
878 * GPU access is not coherent with cpu caches. Default for machines without an |
|
879 * LLC. |
|
880 */ |
796 #define I915_CACHING_NONE 0 |
881 #define I915_CACHING_NONE 0 |
|
882 /** |
|
883 * I915_CACHING_CACHED |
|
884 * |
|
885 * GPU access is coherent with cpu caches and furthermore the data is cached in |
|
886 * last-level caches shared between cpu cores and the gpu GT. Default on |
|
887 * machines with HAS_LLC. |
|
888 */ |
797 #define I915_CACHING_CACHED 1 |
889 #define I915_CACHING_CACHED 1 |
|
890 /** |
|
891 * I915_CACHING_DISPLAY |
|
892 * |
|
893 * Special GPU caching mode which is coherent with the scanout engines. |
|
894 * Transparently falls back to I915_CACHING_NONE on platforms where no special |
|
895 * cache mode (like write-through or gfdt flushing) is available. The kernel |
|
896 * automatically sets this mode when using a buffer as a scanout target. |
|
897 * Userspace can manually set this mode to avoid a costly stall and clflush in |
|
898 * the hotpath of drawing the first frame. |
|
899 */ |
|
900 #define I915_CACHING_DISPLAY 2 |
798 |
901 |
799 struct drm_i915_gem_caching { |
902 struct drm_i915_gem_caching { |
800 /** |
903 /** |
801 * Handle of the buffer to set/get the caching level of. */ |
904 * Handle of the buffer to set/get the caching level of. */ |
802 __u32 handle; |
905 __u32 handle; |
1025 __u32 ctx_id; |
1135 __u32 ctx_id; |
1026 __u32 pad; |
1136 __u32 pad; |
1027 }; |
1137 }; |
1028 |
1138 |
1029 struct drm_i915_reg_read { |
1139 struct drm_i915_reg_read { |
|
1140 /* |
|
1141 * Register offset. |
|
1142 * For 64bit wide registers where the upper 32bits don't immediately |
|
1143 * follow the lower 32bits, the offset of the lower 32bits must |
|
1144 * be specified |
|
1145 */ |
1030 __u64 offset; |
1146 __u64 offset; |
1031 __u64 val; /* Return value */ |
1147 __u64 val; /* Return value */ |
1032 }; |
1148 }; |
|
1149 /* Known registers: |
|
1150 * |
|
1151 * Render engine timestamp - 0x2358 + 64bit - gen7+ |
|
1152 * - Note this register returns an invalid value if using the default |
|
1153 * single instruction 8byte read, in order to workaround that use |
|
1154 * offset (0x2538 | 1) instead. |
|
1155 * |
|
1156 */ |
|
1157 |
|
1158 struct drm_i915_reset_stats { |
|
1159 __u32 ctx_id; |
|
1160 __u32 flags; |
|
1161 |
|
1162 /* All resets since boot/module reload, for all contexts */ |
|
1163 __u32 reset_count; |
|
1164 |
|
1165 /* Number of batches lost when active in GPU, for this context */ |
|
1166 __u32 batch_active; |
|
1167 |
|
1168 /* Number of batches lost pending for execution, for this context */ |
|
1169 __u32 batch_pending; |
|
1170 |
|
1171 __u32 pad; |
|
1172 }; |
|
1173 |
|
1174 struct drm_i915_gem_userptr { |
|
1175 __u64 user_ptr; |
|
1176 __u64 user_size; |
|
1177 __u32 flags; |
|
1178 #define I915_USERPTR_READ_ONLY 0x1 |
|
1179 #define I915_USERPTR_UNSYNCHRONIZED 0x80000000 |
|
1180 /** |
|
1181 * Returned handle for the object. |
|
1182 * |
|
1183 * Object handles are nonzero. |
|
1184 */ |
|
1185 __u32 handle; |
|
1186 }; |
|
1187 |
|
1188 struct drm_i915_gem_context_param { |
|
1189 __u32 ctx_id; |
|
1190 __u32 size; |
|
1191 __u64 param; |
|
1192 #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 |
|
1193 #define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2 |
|
1194 #define I915_CONTEXT_PARAM_GTT_SIZE 0x3 |
|
1195 __u64 value; |
|
1196 }; |
|
1197 |
1033 #endif /* _I915_DRM_H_ */ |
1198 #endif /* _I915_DRM_H_ */ |