aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-01-14 00:06:26 -0500
committerBen Skeggs <bskeggs@redhat.com>2015-01-21 21:17:55 -0500
commit2799bba69a1caf54889035ed63247d09c4a2fc84 (patch)
tree4e59e52fba89d7e4c6adef6fb6e1efb5e480e6fb
parent78b2b4e76be2100637a92b9721aaa2ce73d0fa22 (diff)
drm/nouveau/ltc: namespace + nvidia gpu names (no binary change)
The namespace of NVKM is being changed to nvkm_ instead of nouveau_, which will be used for the DRM part of the driver. This is being done in order to make it very clear as to what part of the driver a given symbol belongs to, and as a minor step towards splitting the DRM driver out to be able to stand on its own (for virt). Because there's already a large amount of churn here anyway, this is as good a time as any to also switch to NVIDIA's device and chipset naming to ease collaboration with them. A comparison of objdump disassemblies proves no code changes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h39
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h4
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c30
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gf100.c40
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gk104.c7
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gm107.c19
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h46
7 files changed, 88 insertions, 97 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
index 432717a421d3..f37fd1a50077 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
@@ -1,35 +1,32 @@
1#ifndef __NOUVEAU_LTC_H__ 1#ifndef __NVKM_LTC_H__
2#define __NOUVEAU_LTC_H__ 2#define __NVKM_LTC_H__
3
4#include <core/subdev.h> 3#include <core/subdev.h>
5#include <core/device.h> 4struct nvkm_mm_node;
6
7#define NOUVEAU_LTC_MAX_ZBC_CNT 16
8 5
9struct nouveau_mm_node; 6#define NVKM_LTC_MAX_ZBC_CNT 16
10 7
11struct nouveau_ltc { 8struct nvkm_ltc {
12 struct nouveau_subdev base; 9 struct nvkm_subdev base;
13 10
14 int (*tags_alloc)(struct nouveau_ltc *, u32 count, 11 int (*tags_alloc)(struct nvkm_ltc *, u32 count,
15 struct nouveau_mm_node **); 12 struct nvkm_mm_node **);
16 void (*tags_free)(struct nouveau_ltc *, struct nouveau_mm_node **); 13 void (*tags_free)(struct nvkm_ltc *, struct nvkm_mm_node **);
17 void (*tags_clear)(struct nouveau_ltc *, u32 first, u32 count); 14 void (*tags_clear)(struct nvkm_ltc *, u32 first, u32 count);
18 15
19 int zbc_min; 16 int zbc_min;
20 int zbc_max; 17 int zbc_max;
21 int (*zbc_color_get)(struct nouveau_ltc *, int index, const u32[4]); 18 int (*zbc_color_get)(struct nvkm_ltc *, int index, const u32[4]);
22 int (*zbc_depth_get)(struct nouveau_ltc *, int index, const u32); 19 int (*zbc_depth_get)(struct nvkm_ltc *, int index, const u32);
23}; 20};
24 21
25static inline struct nouveau_ltc * 22static inline struct nvkm_ltc *
26nouveau_ltc(void *obj) 23nvkm_ltc(void *obj)
27{ 24{
28 return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_LTC); 25 return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_LTC);
29} 26}
30 27
31extern struct nouveau_oclass *gf100_ltc_oclass; 28extern struct nvkm_oclass *gf100_ltc_oclass;
32extern struct nouveau_oclass *gk104_ltc_oclass; 29extern struct nvkm_oclass *gk104_ltc_oclass;
33extern struct nouveau_oclass *gm107_ltc_oclass; 30extern struct nvkm_oclass *gm107_ltc_oclass;
34 31
35#endif 32#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h
index f2818a2b6d68..413def63be0e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h
@@ -94,8 +94,8 @@ struct nvc0_gr_priv {
94 struct nvc0_gr_fuc fuc41ad; 94 struct nvc0_gr_fuc fuc41ad;
95 bool firmware; 95 bool firmware;
96 96
97 struct nvc0_gr_zbc_color zbc_color[NOUVEAU_LTC_MAX_ZBC_CNT]; 97 struct nvc0_gr_zbc_color zbc_color[NVKM_LTC_MAX_ZBC_CNT];
98 struct nvc0_gr_zbc_depth zbc_depth[NOUVEAU_LTC_MAX_ZBC_CNT]; 98 struct nvc0_gr_zbc_depth zbc_depth[NVKM_LTC_MAX_ZBC_CNT];
99 99
100 u8 rop_nr; 100 u8 rop_nr;
101 u8 gpc_nr; 101 u8 gpc_nr;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c
index 7fa331516f84..2fb87fbfd11c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c
@@ -21,17 +21,15 @@
21 * 21 *
22 * Authors: Ben Skeggs <bskeggs@redhat.com> 22 * Authors: Ben Skeggs <bskeggs@redhat.com>
23 */ 23 */
24
25#include "priv.h" 24#include "priv.h"
26 25
27static int 26static int
28nvkm_ltc_tags_alloc(struct nouveau_ltc *ltc, u32 n, 27nvkm_ltc_tags_alloc(struct nvkm_ltc *ltc, u32 n, struct nvkm_mm_node **pnode)
29 struct nouveau_mm_node **pnode)
30{ 28{
31 struct nvkm_ltc_priv *priv = (void *)ltc; 29 struct nvkm_ltc_priv *priv = (void *)ltc;
32 int ret; 30 int ret;
33 31
34 ret = nouveau_mm_head(&priv->tags, 0, 1, n, n, 1, pnode); 32 ret = nvkm_mm_head(&priv->tags, 0, 1, n, n, 1, pnode);
35 if (ret) 33 if (ret)
36 *pnode = NULL; 34 *pnode = NULL;
37 35
@@ -39,14 +37,14 @@ nvkm_ltc_tags_alloc(struct nouveau_ltc *ltc, u32 n,
39} 37}
40 38
41static void 39static void
42nvkm_ltc_tags_free(struct nouveau_ltc *ltc, struct nouveau_mm_node **pnode) 40nvkm_ltc_tags_free(struct nvkm_ltc *ltc, struct nvkm_mm_node **pnode)
43{ 41{
44 struct nvkm_ltc_priv *priv = (void *)ltc; 42 struct nvkm_ltc_priv *priv = (void *)ltc;
45 nouveau_mm_free(&priv->tags, pnode); 43 nvkm_mm_free(&priv->tags, pnode);
46} 44}
47 45
48static void 46static void
49nvkm_ltc_tags_clear(struct nouveau_ltc *ltc, u32 first, u32 count) 47nvkm_ltc_tags_clear(struct nvkm_ltc *ltc, u32 first, u32 count)
50{ 48{
51 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc); 49 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc);
52 struct nvkm_ltc_priv *priv = (void *)ltc; 50 struct nvkm_ltc_priv *priv = (void *)ltc;
@@ -59,7 +57,7 @@ nvkm_ltc_tags_clear(struct nouveau_ltc *ltc, u32 first, u32 count)
59} 57}
60 58
61static int 59static int
62nvkm_ltc_zbc_color_get(struct nouveau_ltc *ltc, int index, const u32 color[4]) 60nvkm_ltc_zbc_color_get(struct nvkm_ltc *ltc, int index, const u32 color[4])
63{ 61{
64 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc); 62 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc);
65 struct nvkm_ltc_priv *priv = (void *)ltc; 63 struct nvkm_ltc_priv *priv = (void *)ltc;
@@ -69,7 +67,7 @@ nvkm_ltc_zbc_color_get(struct nouveau_ltc *ltc, int index, const u32 color[4])
69} 67}
70 68
71static int 69static int
72nvkm_ltc_zbc_depth_get(struct nouveau_ltc *ltc, int index, const u32 depth) 70nvkm_ltc_zbc_depth_get(struct nvkm_ltc *ltc, int index, const u32 depth)
73{ 71{
74 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc); 72 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(ltc);
75 struct nvkm_ltc_priv *priv = (void *)ltc; 73 struct nvkm_ltc_priv *priv = (void *)ltc;
@@ -79,13 +77,13 @@ nvkm_ltc_zbc_depth_get(struct nouveau_ltc *ltc, int index, const u32 depth)
79} 77}
80 78
81int 79int
82_nvkm_ltc_init(struct nouveau_object *object) 80_nvkm_ltc_init(struct nvkm_object *object)
83{ 81{
84 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(object); 82 const struct nvkm_ltc_impl *impl = (void *)nv_oclass(object);
85 struct nvkm_ltc_priv *priv = (void *)object; 83 struct nvkm_ltc_priv *priv = (void *)object;
86 int ret, i; 84 int ret, i;
87 85
88 ret = nouveau_subdev_init(&priv->base.base); 86 ret = nvkm_subdev_init(&priv->base.base);
89 if (ret) 87 if (ret)
90 return ret; 88 return ret;
91 89
@@ -98,15 +96,15 @@ _nvkm_ltc_init(struct nouveau_object *object)
98} 96}
99 97
100int 98int
101nvkm_ltc_create_(struct nouveau_object *parent, struct nouveau_object *engine, 99nvkm_ltc_create_(struct nvkm_object *parent, struct nvkm_object *engine,
102 struct nouveau_oclass *oclass, int length, void **pobject) 100 struct nvkm_oclass *oclass, int length, void **pobject)
103{ 101{
104 const struct nvkm_ltc_impl *impl = (void *)oclass; 102 const struct nvkm_ltc_impl *impl = (void *)oclass;
105 struct nvkm_ltc_priv *priv; 103 struct nvkm_ltc_priv *priv;
106 int ret; 104 int ret;
107 105
108 ret = nouveau_subdev_create_(parent, engine, oclass, 0, "PLTCG", 106 ret = nvkm_subdev_create_(parent, engine, oclass, 0, "PLTCG",
109 "l2c", length, pobject); 107 "l2c", length, pobject);
110 priv = *pobject; 108 priv = *pobject;
111 if (ret) 109 if (ret)
112 return ret; 110 return ret;
@@ -119,7 +117,7 @@ nvkm_ltc_create_(struct nouveau_object *parent, struct nouveau_object *engine,
119 priv->base.tags_free = nvkm_ltc_tags_free; 117 priv->base.tags_free = nvkm_ltc_tags_free;
120 priv->base.tags_clear = nvkm_ltc_tags_clear; 118 priv->base.tags_clear = nvkm_ltc_tags_clear;
121 priv->base.zbc_min = 1; /* reserve 0 for disabled */ 119 priv->base.zbc_min = 1; /* reserve 0 for disabled */
122 priv->base.zbc_max = min(impl->zbc, NOUVEAU_LTC_MAX_ZBC_CNT) - 1; 120 priv->base.zbc_max = min(impl->zbc, NVKM_LTC_MAX_ZBC_CNT) - 1;
123 priv->base.zbc_color_get = nvkm_ltc_zbc_color_get; 121 priv->base.zbc_color_get = nvkm_ltc_zbc_color_get;
124 priv->base.zbc_depth_get = nvkm_ltc_zbc_depth_get; 122 priv->base.zbc_depth_get = nvkm_ltc_zbc_depth_get;
125 return 0; 123 return 0;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gf100.c
index 2db0977284f8..8e7cc6200d60 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gf100.c
@@ -21,12 +21,12 @@
21 * 21 *
22 * Authors: Ben Skeggs 22 * Authors: Ben Skeggs
23 */ 23 */
24#include "priv.h"
24 25
26#include <core/enum.h>
25#include <subdev/fb.h> 27#include <subdev/fb.h>
26#include <subdev/timer.h> 28#include <subdev/timer.h>
27 29
28#include "priv.h"
29
30void 30void
31gf100_ltc_cbc_clear(struct nvkm_ltc_priv *priv, u32 start, u32 limit) 31gf100_ltc_cbc_clear(struct nvkm_ltc_priv *priv, u32 start, u32 limit)
32{ 32{
@@ -62,7 +62,7 @@ gf100_ltc_zbc_clear_depth(struct nvkm_ltc_priv *priv, int i, const u32 depth)
62 nv_wr32(priv, 0x17ea58, depth); 62 nv_wr32(priv, 0x17ea58, depth);
63} 63}
64 64
65static const struct nouveau_bitfield 65static const struct nvkm_bitfield
66gf100_ltc_lts_intr_name[] = { 66gf100_ltc_lts_intr_name[] = {
67 { 0x00000001, "IDLE_ERROR_IQ" }, 67 { 0x00000001, "IDLE_ERROR_IQ" },
68 { 0x00000002, "IDLE_ERROR_CBC" }, 68 { 0x00000002, "IDLE_ERROR_CBC" },
@@ -89,7 +89,7 @@ gf100_ltc_lts_intr(struct nvkm_ltc_priv *priv, int ltc, int lts)
89 89
90 if (stat) { 90 if (stat) {
91 nv_info(priv, "LTC%d_LTS%d:", ltc, lts); 91 nv_info(priv, "LTC%d_LTS%d:", ltc, lts);
92 nouveau_bitfield_print(gf100_ltc_lts_intr_name, stat); 92 nvkm_bitfield_print(gf100_ltc_lts_intr_name, stat);
93 pr_cont("\n"); 93 pr_cont("\n");
94 } 94 }
95 95
@@ -97,7 +97,7 @@ gf100_ltc_lts_intr(struct nvkm_ltc_priv *priv, int ltc, int lts)
97} 97}
98 98
99void 99void
100gf100_ltc_intr(struct nouveau_subdev *subdev) 100gf100_ltc_intr(struct nvkm_subdev *subdev)
101{ 101{
102 struct nvkm_ltc_priv *priv = (void *)subdev; 102 struct nvkm_ltc_priv *priv = (void *)subdev;
103 u32 mask; 103 u32 mask;
@@ -112,7 +112,7 @@ gf100_ltc_intr(struct nouveau_subdev *subdev)
112} 112}
113 113
114static int 114static int
115gf100_ltc_init(struct nouveau_object *object) 115gf100_ltc_init(struct nvkm_object *object)
116{ 116{
117 struct nvkm_ltc_priv *priv = (void *)object; 117 struct nvkm_ltc_priv *priv = (void *)object;
118 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 118 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
@@ -130,13 +130,13 @@ gf100_ltc_init(struct nouveau_object *object)
130} 130}
131 131
132void 132void
133gf100_ltc_dtor(struct nouveau_object *object) 133gf100_ltc_dtor(struct nvkm_object *object)
134{ 134{
135 struct nouveau_fb *pfb = nouveau_fb(object); 135 struct nvkm_fb *pfb = nvkm_fb(object);
136 struct nvkm_ltc_priv *priv = (void *)object; 136 struct nvkm_ltc_priv *priv = (void *)object;
137 137
138 nouveau_mm_fini(&priv->tags); 138 nvkm_mm_fini(&priv->tags);
139 nouveau_mm_free(&pfb->vram, &priv->tag_ram); 139 nvkm_mm_free(&pfb->vram, &priv->tag_ram);
140 140
141 nvkm_ltc_destroy(priv); 141 nvkm_ltc_destroy(priv);
142} 142}
@@ -144,7 +144,7 @@ gf100_ltc_dtor(struct nouveau_object *object)
144/* TODO: Figure out tag memory details and drop the over-cautious allocation. 144/* TODO: Figure out tag memory details and drop the over-cautious allocation.
145 */ 145 */
146int 146int
147gf100_ltc_init_tag_ram(struct nouveau_fb *pfb, struct nvkm_ltc_priv *priv) 147gf100_ltc_init_tag_ram(struct nvkm_fb *pfb, struct nvkm_ltc_priv *priv)
148{ 148{
149 u32 tag_size, tag_margin, tag_align; 149 u32 tag_size, tag_margin, tag_align;
150 int ret; 150 int ret;
@@ -170,8 +170,8 @@ gf100_ltc_init_tag_ram(struct nouveau_fb *pfb, struct nvkm_ltc_priv *priv)
170 tag_size += tag_align; 170 tag_size += tag_align;
171 tag_size = (tag_size + 0xfff) >> 12; /* round up */ 171 tag_size = (tag_size + 0xfff) >> 12; /* round up */
172 172
173 ret = nouveau_mm_tail(&pfb->vram, 1, 1, tag_size, tag_size, 1, 173 ret = nvkm_mm_tail(&pfb->vram, 1, 1, tag_size, tag_size, 1,
174 &priv->tag_ram); 174 &priv->tag_ram);
175 if (ret) { 175 if (ret) {
176 priv->num_tags = 0; 176 priv->num_tags = 0;
177 } else { 177 } else {
@@ -183,16 +183,16 @@ gf100_ltc_init_tag_ram(struct nouveau_fb *pfb, struct nvkm_ltc_priv *priv)
183 priv->tag_base = tag_base; 183 priv->tag_base = tag_base;
184 } 184 }
185 185
186 ret = nouveau_mm_init(&priv->tags, 0, priv->num_tags, 1); 186 ret = nvkm_mm_init(&priv->tags, 0, priv->num_tags, 1);
187 return ret; 187 return ret;
188} 188}
189 189
190int 190int
191gf100_ltc_ctor(struct nouveau_object *parent, struct nouveau_object *engine, 191gf100_ltc_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
192 struct nouveau_oclass *oclass, void *data, u32 size, 192 struct nvkm_oclass *oclass, void *data, u32 size,
193 struct nouveau_object **pobject) 193 struct nvkm_object **pobject)
194{ 194{
195 struct nouveau_fb *pfb = nouveau_fb(parent); 195 struct nvkm_fb *pfb = nvkm_fb(parent);
196 struct nvkm_ltc_priv *priv; 196 struct nvkm_ltc_priv *priv;
197 u32 parts, mask; 197 u32 parts, mask;
198 int ret, i; 198 int ret, i;
@@ -218,10 +218,10 @@ gf100_ltc_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
218 return 0; 218 return 0;
219} 219}
220 220
221struct nouveau_oclass * 221struct nvkm_oclass *
222gf100_ltc_oclass = &(struct nvkm_ltc_impl) { 222gf100_ltc_oclass = &(struct nvkm_ltc_impl) {
223 .base.handle = NV_SUBDEV(LTC, 0xc0), 223 .base.handle = NV_SUBDEV(LTC, 0xc0),
224 .base.ofuncs = &(struct nouveau_ofuncs) { 224 .base.ofuncs = &(struct nvkm_ofuncs) {
225 .ctor = gf100_ltc_ctor, 225 .ctor = gf100_ltc_ctor,
226 .dtor = gf100_ltc_dtor, 226 .dtor = gf100_ltc_dtor,
227 .init = gf100_ltc_init, 227 .init = gf100_ltc_init,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gk104.c
index b39b5d0eb8f9..d53959b5ec67 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gk104.c
@@ -21,11 +21,10 @@
21 * 21 *
22 * Authors: Ben Skeggs 22 * Authors: Ben Skeggs
23 */ 23 */
24
25#include "priv.h" 24#include "priv.h"
26 25
27static int 26static int
28gk104_ltc_init(struct nouveau_object *object) 27gk104_ltc_init(struct nvkm_object *object)
29{ 28{
30 struct nvkm_ltc_priv *priv = (void *)object; 29 struct nvkm_ltc_priv *priv = (void *)object;
31 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 30 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
@@ -42,10 +41,10 @@ gk104_ltc_init(struct nouveau_object *object)
42 return 0; 41 return 0;
43} 42}
44 43
45struct nouveau_oclass * 44struct nvkm_oclass *
46gk104_ltc_oclass = &(struct nvkm_ltc_impl) { 45gk104_ltc_oclass = &(struct nvkm_ltc_impl) {
47 .base.handle = NV_SUBDEV(LTC, 0xe4), 46 .base.handle = NV_SUBDEV(LTC, 0xe4),
48 .base.ofuncs = &(struct nouveau_ofuncs) { 47 .base.ofuncs = &(struct nvkm_ofuncs) {
49 .ctor = gf100_ltc_ctor, 48 .ctor = gf100_ltc_ctor,
50 .dtor = gf100_ltc_dtor, 49 .dtor = gf100_ltc_dtor,
51 .init = gk104_ltc_init, 50 .init = gk104_ltc_init,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gm107.c
index 89fc4238f50c..6b3f6f4ce107 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gm107.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gm107.c
@@ -21,12 +21,11 @@
21 * 21 *
22 * Authors: Ben Skeggs 22 * Authors: Ben Skeggs
23 */ 23 */
24#include "priv.h"
24 25
25#include <subdev/fb.h> 26#include <subdev/fb.h>
26#include <subdev/timer.h> 27#include <subdev/timer.h>
27 28
28#include "priv.h"
29
30static void 29static void
31gm107_ltc_cbc_clear(struct nvkm_ltc_priv *priv, u32 start, u32 limit) 30gm107_ltc_cbc_clear(struct nvkm_ltc_priv *priv, u32 start, u32 limit)
32{ 31{
@@ -75,7 +74,7 @@ gm107_ltc_lts_isr(struct nvkm_ltc_priv *priv, int ltc, int lts)
75} 74}
76 75
77static void 76static void
78gm107_ltc_intr(struct nouveau_subdev *subdev) 77gm107_ltc_intr(struct nvkm_subdev *subdev)
79{ 78{
80 struct nvkm_ltc_priv *priv = (void *)subdev; 79 struct nvkm_ltc_priv *priv = (void *)subdev;
81 u32 mask; 80 u32 mask;
@@ -90,7 +89,7 @@ gm107_ltc_intr(struct nouveau_subdev *subdev)
90} 89}
91 90
92static int 91static int
93gm107_ltc_init(struct nouveau_object *object) 92gm107_ltc_init(struct nvkm_object *object)
94{ 93{
95 struct nvkm_ltc_priv *priv = (void *)object; 94 struct nvkm_ltc_priv *priv = (void *)object;
96 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001); 95 u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
@@ -107,11 +106,11 @@ gm107_ltc_init(struct nouveau_object *object)
107} 106}
108 107
109static int 108static int
110gm107_ltc_ctor(struct nouveau_object *parent, struct nouveau_object *engine, 109gm107_ltc_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
111 struct nouveau_oclass *oclass, void *data, u32 size, 110 struct nvkm_oclass *oclass, void *data, u32 size,
112 struct nouveau_object **pobject) 111 struct nvkm_object **pobject)
113{ 112{
114 struct nouveau_fb *pfb = nouveau_fb(parent); 113 struct nvkm_fb *pfb = nvkm_fb(parent);
115 struct nvkm_ltc_priv *priv; 114 struct nvkm_ltc_priv *priv;
116 u32 parts, mask; 115 u32 parts, mask;
117 int ret, i; 116 int ret, i;
@@ -136,10 +135,10 @@ gm107_ltc_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
136 return 0; 135 return 0;
137} 136}
138 137
139struct nouveau_oclass * 138struct nvkm_oclass *
140gm107_ltc_oclass = &(struct nvkm_ltc_impl) { 139gm107_ltc_oclass = &(struct nvkm_ltc_impl) {
141 .base.handle = NV_SUBDEV(LTC, 0xff), 140 .base.handle = NV_SUBDEV(LTC, 0xff),
142 .base.ofuncs = &(struct nouveau_ofuncs) { 141 .base.ofuncs = &(struct nvkm_ofuncs) {
143 .ctor = gm107_ltc_ctor, 142 .ctor = gm107_ltc_ctor,
144 .dtor = gf100_ltc_dtor, 143 .dtor = gf100_ltc_dtor,
145 .init = gm107_ltc_init, 144 .init = gm107_ltc_init,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
index 41f179d93da6..09537d7b6783 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
@@ -1,23 +1,22 @@
1#ifndef __NVKM_LTC_PRIV_H__ 1#ifndef __NVKM_LTC_PRIV_H__
2#define __NVKM_LTC_PRIV_H__ 2#define __NVKM_LTC_PRIV_H__
3
4#include <subdev/ltc.h> 3#include <subdev/ltc.h>
5#include <subdev/fb.h>
6 4
7#include <core/enum.h> 5#include <core/mm.h>
6struct nvkm_fb;
8 7
9struct nvkm_ltc_priv { 8struct nvkm_ltc_priv {
10 struct nouveau_ltc base; 9 struct nvkm_ltc base;
11 u32 ltc_nr; 10 u32 ltc_nr;
12 u32 lts_nr; 11 u32 lts_nr;
13 12
14 u32 num_tags; 13 u32 num_tags;
15 u32 tag_base; 14 u32 tag_base;
16 struct nouveau_mm tags; 15 struct nvkm_mm tags;
17 struct nouveau_mm_node *tag_ram; 16 struct nvkm_mm_node *tag_ram;
18 17
19 u32 zbc_color[NOUVEAU_LTC_MAX_ZBC_CNT][4]; 18 u32 zbc_color[NVKM_LTC_MAX_ZBC_CNT][4];
20 u32 zbc_depth[NOUVEAU_LTC_MAX_ZBC_CNT]; 19 u32 zbc_depth[NVKM_LTC_MAX_ZBC_CNT];
21}; 20};
22 21
23#define nvkm_ltc_create(p,e,o,d) \ 22#define nvkm_ltc_create(p,e,o,d) \
@@ -35,24 +34,24 @@ struct nvkm_ltc_priv {
35 _nvkm_ltc_fini(nv_object(_priv), (s)); \ 34 _nvkm_ltc_fini(nv_object(_priv), (s)); \
36}) 35})
37 36
38int nvkm_ltc_create_(struct nouveau_object *, struct nouveau_object *, 37int nvkm_ltc_create_(struct nvkm_object *, struct nvkm_object *,
39 struct nouveau_oclass *, int, void **); 38 struct nvkm_oclass *, int, void **);
40 39
41#define _nvkm_ltc_dtor _nouveau_subdev_dtor 40#define _nvkm_ltc_dtor _nvkm_subdev_dtor
42int _nvkm_ltc_init(struct nouveau_object *); 41int _nvkm_ltc_init(struct nvkm_object *);
43#define _nvkm_ltc_fini _nouveau_subdev_fini 42#define _nvkm_ltc_fini _nvkm_subdev_fini
44 43
45int gf100_ltc_ctor(struct nouveau_object *, struct nouveau_object *, 44int gf100_ltc_ctor(struct nvkm_object *, struct nvkm_object *,
46 struct nouveau_oclass *, void *, u32, 45 struct nvkm_oclass *, void *, u32,
47 struct nouveau_object **); 46 struct nvkm_object **);
48void gf100_ltc_dtor(struct nouveau_object *); 47void gf100_ltc_dtor(struct nvkm_object *);
49int gf100_ltc_init_tag_ram(struct nouveau_fb *, struct nvkm_ltc_priv *); 48int gf100_ltc_init_tag_ram(struct nvkm_fb *, struct nvkm_ltc_priv *);
50int gf100_ltc_tags_alloc(struct nouveau_ltc *, u32, struct nouveau_mm_node **); 49int gf100_ltc_tags_alloc(struct nvkm_ltc *, u32, struct nvkm_mm_node **);
51void gf100_ltc_tags_free(struct nouveau_ltc *, struct nouveau_mm_node **); 50void gf100_ltc_tags_free(struct nvkm_ltc *, struct nvkm_mm_node **);
52 51
53struct nvkm_ltc_impl { 52struct nvkm_ltc_impl {
54 struct nouveau_oclass base; 53 struct nvkm_oclass base;
55 void (*intr)(struct nouveau_subdev *); 54 void (*intr)(struct nvkm_subdev *);
56 55
57 void (*cbc_clear)(struct nvkm_ltc_priv *, u32 start, u32 limit); 56 void (*cbc_clear)(struct nvkm_ltc_priv *, u32 start, u32 limit);
58 void (*cbc_wait)(struct nvkm_ltc_priv *); 57 void (*cbc_wait)(struct nvkm_ltc_priv *);
@@ -62,10 +61,9 @@ struct nvkm_ltc_impl {
62 void (*zbc_clear_depth)(struct nvkm_ltc_priv *, int, const u32); 61 void (*zbc_clear_depth)(struct nvkm_ltc_priv *, int, const u32);
63}; 62};
64 63
65void gf100_ltc_intr(struct nouveau_subdev *); 64void gf100_ltc_intr(struct nvkm_subdev *);
66void gf100_ltc_cbc_clear(struct nvkm_ltc_priv *, u32, u32); 65void gf100_ltc_cbc_clear(struct nvkm_ltc_priv *, u32, u32);
67void gf100_ltc_cbc_wait(struct nvkm_ltc_priv *); 66void gf100_ltc_cbc_wait(struct nvkm_ltc_priv *);
68void gf100_ltc_zbc_clear_color(struct nvkm_ltc_priv *, int, const u32[4]); 67void gf100_ltc_zbc_clear_color(struct nvkm_ltc_priv *, int, const u32[4]);
69void gf100_ltc_zbc_clear_depth(struct nvkm_ltc_priv *, int, const u32); 68void gf100_ltc_zbc_clear_depth(struct nvkm_ltc_priv *, int, const u32);
70
71#endif 69#endif