summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_engine_pool.h
blob: 1bd89cadc3b79984c6862b11542e0e2cff33a819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * SPDX-License-Identifier: MIT
 *
 * Copyright © 2014-2018 Intel Corporation
 */

#ifndef INTEL_ENGINE_POOL_H
#define INTEL_ENGINE_POOL_H

#include "intel_engine_pool_types.h"
#include "i915_active.h"
#include "i915_request.h"

struct intel_engine_pool_node *
intel_engine_get_pool(struct intel_engine_cs *engine, size_t size);

static inline int
intel_engine_pool_mark_active(struct intel_engine_pool_node *node,
			      struct i915_request *rq)
{
	return i915_active_add_request(&node->active, rq);
}

static inline void
intel_engine_pool_put(struct intel_engine_pool_node *node)
{
	i915_active_release(&node->active);
}

void intel_engine_pool_init(struct intel_engine_pool *pool);
void intel_engine_pool_park(struct intel_engine_pool *pool);
void intel_engine_pool_fini(struct intel_engine_pool *pool);

#endif /* INTEL_ENGINE_POOL_H */