Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
gpu
drm
nouveau
core
include
subdev
fb.h
Go to the documentation of this file.
1
#ifndef __NOUVEAU_FB_H__
2
#define __NOUVEAU_FB_H__
3
4
#include <
core/subdev.h
>
5
#include <
core/device.h
>
6
#include <
core/mm.h
>
7
8
#include <
subdev/vm.h
>
9
10
/* memory type/access flags, do not match hardware values */
11
#define NV_MEM_ACCESS_RO 1
12
#define NV_MEM_ACCESS_WO 2
13
#define NV_MEM_ACCESS_RW (NV_MEM_ACCESS_RO | NV_MEM_ACCESS_WO)
14
#define NV_MEM_ACCESS_SYS 4
15
#define NV_MEM_ACCESS_VM 8
16
#define NV_MEM_ACCESS_NOSNOOP 16
17
18
#define NV_MEM_TARGET_VRAM 0
19
#define NV_MEM_TARGET_PCI 1
20
#define NV_MEM_TARGET_PCI_NOSNOOP 2
21
#define NV_MEM_TARGET_VM 3
22
#define NV_MEM_TARGET_GART 4
23
24
#define NV_MEM_TYPE_VM 0x7f
25
#define NV_MEM_COMP_VM 0x03
26
27
struct
nouveau_mem
{
28
struct
drm_device
*
dev
;
29
30
struct
nouveau_vma
bar_vma
;
31
struct
nouveau_vma
vma
[2];
32
u8
page_shift
;
33
34
struct
nouveau_mm_node
*
tag
;
35
struct
list_head
regions
;
36
dma_addr_t
*
pages
;
37
u32
memtype
;
38
u64
offset
;
39
u64
size
;
40
struct
sg_table
*
sg
;
41
};
42
43
struct
nouveau_fb_tile
{
44
struct
nouveau_mm_node
*
tag
;
45
u32
addr
;
46
u32
limit
;
47
u32
pitch
;
48
u32
zcomp
;
49
};
50
51
struct
nouveau_fb
{
52
struct
nouveau_subdev
base
;
53
54
bool
(*
memtype_valid
)(
struct
nouveau_fb
*,
u32
memtype
);
55
56
struct
{
57
enum
{
58
NV_MEM_TYPE_UNKNOWN
= 0,
59
NV_MEM_TYPE_STOLEN
,
60
NV_MEM_TYPE_SGRAM
,
61
NV_MEM_TYPE_SDRAM
,
62
NV_MEM_TYPE_DDR1
,
63
NV_MEM_TYPE_DDR2
,
64
NV_MEM_TYPE_DDR3
,
65
NV_MEM_TYPE_GDDR2
,
66
NV_MEM_TYPE_GDDR3
,
67
NV_MEM_TYPE_GDDR4
,
68
NV_MEM_TYPE_GDDR5
69
}
type
;
70
u64
stolen
;
71
u64
size
;
72
int
ranks
;
73
74
int
(*
get
)(
struct
nouveau_fb
*,
u64
size
,
u32
align
,
75
u32
size_nc,
u32
type
,
struct
nouveau_mem
**);
76
void
(*
put
)(
struct
nouveau_fb
*,
struct
nouveau_mem
**);
77
}
ram
;
78
79
struct
nouveau_mm
vram
;
80
struct
nouveau_mm
tags
;
81
82
struct
{
83
struct
nouveau_fb_tile
region
[16];
84
int
regions
;
85
void
(*
init
)(
struct
nouveau_fb
*,
int
i
,
u32
addr
,
u32
size
,
86
u32
pitch,
u32
flags
,
struct
nouveau_fb_tile
*);
87
void
(*
fini
)(
struct
nouveau_fb
*,
int
i
,
88
struct
nouveau_fb_tile
*);
89
void
(*
prog
)(
struct
nouveau_fb
*,
int
i
,
90
struct
nouveau_fb_tile
*);
91
}
tile
;
92
};
93
94
static
inline
struct
nouveau_fb
*
95
nouveau_fb
(
void
*obj)
96
{
97
return
(
void
*)nv_device(obj)->subdev[
NVDEV_SUBDEV_FB
];
98
}
99
100
#define nouveau_fb_create(p,e,c,d) \
101
nouveau_subdev_create((p), (e), (c), 0, "PFB", "fb", (d))
102
int
nouveau_fb_created
(
struct
nouveau_fb
*);
103
void
nouveau_fb_destroy
(
struct
nouveau_fb
*);
104
int
nouveau_fb_init
(
struct
nouveau_fb
*);
105
#define nouveau_fb_fini(p,s) \
106
nouveau_subdev_fini(&(p)->base, (s))
107
108
void
_nouveau_fb_dtor
(
struct
nouveau_object
*);
109
int
_nouveau_fb_init
(
struct
nouveau_object
*);
110
#define _nouveau_fb_fini _nouveau_subdev_fini
111
112
extern
struct
nouveau_oclass
nv04_fb_oclass
;
113
extern
struct
nouveau_oclass
nv10_fb_oclass
;
114
extern
struct
nouveau_oclass
nv20_fb_oclass
;
115
extern
struct
nouveau_oclass
nv30_fb_oclass
;
116
extern
struct
nouveau_oclass
nv40_fb_oclass
;
117
extern
struct
nouveau_oclass
nv50_fb_oclass
;
118
extern
struct
nouveau_oclass
nvc0_fb_oclass
;
119
120
struct
nouveau_bios
;
121
int
nouveau_fb_bios_memtype
(
struct
nouveau_bios
*);
122
123
bool
nv04_fb_memtype_valid
(
struct
nouveau_fb
*,
u32
memtype
);
124
125
void
nv10_fb_tile_prog
(
struct
nouveau_fb
*,
int
,
struct
nouveau_fb_tile
*);
126
127
void
nv30_fb_tile_init
(
struct
nouveau_fb
*,
int
i
,
u32
addr
,
u32
size
,
128
u32
pitch,
u32
flags
,
struct
nouveau_fb_tile
*);
129
void
nv30_fb_tile_fini
(
struct
nouveau_fb
*,
int
i
,
struct
nouveau_fb_tile
*);
130
131
void
nv50_fb_vram_del
(
struct
nouveau_fb
*,
struct
nouveau_mem
**);
132
void
nv50_fb_trap
(
struct
nouveau_fb
*,
int
display
);
133
134
#endif
Generated on Thu Jan 10 2013 12:49:34 for Linux Kernel by
1.8.2