]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
drm/nv50-nvaf/fb: split the class definitions up a bit
[mirror_ubuntu-bionic-kernel.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
15#define _nouveau_ram_dtor nouveau_object_destroy
16#define _nouveau_ram_init nouveau_object_init
17#define _nouveau_ram_fini nouveau_object_fini
18
19extern struct nouveau_oclass nv04_ram_oclass;
20extern struct nouveau_oclass nv10_ram_oclass;
21extern struct nouveau_oclass nv1a_ram_oclass;
22extern struct nouveau_oclass nv20_ram_oclass;
23extern struct nouveau_oclass nv40_ram_oclass;
24extern struct nouveau_oclass nv41_ram_oclass;
25extern struct nouveau_oclass nv44_ram_oclass;
26extern struct nouveau_oclass nv49_ram_oclass;
27extern struct nouveau_oclass nv4e_ram_oclass;
28extern struct nouveau_oclass nv50_ram_oclass;
29extern struct nouveau_oclass nvc0_ram_oclass;
30
31#define nouveau_fb_create(p,e,c,r,d) \
32 nouveau_fb_create_((p), (e), (c), (r), sizeof(**d), (void **)d)
33#define nouveau_fb_destroy(p) ({ \
34 struct nouveau_fb *pfb = (p); \
35 _nouveau_fb_dtor(nv_object(pfb)); \
36})
37#define nouveau_fb_init(p) ({ \
38 struct nouveau_fb *pfb = (p); \
39 _nouveau_fb_init(nv_object(pfb)); \
40})
41#define nouveau_fb_fini(p,s) ({ \
42 struct nouveau_fb *pfb = (p); \
43 _nouveau_fb_fini(nv_object(pfb), (s)); \
44})
45
46int nouveau_fb_create_(struct nouveau_object *, struct nouveau_object *,
47 struct nouveau_oclass *, struct nouveau_oclass *,
48 int length, void **pobject);
49void _nouveau_fb_dtor(struct nouveau_object *);
50int _nouveau_fb_init(struct nouveau_object *);
51int _nouveau_fb_fini(struct nouveau_object *, bool);
52
53struct nouveau_bios;
54int nouveau_fb_bios_memtype(struct nouveau_bios *);
55
56bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
57
58void nv10_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
59 u32 pitch, u32 flags, struct nouveau_fb_tile *);
60void nv10_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
61void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
62
63void nv20_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
64 u32 pitch, u32 flags, struct nouveau_fb_tile *);
65void nv20_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
66void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
67
68int nv30_fb_init(struct nouveau_object *);
69void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
70 u32 pitch, u32 flags, struct nouveau_fb_tile *);
71
72void nv40_fb_tile_comp(struct nouveau_fb *, int i, u32 size, u32 flags,
73 struct nouveau_fb_tile *);
74
75int nv41_fb_init(struct nouveau_object *);
76void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
77
78int nv44_fb_init(struct nouveau_object *);
79void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
80
81void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
82 u32 pitch, u32 flags, struct nouveau_fb_tile *);
83
dedaa8f0 84void __nv50_ram_put(struct nouveau_fb *, struct nouveau_mem *);
dceef5d8
BS
85extern int nv50_fb_memtype[0x80];
86
87#endif