1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright © 2018 Intel Corporation
5 */
6
7#ifndef __IGT_GEM_UTILS_H__
8#define __IGT_GEM_UTILS_H__
9
10#include <linux/types.h>
11
12#include "i915_vma.h"
13
14struct i915_request;
15struct i915_gem_context;
16struct i915_vma;
17
18struct intel_context;
19struct intel_engine_cs;
20
21struct i915_request *
22igt_request_alloc(struct i915_gem_context *ctx, struct intel_engine_cs *engine);
23
24struct i915_vma *
25igt_emit_store_dw(struct i915_vma *vma,
26 u64 offset,
27 unsigned long count,
28 u32 val);
29
30int igt_gpu_fill_dw(struct intel_context *ce,
31 struct i915_vma *vma, u64 offset,
32 unsigned long count, u32 val);
33
34static inline int __must_check
35igt_vma_move_to_active_unlocked(struct i915_vma *vma, struct i915_request *rq,
36 unsigned int flags)
37{
38 int err;
39
40 i915_vma_lock(vma);
41 err = i915_vma_move_to_active(vma, rq, flags);
42 i915_vma_unlock(vma);
43 return err;
44}
45
46#endif /* __IGT_GEM_UTILS_H__ */
47

source code of linux/drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.h