drm/i915/pool: constrain pool objects by mapping type
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / gt / intel_gt_buffer_pool_types.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright © 2014-2018 Intel Corporation
5  */
6
7 #ifndef INTEL_GT_BUFFER_POOL_TYPES_H
8 #define INTEL_GT_BUFFER_POOL_TYPES_H
9
10 #include <linux/list.h>
11 #include <linux/spinlock.h>
12 #include <linux/workqueue.h>
13
14 #include "gem/i915_gem_object_types.h"
15 #include "i915_active_types.h"
16
17 struct intel_gt_buffer_pool {
18         spinlock_t lock;
19         struct list_head cache_list[4];
20         struct delayed_work work;
21 };
22
23 struct intel_gt_buffer_pool_node {
24         struct i915_active active;
25         struct drm_i915_gem_object *obj;
26         struct list_head link;
27         union {
28                 struct intel_gt_buffer_pool *pool;
29                 struct intel_gt_buffer_pool_node *free;
30                 struct rcu_head rcu;
31         };
32         unsigned long age;
33         enum i915_map_type type;
34 };
35
36 #endif /* INTEL_GT_BUFFER_POOL_TYPES_H */