diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-24 11:13:40 -0500 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-07 12:19:06 -0500 |
| commit | c9dc0f35986c0e2fc81e0b71ddc7e3adad733829 (patch) | |
| tree | d59a7dc0157916e519d9aa04527f85eea670cec5 /include/uapi | |
| parent | f9b61ff6bce9a44555324b29e593fdffc9a115bc (diff) | |
drm/i915: Add ioctl to set per-context parameters
Sometimes we wish to tweak how an individual context behaves. Since we
always create a context for every filp, this means that individual
processes can fine tune their behaviour even if they do not explicitly
create a context.
The first example parameter here is to enable multi-process GPU testing,
but the interface should be able to cope with passing arbitrarily complex
parameters.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Testcase: igt/gem_reset_stats/ban-period-*
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/drm/i915_drm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index c155a0347949..2e559f6e699e 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
| @@ -224,6 +224,8 @@ typedef struct _drm_i915_sarea { | |||
| 224 | #define DRM_I915_REG_READ 0x31 | 224 | #define DRM_I915_REG_READ 0x31 |
| 225 | #define DRM_I915_GET_RESET_STATS 0x32 | 225 | #define DRM_I915_GET_RESET_STATS 0x32 |
| 226 | #define DRM_I915_GEM_USERPTR 0x33 | 226 | #define DRM_I915_GEM_USERPTR 0x33 |
| 227 | #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 | ||
| 228 | #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 | ||
| 227 | 229 | ||
| 228 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 230 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
| 229 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 231 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
| @@ -275,6 +277,8 @@ typedef struct _drm_i915_sarea { | |||
| 275 | #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) | 277 | #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) |
| 276 | #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) | 278 | #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) |
| 277 | #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) | 279 | #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) |
| 280 | #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) | ||
| 281 | #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) | ||
| 278 | 282 | ||
| 279 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 283 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
| 280 | * on the security mechanisms provided by hardware. | 284 | * on the security mechanisms provided by hardware. |
| @@ -1082,4 +1086,12 @@ struct drm_i915_gem_userptr { | |||
| 1082 | __u32 handle; | 1086 | __u32 handle; |
| 1083 | }; | 1087 | }; |
| 1084 | 1088 | ||
| 1089 | struct drm_i915_gem_context_param { | ||
| 1090 | __u32 ctx_id; | ||
| 1091 | __u32 size; | ||
| 1092 | __u64 param; | ||
| 1093 | #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 | ||
| 1094 | __u64 value; | ||
| 1095 | }; | ||
| 1096 | |||
| 1085 | #endif /* _UAPI_I915_DRM_H_ */ | 1097 | #endif /* _UAPI_I915_DRM_H_ */ |
