History

drm/i915: Allow execbuffer to use the first object as the batch

Currently, the last object in the execlist is the always the batch. However, when building the batch buffer we often know the batch object first and if we can use the first slot in the execlist we can emit relocation instructions relative to it immediately and avoid a separate pass to adjust the relocations to point to the last execlist slot.

Chris Wilson committed 9 years ago

Commit 1a71cf21 parent 8a2421b3 files · +22 −3Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/drm/i915_drm.h+17−2
@@ -418,7 +418,6 @@ typedef struct drm_i915_irq_wait { · 417 unmodified lines
418 */418 */
419#define I915_PARAM_HAS_EXEC_CAPTURE 45419#define I915_PARAM_HAS_EXEC_CAPTURE 45
420 420
421/* Query the mask of slices available for this system */
422#define I915_PARAM_SLICE_MASK 46421#define I915_PARAM_SLICE_MASK 46
423 422
424/* Assuming it's uniform for each slice, this queries the mask of subslices423/* Assuming it's uniform for each slice, this queries the mask of subslices
@@ -426,6 +425,12 @@ typedef struct drm_i915_irq_wait { · 1 unmodified line
426 */425 */
427#define I915_PARAM_SUBSLICE_MASK 47426#define I915_PARAM_SUBSLICE_MASK 47
428 427
428/*
429 * Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying the batch buffer
430 * as the first execobject as opposed to the last. See I915_EXEC_BATCH_FIRST.
431 */
432#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
433
429typedef struct drm_i915_getparam {434typedef struct drm_i915_getparam {
430 __s32 param;435 __s32 param;
431 /*436 /*
@@ -912,7 +917,17 @@ struct drm_i915_gem_execbuffer2 { · 480 unmodified lines
912 */917 */
913#define I915_EXEC_FENCE_OUT (1<<17)918#define I915_EXEC_FENCE_OUT (1<<17)
914 919
915#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_OUT<<1))920/*
921 * Traditionally the execbuf ioctl has only considered the final element in
922 * the execobject[] to be the executable batch. Often though, the client
923 * will known the batch object prior to construction and being able to place
924 * it into the execobject[] array first can simplify the relocation tracking.
925 * Setting I915_EXEC_BATCH_FIRST tells execbuf to use element 0 of the
926 * execobject[] as the * batch instead (the default is to use the last
927 * element).
928 */
929#define I915_EXEC_BATCH_FIRST (1<<18)
930#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_BATCH_FIRST<<1))
916 931
917#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)932#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
918#define i915_execbuffer2_set_context_id(eb2, context) \933#define i915_execbuffer2_set_context_id(eb2, context) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t