summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool_types.h
blob: df1d75d08cd277099f3b55343b82794cb8a2c5e4 (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
35
36
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2014-2018 Intel Corporation
 */

#ifndef INTEL_GT_BUFFER_POOL_TYPES_H
#define INTEL_GT_BUFFER_POOL_TYPES_H

#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>

#include "gem/i915_gem_object_types.h"
#include "i915_active_types.h"

struct intel_gt_buffer_pool {
	spinlock_t lock;
	struct list_head cache_list[4];
	struct delayed_work work;
};

struct intel_gt_buffer_pool_node {
	struct i915_active active;
	struct drm_i915_gem_object *obj;
	struct list_head link;
	union {
		struct intel_gt_buffer_pool *pool;
		struct intel_gt_buffer_pool_node *free;
		struct rcu_head rcu;
	};
	unsigned long age;
	enum i915_map_type type;
	u32 pinned;
};

#endif /* INTEL_GT_BUFFER_POOL_TYPES_H */