mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 05:43:02 +00:00
lib/drmtest: extract gem_create_context
libdrm requirements are now up to it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -46,28 +46,6 @@
|
||||
#include "i915_drm.h"
|
||||
#include "drmtest.h"
|
||||
|
||||
struct local_drm_i915_gem_context_create {
|
||||
__u32 ctx_id;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
#define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create)
|
||||
|
||||
static uint32_t context_create(int fd)
|
||||
{
|
||||
struct local_drm_i915_gem_context_create create;
|
||||
int ret;
|
||||
|
||||
ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create);
|
||||
if (ret == -1 && (errno == ENODEV || errno == EINVAL)) {
|
||||
igt_skip();
|
||||
} else if (ret) {
|
||||
abort();
|
||||
}
|
||||
|
||||
return create.ctx_id;
|
||||
}
|
||||
|
||||
/* Copied from gem_exec_nop.c */
|
||||
static int exec(int fd, uint32_t handle, int ring, int ctx_id)
|
||||
{
|
||||
@@ -116,7 +94,7 @@ int main(int argc, char *argv[])
|
||||
igt_fixture {
|
||||
fd = drm_open_any();
|
||||
|
||||
ctx_id = context_create(fd);
|
||||
ctx_id = gem_context_create(fd);
|
||||
|
||||
handle = gem_create(fd, 4096);
|
||||
gem_write(fd, handle, 0, batch, sizeof(batch));
|
||||
|
||||
Reference in New Issue
Block a user