This source file includes following definitions.
- drm_legacy_init_members
- drm_legacy_destroy_members
- drm_legacy_setup
- drm_legacy_dev_reinit
- drm_master_legacy_init
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 #include <drm/drm_agpsupport.h>
37 #include <drm/drm_device.h>
38 #include <drm/drm_drv.h>
39 #include <drm/drm_irq.h>
40 #include <drm/drm_print.h>
41
42 #include "drm_internal.h"
43 #include "drm_legacy.h"
44
45 void drm_legacy_init_members(struct drm_device *dev)
46 {
47 INIT_LIST_HEAD(&dev->ctxlist);
48 INIT_LIST_HEAD(&dev->vmalist);
49 INIT_LIST_HEAD(&dev->maplist);
50 spin_lock_init(&dev->buf_lock);
51 mutex_init(&dev->ctxlist_mutex);
52 }
53
54 void drm_legacy_destroy_members(struct drm_device *dev)
55 {
56 mutex_destroy(&dev->ctxlist_mutex);
57 }
58
59 int drm_legacy_setup(struct drm_device * dev)
60 {
61 int ret;
62
63 if (dev->driver->firstopen &&
64 drm_core_check_feature(dev, DRIVER_LEGACY)) {
65 ret = dev->driver->firstopen(dev);
66 if (ret != 0)
67 return ret;
68 }
69
70 ret = drm_legacy_dma_setup(dev);
71 if (ret < 0)
72 return ret;
73
74
75 DRM_DEBUG("\n");
76 return 0;
77 }
78
79 void drm_legacy_dev_reinit(struct drm_device *dev)
80 {
81 if (dev->irq_enabled)
82 drm_irq_uninstall(dev);
83
84 mutex_lock(&dev->struct_mutex);
85
86 drm_legacy_agp_clear(dev);
87
88 drm_legacy_sg_cleanup(dev);
89 drm_legacy_vma_flush(dev);
90 drm_legacy_dma_takedown(dev);
91
92 mutex_unlock(&dev->struct_mutex);
93
94 dev->sigdata.lock = NULL;
95
96 dev->context_flag = 0;
97 dev->last_context = 0;
98 dev->if_version = 0;
99
100 DRM_DEBUG("lastclose completed\n");
101 }
102
103 void drm_master_legacy_init(struct drm_master *master)
104 {
105 spin_lock_init(&master->lock.spinlock);
106 init_waitqueue_head(&master->lock.lock_queue);
107 }