aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_compat.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_compat.c38
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
10void *nouveau_newpriv(struct drm_device *); 12void *nouveau_newpriv(struct drm_device *);
11 13
14int
15nvdrm_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
12u8 26u8
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
273void
274nouveau_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
291void
292nouveau_bios_init_exec(struct drm_device *dev, uint16_t table)
293{
294 nouveau_bios_run_init_table(dev, table, NULL, 0);
295}