linux/include/uapi/drm
Chris Wilson 9d1305ef80 drm/i915: Introduce the i915_user_extension_method
An idea for extending uABI inspired by Vulkan's extension chains.
Instead of expanding the data struct for each ioctl every time we need
to add a new feature, define an extension chain instead. As we add
optional interfaces to control the ioctl, we define a new extension
struct that can be linked into the ioctl data only when required by the
user. The key advantage being able to ignore large control structs for
optional interfaces/extensions, while being able to process them in a
consistent manner.

In comparison to other extensible ioctls, the key difference is the
use of a linked chain of extension structs vs an array of tagged
pointers. For example,

struct drm_amdgpu_cs_chunk {
        __u32           chunk_id;
        __u32           length_dw;
        __u64           chunk_data;
};

struct drm_amdgpu_cs_in {
        __u32           ctx_id;
        __u32           bo_list_handle;
        __u32           num_chunks;
        __u32           _pad;
        __u64           chunks;
};

allows userspace to pass in array of pointers to extension structs, but
must therefore keep constructing that array along side the command stream.
In dynamic situations like that, a linked list is preferred and does not
similar from extra cache line misses as the extension structs themselves
must still be loaded separate to the chunks array.

v2: Apply the tail call optimisation directly to nip the worry of stack
overflow in the bud.
v3: Defend against recursion.
v4: Fixup local types to match new uabi

Opens:
- do we include the result as an out-field in each chain?
struct i915_user_extension {
	__u64 next_extension;
	__u64 name;
	__s32 result;
	__u32 mbz; /* reserved for future use */
};
* Undecided, so provision some room for future expansion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322092325.5883-1-chris@chris-wilson.co.uk
2019-03-22 13:12:30 +00:00
..
amdgpu_drm.h drm/amdgpu: Add command to override the context priority. 2019-02-15 11:15:43 -05:00
armada_drm.h License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
drm.h drm/syncobj: disable the timeline UAPI for now v2 2018-11-08 11:31:34 +01:00
drm_fourcc.h drm/fourcc: Add 64 bpp half float formats 2019-03-13 11:10:31 +01:00
drm_mode.h drm: Add a new plane property to send damage during plane update 2018-12-05 10:00:35 +01:00
drm_sarea.h drm: add extern C guard for the UAPI headers 2016-05-13 13:57:17 +01:00
etnaviv_drm.h drm/etnaviv: add more minor features fields 2018-03-09 12:22:36 +01:00
exynos_drm.h drm/exynos: ipp: Add IPP v2 framework 2018-05-10 08:48:53 +09:00
i810_drm.h License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
i915_drm.h drm/i915: Introduce the i915_user_extension_method 2019-03-22 13:12:30 +00:00
mga_drm.h drm/mga: add extern C guard for the UAPI header 2016-05-13 14:06:07 +01:00
msm_drm.h drm/msm: add uapi to get/set debug name 2018-12-11 13:07:05 -05:00
nouveau_drm.h drm/nouveau/svm: new ioctl to migrate process memory to GPU memory 2019-02-20 09:00:03 +10:00
omap_drm.h License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
qxl_drm.h drm/qxl: fix __user annotations 2017-06-23 10:06:31 +02:00
r128_drm.h drm/r128: add extern C guard for the UAPI header 2016-05-13 14:06:13 +01:00
radeon_drm.h drm/radeon: add extern C guard for the UAPI header 2016-05-13 14:06:14 +01:00
savage_drm.h drm/savage: add extern C guard for the UAPI header 2016-05-13 14:06:15 +01:00
sis_drm.h drm/sis: add extern C guard for the UAPI header 2016-05-13 14:06:16 +01:00
tegra_drm.h drm/tegra: Add kerneldoc for UAPI 2018-05-19 00:21:20 +02:00
v3d_drm.h drm/v3d: Document cache flushing ABI. 2018-12-07 10:55:48 -08:00
vc4_drm.h drm/vc4: Add a pad field to align drm_vc4_submit_cl to 64 bits. 2018-05-03 15:20:09 -07:00
vgem_drm.h drm/vgem: Attach sw fences to exported vGEM dma-buf (ioctl) 2016-07-18 08:54:55 +02:00
via_drm.h drm/via: add extern C guard for the UAPI header 2016-05-13 14:06:19 +01:00
virtgpu_drm.h drm/virtio: add in/out fence support for explicit synchronization 2018-11-14 14:21:02 +01:00
vmwgfx_drm.h drm/vmwgfx: Expose SM4_1 param to user space 2018-07-06 20:16:09 +02:00