priv.h 2.9 KB
Newer Older
1 2 3
#ifndef __NVKM_FB_PRIV_H__
#define __NVKM_FB_PRIV_H__
#include <subdev/fb.h>
4
struct nvkm_bios;
5

6 7 8 9 10 11 12 13
#define nvkm_ram_create(p,e,o,d)                                            \
	nvkm_object_create_((p), (e), (o), 0, sizeof(**d), (void **)d)
#define nvkm_ram_destroy(p)                                                 \
	nvkm_object_destroy(&(p)->base)
#define nvkm_ram_init(p)                                                    \
	nvkm_object_init(&(p)->base)
#define nvkm_ram_fini(p,s)                                                  \
	nvkm_object_fini(&(p)->base, (s))
14

15 16 17 18 19
#define nvkm_ram_create_(p,e,o,s,d)                                         \
	nvkm_object_create_((p), (e), (o), 0, (s), (void **)d)
#define _nvkm_ram_dtor nvkm_object_destroy
#define _nvkm_ram_init nvkm_object_init
#define _nvkm_ram_fini nvkm_object_fini
20

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
extern struct nvkm_oclass nv04_ram_oclass;
extern struct nvkm_oclass nv10_ram_oclass;
extern struct nvkm_oclass nv1a_ram_oclass;
extern struct nvkm_oclass nv20_ram_oclass;
extern struct nvkm_oclass nv40_ram_oclass;
extern struct nvkm_oclass nv41_ram_oclass;
extern struct nvkm_oclass nv44_ram_oclass;
extern struct nvkm_oclass nv49_ram_oclass;
extern struct nvkm_oclass nv4e_ram_oclass;
extern struct nvkm_oclass nv50_ram_oclass;
extern struct nvkm_oclass gt215_ram_oclass;
extern struct nvkm_oclass mcp77_ram_oclass;
extern struct nvkm_oclass gf100_ram_oclass;
extern struct nvkm_oclass gk104_ram_oclass;
extern struct nvkm_oclass gm107_ram_oclass;
36

37 38 39 40
int nvkm_sddr2_calc(struct nvkm_ram *ram);
int nvkm_sddr3_calc(struct nvkm_ram *ram);
int nvkm_gddr3_calc(struct nvkm_ram *ram);
int nvkm_gddr5_calc(struct nvkm_ram *ram, bool nuts);
41

42 43 44
#define nvkm_fb_create(p,e,c,d)                                             \
	nvkm_fb_create_((p), (e), (c), sizeof(**d), (void **)d)
#define nvkm_fb_destroy(p) ({                                               \
B
Ben Skeggs 已提交
45 46
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_dtor(nv_object(_fb));                                      \
47
})
48
#define nvkm_fb_init(p) ({                                                  \
B
Ben Skeggs 已提交
49 50
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_init(nv_object(_fb));                                      \
51
})
52
#define nvkm_fb_fini(p,s) ({                                                \
B
Ben Skeggs 已提交
53 54
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_fini(nv_object(_fb), (s));                                 \
55 56
})

57 58 59 60 61
int nvkm_fb_create_(struct nvkm_object *, struct nvkm_object *,
		       struct nvkm_oclass *, int, void **);
void _nvkm_fb_dtor(struct nvkm_object *);
int  _nvkm_fb_init(struct nvkm_object *);
int  _nvkm_fb_fini(struct nvkm_object *, bool);
62

63 64 65 66
struct nvkm_fb_impl {
	struct nvkm_oclass base;
	struct nvkm_oclass *ram;
	bool (*memtype)(struct nvkm_fb *, u32);
67 68
};

69 70
bool nv04_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
bool nv50_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
71

72
int  nvkm_fb_bios_memtype(struct nvkm_bios *);
73
#endif