diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_compat.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_compat.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_compat.c b/drivers/gpu/drm/nouveau/nouveau_compat.c index 30431c820bb..3fc7d5785c6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_compat.c +++ b/drivers/gpu/drm/nouveau/nouveau_compat.c | |||
@@ -2,6 +2,8 @@ | |||
2 | #include "nouveau_compat.h" | 2 | #include "nouveau_compat.h" |
3 | 3 | ||
4 | #include <subdev/bios.h> | 4 | #include <subdev/bios.h> |
5 | #include <subdev/bios/dcb.h> | ||
6 | #include <subdev/bios/init.h> | ||
5 | #include <subdev/bios/pll.h> | 7 | #include <subdev/bios/pll.h> |
6 | #include <subdev/gpio.h> | 8 | #include <subdev/gpio.h> |
7 | #include <subdev/i2c.h> | 9 | #include <subdev/i2c.h> |
@@ -9,6 +11,18 @@ | |||
9 | 11 | ||
10 | void *nouveau_newpriv(struct drm_device *); | 12 | void *nouveau_newpriv(struct drm_device *); |
11 | 13 | ||
14 | int | ||
15 | nvdrm_gart_init(struct drm_device *dev, u64 *base, u64 *size) | ||
16 | { | ||
17 | struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
18 | if (drm->agp.stat == ENABLED) { | ||
19 | *base = drm->agp.base; | ||
20 | *size = drm->agp.base; | ||
21 | return 0; | ||
22 | } | ||
23 | return -ENODEV; | ||
24 | } | ||
25 | |||
12 | u8 | 26 | u8 |
13 | _nv_rd08(struct drm_device *dev, u32 reg) | 27 | _nv_rd08(struct drm_device *dev, u32 reg) |
14 | { | 28 | { |
@@ -255,3 +269,27 @@ nva3_calc_pll(struct drm_device *dev, struct nvbios_pll *info, u32 freq, | |||
255 | 269 | ||
256 | return nva3_pll_calc(clk, info, freq, N, fN, M, P); | 270 | return nva3_pll_calc(clk, info, freq, N, fN, M, P); |
257 | } | 271 | } |
272 | |||
273 | void | ||
274 | nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table, | ||
275 | struct dcb_output *dcbent, int crtc) | ||
276 | { | ||
277 | struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
278 | struct nouveau_bios *bios = nouveau_bios(drm->device); | ||
279 | struct nvbios_init init = { | ||
280 | .subdev = nv_subdev(bios), | ||
281 | .bios = bios, | ||
282 | .offset = table, | ||
283 | .outp = dcbent, | ||
284 | .crtc = crtc, | ||
285 | .execute = 1 | ||
286 | }; | ||
287 | |||
288 | nvbios_exec(&init); | ||
289 | } | ||
290 | |||
291 | void | ||
292 | nouveau_bios_init_exec(struct drm_device *dev, uint16_t table) | ||
293 | { | ||
294 | nouveau_bios_run_init_table(dev, table, NULL, 0); | ||
295 | } | ||