diff options
| author | Michał Winiarski <michal.winiarski@intel.com> | 2017-10-16 11:05:16 +0200 |
|---|---|---|
| committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2017-10-17 10:26:30 +0300 |
| commit | 131ad520cb44c7dafacc6ef327d9fa6cda9067ab (patch) | |
| tree | 2a37ff7dfdc99faf8ef5722c4614bfac813df228 /lib/i915/gem_context.h | |
| parent | 588555f779095a9d282f414aec22e5532891ecdc (diff) | |
lib/i915: Move context related helpers to lib/i915/gem_context
We'd like to make ioctl_wrappers a bit thinner, and we plan to add new
helpers in the following patch. Let's move context related helpers before
adding more content.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/i915/gem_context.h')
| -rw-r--r-- | lib/i915/gem_context.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/i915/gem_context.h b/lib/i915/gem_context.h new file mode 100644 index 00000000..06b2ca99 --- /dev/null +++ b/lib/i915/gem_context.h @@ -0,0 +1,48 @@ +/* + * Copyright © 2017 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef GEM_CONTEXT_H +#define GEM_CONTEXT_H + +uint32_t gem_context_create(int fd); +void gem_context_destroy(int fd, uint32_t ctx_id); +int __gem_context_destroy(int fd, uint32_t ctx_id); +struct local_i915_gem_context_param { + uint32_t context; + uint32_t size; + uint64_t param; +#define LOCAL_CONTEXT_PARAM_BAN_PERIOD 0x1 +#define LOCAL_CONTEXT_PARAM_NO_ZEROMAP 0x2 +#define LOCAL_CONTEXT_PARAM_GTT_SIZE 0x3 +#define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4 +#define LOCAL_CONTEXT_PARAM_BANNABLE 0x5 + uint64_t value; +}; +void gem_context_require_bannable(int fd); +void gem_context_require_param(int fd, uint64_t param); +void gem_context_get_param(int fd, struct local_i915_gem_context_param *p); +void gem_context_set_param(int fd, struct local_i915_gem_context_param *p); +int __gem_context_set_param(int fd, struct local_i915_gem_context_param *p); +int __gem_context_get_param(int fd, struct local_i915_gem_context_param *p); + +#endif /* GEM_CONTEXT_H */ |
