Skip to content

Commit eea5b2c

Browse files
authored
feaure: Update docs to show DDI Driver Handles are default as of 1.17 (#473)
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 89af464 commit eea5b2c

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

scripts/core/EXT_Driver_DDIHandles.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ Handle Structures:
4747
zer_dditable_driver_t *pRuntime; // [in] pointer to _zer_dditable_t_ object related to this handle
4848
} ze_handle_t;
4949
50+
Mandatory Support (Spec v1.17+):
51+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
Starting from Level Zero spec version 1.17, support for this extension is **required** for any driver reporting API version 1.17 or later via ``${x}DriverGetApiVersion``.
54+
The loader does **not** need to query the extension property for such drivers — DDI handles are unconditionally available.
55+
56+
.. note::
57+
58+
Drivers reporting API version 1.17 or later must support **extension version 1.1** of this extension, which corresponds to the full ``ze_handle_t`` structure including the ``pRuntime`` member (pointer to ``zer_dditable_driver_t``).
59+
Such drivers **must** initialize ``pRuntime`` in every handle they allocate — at minimum with zeroed/empty function pointer values — so that the loader can safely dereference it without a null-pointer check.
60+
A driver that sets ``pRuntime`` to ``nullptr`` while reporting API version 1.17 is non-conformant; any loader or application attempt to dispatch a ``zer_*`` call through that handle will result in undefined behavior (null pointer dereference / crash).
61+
62+
For drivers reporting API version 1.16 or earlier, the loader must continue to check for this extension via ``${x}DriverGetExtensionProperties``
63+
before using DDI handles, preserving full backwards compatibility.
64+
65+
This guarantee enables Level Zero extensions introduced in spec v1.17 or later to embed handles directly inside Level Zero structures
66+
(e.g., via ``pNext`` chains) without requiring the loader to translate or unwrap the handles.
67+
Additionally, drivers may assume the loader will dispatch calls exclusively via the DDI tables embedded in their handles;
68+
the only exception is the global DDI table used during driver initialization and to read the driver's reported API version.
69+
5070
DDI Handles Extension:
5171
~~~~~~~~~~~~~~~~~~~~~~
5272

scripts/core/driver.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ ordinal: "1"
240240
details:
241241
- "The application may call this function from simultaneous threads."
242242
- "The implementation of this function should be lock-free."
243+
- "Starting from API version 1.17, any driver reporting version 1.17 or later is assumed to support the $X_DRIVER_DDI_HANDLES_EXT_NAME extension; see $x_driver_ddi_handles_ext_properties_t for details."
243244
params:
244245
- type: $x_driver_handle_t
245246
name: hDriver

scripts/core/driverDDIHandles.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ members:
4949
[out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t
5050
details:
5151
- "This structure may be returned from $xDriverGetProperties, via the `pNext` member of $x_driver_properties_t."
52+
- "Starting from spec version 1.17, support for this extension is assumed for any driver reporting API version 1.17 or later via $xDriverGetApiVersion; the loader does NOT need to query the extension property for such drivers."
53+
- "For drivers reporting API version 1.16 or earlier, the loader must check for this extension before using DDI handles."
54+
- "This guarantee enables Level Zero extensions introduced in spec v1.17 or later to embed handles directly inside Level Zero structures (e.g., via pNext chains) without requiring the loader to translate or unwrap handles."
55+
- "Additionally, drivers may assume the loader will dispatch calls exclusively via the DDI tables embedded in their handles; the only exception is the global DDI table used during driver initialization and to read the reported API version."

0 commit comments

Comments
 (0)