priv.h 1.4 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
#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 已提交
9 10
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_dtor(nv_object(_fb));                                      \
11
})
12
#define nvkm_fb_init(p) ({                                                  \
B
Ben Skeggs 已提交
13 14
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_init(nv_object(_fb));                                      \
15
})
16
#define nvkm_fb_fini(p,s) ({                                                \
B
Ben Skeggs 已提交
17 18
	struct nvkm_fb *_fb = (p);                                          \
	_nvkm_fb_fini(nv_object(_fb), (s));                                 \
19 20
})

21 22 23 24 25
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);
26

27 28
struct nvkm_fb_impl {
	struct nvkm_oclass base;
29
	int (*ram_new)(struct nvkm_fb *, struct nvkm_ram **);
30
	bool (*memtype)(struct nvkm_fb *, u32);
31 32
};

33 34
bool nv04_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
bool nv50_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
35

36
int  nvkm_fb_bios_memtype(struct nvkm_bios *);
37
#endif