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#include "drmP.h"
26#include "nouveau_drv.h"
27#include "nouveau_util.h"
28#include "nouveau_vm.h"
29#include "nouveau_ramht.h"
30
31struct nv98_ppp_engine {
32 struct nouveau_exec_engine base;
33};
34
35static int
36nv98_ppp_fini(struct drm_device *dev, int engine, bool suspend)
37{
38 if (!(nv_rd32(dev, 0x000200) & 0x00000002))
39 return 0;
40
41 nv_mask(dev, 0x000200, 0x00000002, 0x00000000);
42 return 0;
43}
44
45static int
46nv98_ppp_init(struct drm_device *dev, int engine)
47{
48 nv_mask(dev, 0x000200, 0x00000002, 0x00000000);
49 nv_mask(dev, 0x000200, 0x00000002, 0x00000002);
50 return 0;
51}
52
53static void
54nv98_ppp_destroy(struct drm_device *dev, int engine)
55{
56 struct nv98_ppp_engine *pppp = nv_engine(dev, engine);
57
58 NVOBJ_ENGINE_DEL(dev, PPP);
59
60 kfree(pppp);
61}
62
63int
64nv98_ppp_create(struct drm_device *dev)
65{
66 struct nv98_ppp_engine *pppp;
67
68 pppp = kzalloc(sizeof(*pppp), GFP_KERNEL);
69 if (!pppp)
70 return -ENOMEM;
71
72 pppp->base.destroy = nv98_ppp_destroy;
73 pppp->base.init = nv98_ppp_init;
74 pppp->base.fini = nv98_ppp_fini;
75
76 NVOBJ_ENGINE_ADD(dev, PPP, &pppp->base);
77 return 0;
78}
79