mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 00:46:17 +00:00
lib/ioctl: Add gem_context_destroy helpers
We also need a raw version for some tests. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
8d21b39251
commit
09b8211d41
@ -630,6 +630,38 @@ uint32_t gem_context_create(int fd)
|
|||||||
return create.ctx_id;
|
return create.ctx_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __gem_context_destroy(int fd, uint32_t ctx_id)
|
||||||
|
{
|
||||||
|
struct drm_i915_gem_context_destroy destroy;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
memset(&destroy, 0, sizeof(destroy));
|
||||||
|
destroy.ctx_id = ctx_id;
|
||||||
|
|
||||||
|
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_DESTROY, &destroy);
|
||||||
|
if (ret)
|
||||||
|
return -errno;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gem_context_create:
|
||||||
|
* @fd: open i915 drm file descriptor
|
||||||
|
* @ctx_id: i915 hw context id
|
||||||
|
*
|
||||||
|
* This is a wraps the CONTEXT_DESTROY ioctl, which is used to free a hardware
|
||||||
|
* context.
|
||||||
|
*/
|
||||||
|
void gem_context_destroy(int fd, uint32_t ctx_id)
|
||||||
|
{
|
||||||
|
struct drm_i915_gem_context_destroy destroy;
|
||||||
|
|
||||||
|
memset(&destroy, 0, sizeof(destroy));
|
||||||
|
destroy.ctx_id = ctx_id;
|
||||||
|
|
||||||
|
do_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_DESTROY, &destroy);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gem_sw_finish:
|
* gem_sw_finish:
|
||||||
* @fd: open i915 drm file descriptor
|
* @fd: open i915 drm file descriptor
|
||||||
|
@ -95,6 +95,8 @@ void *gem_mmap__wc(int fd, uint32_t handle, int offset, int size, int prot);
|
|||||||
int gem_madvise(int fd, uint32_t handle, int state);
|
int gem_madvise(int fd, uint32_t handle, int state);
|
||||||
|
|
||||||
uint32_t gem_context_create(int fd);
|
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);
|
||||||
|
|
||||||
void gem_sw_finish(int fd, uint32_t handle);
|
void gem_sw_finish(int fd, uint32_t handle);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user