History

drm/i915: Seal busy-ioctl uABI and prevent leaking of internal ids

Tvrtko was looking through the execbuffer-ioctl and noticed that the uABI was tightly coupled to our internal engine identifiers. Close inspection also revealed that we leak those internal engine identifiers through the busy-ioctl, and those internal identifiers already do not match the user identifiers. Fortuitiously, there is only one user of the set of busy rings from the busy-ioctl, and they only wish to choose between the RENDER and the BLT engines. Let's fix the userspace ABI while we still can. v2: Update the uAPI documentation to explain the identifiers.

Chris Wilson committed 10 years ago

Commit 426960b1 parent de1add35 files · +54 −8Browse files

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

Unified · Split

include/uapi/drm/i915_drm.h+29−4
@@ -812,10 +812,35 @@ struct drm_i915_gem_busy { · 811 unmodified lines
812812 /** Handle of the buffer to check for busy */
813813 __u32 handle;
814814
815− /** Return busy status (1 if busy, 0 if idle).
816− * The high word is used to indicate on which rings the object
817− * currently resides:
818− * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc)
815+ /** Return busy status
816+ *
817+ * A return of 0 implies that the object is idle (after
818+ * having flushed any pending activity), and a non-zero return that
819+ * the object is still in-flight on the GPU. (The GPU has not yet
820+ * signaled completion for all pending requests that reference the
821+ * object.)
822+ *
823+ * The returned dword is split into two fields to indicate both
824+ * the engines on which the object is being read, and the
825+ * engine on which it is currently being written (if any).
826+ *
827+ * The low word (bits 0:15) indicate if the object is being written
828+ * to by any engine (there can only be one, as the GEM implicit
829+ * synchronisation rules force writes to be serialised). Only the
830+ * engine for the last write is reported.
831+ *
832+ * The high word (bits 16:31) are a bitmask of which engines are
833+ * currently reading from the object. Multiple engines may be
834+ * reading from the object simultaneously.
835+ *
836+ * The value of each engine is the same as specified in the
837+ * EXECBUFFER2 ioctl, i.e. I915_EXEC_RENDER, I915_EXEC_BSD etc.
838+ * Note I915_EXEC_DEFAULT is a symbolic value and is mapped to
839+ * the I915_EXEC_RENDER engine for execution, and so it is never
840+ * reported as active itself. Some hardware may have parallel
841+ * execution engines, e.g. multiple media engines, which are
842+ * mapped to the same identifier in the EXECBUFFER2 ioctl and
843+ * so are not separately reported for busyness.
819844 */
820845 __u32 busy;
821846 };

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