bcf1658c96338854a65bde82a371356cf24f763b
[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 "i915_active_types.h"
15
16 struct drm_i915_gem_object;
17
18 struct intel_gt_buffer_pool {
19         spinlock_t lock;
20         struct list_head cache_list[4];
21         struct delayed_work work;
22 };
23
24 struct intel_gt_buffer_pool_node {
25         struct i915_active active;
26         struct drm_i915_gem_object *obj;
27         struct list_head link;
28         union {
29                 struct intel_gt_buffer_pool *pool;
30                 struct intel_gt_buffer_pool_node *free;
31                 struct rcu_head rcu;
32         };
33         unsigned long age;
34 };
35
36 #endif /* INTEL_GT_BUFFER_POOL_TYPES_H */