Merge tag 'v3.16-rc1' into i2c/for-next
[linux-2.6-block.git] / drivers / gpu / drm / nouveau / core / subdev / fb / priv.h
CommitLineData
dceef5d8
BS
1#ifndef __NVKM_FB_PRIV_H__
2#define __NVKM_FB_PRIV_H__
3
4#include <subdev/fb.h>
5
6#define nouveau_ram_create(p,e,o,d) \
7 nouveau_object_create_((p), (e), (o), 0, sizeof(**d), (void **)d)
8#define nouveau_ram_destroy(p) \
9 nouveau_object_destroy(&(p)->base)
10#define nouveau_ram_init(p) \
11 nouveau_object_init(&(p)->base)
12#define nouveau_ram_fini(p,s) \
13 nouveau_object_fini(&(p)->base, (s))
14
75faef78
BS
15#define nouveau_ram_create_(p,e,o,s,d) \
16 nouveau_object_create_((p), (e), (o), 0, (s), (void **)d)
dceef5d8
BS
17#define _nouveau_ram_dtor nouveau_object_destroy
18#define _nouveau_ram_init nouveau_object_init
19#define _nouveau_ram_fini nouveau_object_fini
20
21extern struct nouveau_oclass nv04_ram_oclass;
22extern struct nouveau_oclass nv10_ram_oclass;
23extern struct nouveau_oclass nv1a_ram_oclass;
24extern struct nouveau_oclass nv20_ram_oclass;
25extern struct nouveau_oclass nv40_ram_oclass;
26extern struct nouveau_oclass nv41_ram_oclass;
27extern struct nouveau_oclass nv44_ram_oclass;
28extern struct nouveau_oclass nv49_ram_oclass;
29extern struct nouveau_oclass nv4e_ram_oclass;
30extern struct nouveau_oclass nv50_ram_oclass;
8613e731
BS
31extern struct nouveau_oclass nva3_ram_oclass;
32extern struct nouveau_oclass nvaa_ram_oclass;
dceef5d8 33extern struct nouveau_oclass nvc0_ram_oclass;
aae95ca7 34extern struct nouveau_oclass nve0_ram_oclass;
fef94f62 35extern struct nouveau_oclass gk20a_ram_oclass;
267dcb66 36extern struct nouveau_oclass gm107_ram_oclass;
aae95ca7
BS
37
38int nouveau_sddr3_calc(struct nouveau_ram *ram);
d394fb12 39int nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts);
dceef5d8 40
8613e731
BS
41#define nouveau_fb_create(p,e,c,d) \
42 nouveau_fb_create_((p), (e), (c), sizeof(**d), (void **)d)
dceef5d8
BS
43#define nouveau_fb_destroy(p) ({ \
44 struct nouveau_fb *pfb = (p); \
45 _nouveau_fb_dtor(nv_object(pfb)); \
46})
47#define nouveau_fb_init(p) ({ \
48 struct nouveau_fb *pfb = (p); \
49 _nouveau_fb_init(nv_object(pfb)); \
50})
51#define nouveau_fb_fini(p,s) ({ \
52 struct nouveau_fb *pfb = (p); \
53 _nouveau_fb_fini(nv_object(pfb), (s)); \
54})
55
56int nouveau_fb_create_(struct nouveau_object *, struct nouveau_object *,
8613e731 57 struct nouveau_oclass *, int, void **);
dceef5d8
BS
58void _nouveau_fb_dtor(struct nouveau_object *);
59int _nouveau_fb_init(struct nouveau_object *);
60int _nouveau_fb_fini(struct nouveau_object *, bool);
61
8613e731
BS
62struct nouveau_fb_impl {
63 struct nouveau_oclass base;
64 struct nouveau_oclass *ram;
20cdeaf9 65 bool (*memtype)(struct nouveau_fb *, u32);
8613e731
BS
66};
67
dceef5d8 68bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
20cdeaf9 69bool nv50_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
dceef5d8 70
20cdeaf9
BS
71struct nouveau_bios;
72int nouveau_fb_bios_memtype(struct nouveau_bios *);
dceef5d8
BS
73
74#endif