]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
Merge tag 'staging-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[karo-tx-linux.git] / drivers / gpu / drm / nouveau / core / subdev / fb / priv.h
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
15 #define nouveau_ram_create_(p,e,o,s,d)                                         \
16         nouveau_object_create_((p), (e), (o), 0, (s), (void **)d)
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
21 extern struct nouveau_oclass nv04_ram_oclass;
22 extern struct nouveau_oclass nv10_ram_oclass;
23 extern struct nouveau_oclass nv1a_ram_oclass;
24 extern struct nouveau_oclass nv20_ram_oclass;
25 extern struct nouveau_oclass nv40_ram_oclass;
26 extern struct nouveau_oclass nv41_ram_oclass;
27 extern struct nouveau_oclass nv44_ram_oclass;
28 extern struct nouveau_oclass nv49_ram_oclass;
29 extern struct nouveau_oclass nv4e_ram_oclass;
30 extern struct nouveau_oclass nv50_ram_oclass;
31 extern struct nouveau_oclass nva3_ram_oclass;
32 extern struct nouveau_oclass nvaa_ram_oclass;
33 extern struct nouveau_oclass nvc0_ram_oclass;
34 extern struct nouveau_oclass nve0_ram_oclass;
35
36 int nouveau_sddr3_calc(struct nouveau_ram *ram);
37 int nouveau_gddr5_calc(struct nouveau_ram *ram, bool nuts);
38
39 #define nouveau_fb_create(p,e,c,d)                                             \
40         nouveau_fb_create_((p), (e), (c), sizeof(**d), (void **)d)
41 #define nouveau_fb_destroy(p) ({                                               \
42         struct nouveau_fb *pfb = (p);                                          \
43         _nouveau_fb_dtor(nv_object(pfb));                                      \
44 })
45 #define nouveau_fb_init(p) ({                                                  \
46         struct nouveau_fb *pfb = (p);                                          \
47         _nouveau_fb_init(nv_object(pfb));                                      \
48 })
49 #define nouveau_fb_fini(p,s) ({                                                \
50         struct nouveau_fb *pfb = (p);                                          \
51         _nouveau_fb_fini(nv_object(pfb), (s));                                 \
52 })
53
54 int nouveau_fb_create_(struct nouveau_object *, struct nouveau_object *,
55                        struct nouveau_oclass *, int, void **);
56 void _nouveau_fb_dtor(struct nouveau_object *);
57 int  _nouveau_fb_init(struct nouveau_object *);
58 int  _nouveau_fb_fini(struct nouveau_object *, bool);
59
60 struct nouveau_fb_impl {
61         struct nouveau_oclass base;
62         struct nouveau_oclass *ram;
63         bool (*memtype)(struct nouveau_fb *, u32);
64 };
65
66 bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
67 bool nv50_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
68
69 struct nouveau_bios;
70 int  nouveau_fb_bios_memtype(struct nouveau_bios *);
71
72 #endif