Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6082 | Rev 6936 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | 32 | ||
Line 33... | Line 33... | ||
33 | struct drm_fb_helper; |
33 | struct drm_fb_helper; |
Line -... | Line 34... | ||
- | 34 | ||
- | 35 | #include |
|
- | 36 | ||
- | 37 | enum mode_set_atomic { |
|
- | 38 | LEAVE_ATOMIC_MODE_SET, |
|
34 | 39 | ENTER_ATOMIC_MODE_SET, |
|
35 | #include |
40 | }; |
36 | 41 | ||
Line 37... | Line 42... | ||
37 | struct drm_fb_offset { |
42 | struct drm_fb_offset { |
Line 72... | Line 77... | ||
72 | u32 surface_depth; |
77 | u32 surface_depth; |
73 | }; |
78 | }; |
Line 74... | Line 79... | ||
74 | 79 | ||
75 | /** |
80 | /** |
76 | * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library |
- | |
77 | * @gamma_set: Set the given gamma lut register on the given crtc. |
- | |
78 | * @gamma_get: Read the given gamma lut register on the given crtc, used to |
- | |
79 | * save the current lut when force-restoring the fbdev for e.g. |
- | |
80 | * kdbg. |
- | |
81 | * @fb_probe: Driver callback to allocate and initialize the fbdev info |
- | |
82 | * structure. Furthermore it also needs to allocate the drm |
- | |
83 | * framebuffer used to back the fbdev. |
- | |
84 | * @initial_config: Setup an initial fbdev display configuration |
81 | * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library |
85 | * |
82 | * |
86 | * Driver callbacks used by the fbdev emulation helper library. |
83 | * Driver callbacks used by the fbdev emulation helper library. |
87 | */ |
84 | */ |
- | 85 | struct drm_fb_helper_funcs { |
|
- | 86 | /** |
|
- | 87 | * @gamma_set: |
|
- | 88 | * |
|
- | 89 | * Set the given gamma LUT register on the given CRTC. |
|
- | 90 | * |
|
- | 91 | * This callback is optional. |
|
- | 92 | * |
|
- | 93 | * FIXME: |
|
- | 94 | * |
|
- | 95 | * This callback is functionally redundant with the core gamma table |
|
- | 96 | * support and simply exists because the fbdev hasn't yet been |
|
- | 97 | * refactored to use the core gamma table interfaces. |
|
88 | struct drm_fb_helper_funcs { |
98 | */ |
89 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, |
99 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, |
- | 100 | u16 blue, int regno); |
|
- | 101 | /** |
|
- | 102 | * @gamma_get: |
|
- | 103 | * |
|
- | 104 | * Read the given gamma LUT register on the given CRTC, used to save the |
|
- | 105 | * current LUT when force-restoring the fbdev for e.g. kdbg. |
|
- | 106 | * |
|
- | 107 | * This callback is optional. |
|
- | 108 | * |
|
- | 109 | * FIXME: |
|
- | 110 | * |
|
- | 111 | * This callback is functionally redundant with the core gamma table |
|
- | 112 | * support and simply exists because the fbdev hasn't yet been |
|
- | 113 | * refactored to use the core gamma table interfaces. |
|
90 | u16 blue, int regno); |
114 | */ |
91 | void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green, |
115 | void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green, |
Line -... | Line 116... | ||
- | 116 | u16 *blue, int regno); |
|
- | 117 | ||
- | 118 | /** |
|
- | 119 | * @fb_probe: |
|
- | 120 | * |
|
- | 121 | * Driver callback to allocate and initialize the fbdev info structure. |
|
- | 122 | * Furthermore it also needs to allocate the DRM framebuffer used to |
|
- | 123 | * back the fbdev. |
|
- | 124 | * |
|
- | 125 | * This callback is mandatory. |
|
- | 126 | * |
|
- | 127 | * RETURNS: |
|
- | 128 | * |
|
- | 129 | * The driver should return 0 on success and a negative error code on |
|
92 | u16 *blue, int regno); |
130 | * failure. |
93 | 131 | */ |
|
- | 132 | int (*fb_probe)(struct drm_fb_helper *helper, |
|
- | 133 | struct drm_fb_helper_surface_size *sizes); |
|
- | 134 | ||
- | 135 | /** |
|
- | 136 | * @initial_config: |
|
- | 137 | * |
|
- | 138 | * Driver callback to setup an initial fbdev display configuration. |
|
- | 139 | * Drivers can use this callback to tell the fbdev emulation what the |
|
- | 140 | * preferred initial configuration is. This is useful to implement |
|
- | 141 | * smooth booting where the fbdev (and subsequently all userspace) never |
|
- | 142 | * changes the mode, but always inherits the existing configuration. |
|
- | 143 | * |
|
- | 144 | * This callback is optional. |
|
- | 145 | * |
|
- | 146 | * RETURNS: |
|
- | 147 | * |
|
- | 148 | * The driver should return true if a suitable initial configuration has |
|
- | 149 | * been filled out and false when the fbdev helper should fall back to |
|
94 | int (*fb_probe)(struct drm_fb_helper *helper, |
150 | * the default probing logic. |
95 | struct drm_fb_helper_surface_size *sizes); |
151 | */ |
96 | bool (*initial_config)(struct drm_fb_helper *fb_helper, |
152 | bool (*initial_config)(struct drm_fb_helper *fb_helper, |
97 | struct drm_fb_helper_crtc **crtcs, |
153 | struct drm_fb_helper_crtc **crtcs, |
98 | struct drm_display_mode **modes, |
154 | struct drm_display_mode **modes, |
Line 103... | Line 159... | ||
103 | struct drm_fb_helper_connector { |
159 | struct drm_fb_helper_connector { |
104 | struct drm_connector *connector; |
160 | struct drm_connector *connector; |
105 | }; |
161 | }; |
Line 106... | Line 162... | ||
106 | 162 | ||
107 | /** |
163 | /** |
108 | * struct drm_fb_helper - helper to emulate fbdev on top of kms |
164 | * struct drm_fb_helper - main structure to emulate fbdev on top of KMS |
109 | * @fb: Scanout framebuffer object |
165 | * @fb: Scanout framebuffer object |
110 | * @dev: DRM device |
166 | * @dev: DRM device |
111 | * @crtc_count: number of possible CRTCs |
167 | * @crtc_count: number of possible CRTCs |
112 | * @crtc_info: per-CRTC helper state (mode, x/y offset, etc) |
168 | * @crtc_info: per-CRTC helper state (mode, x/y offset, etc) |
113 | * @connector_count: number of connected connectors |
169 | * @connector_count: number of connected connectors |
- | 170 | * @connector_info_alloc_count: size of connector_info |
|
114 | * @connector_info_alloc_count: size of connector_info |
171 | * @connector_info: array of per-connector information |
115 | * @funcs: driver callbacks for fb helper |
172 | * @funcs: driver callbacks for fb helper |
116 | * @fbdev: emulated fbdev device info struct |
173 | * @fbdev: emulated fbdev device info struct |
- | 174 | * @pseudo_palette: fake palette of 16 colors |
|
117 | * @pseudo_palette: fake palette of 16 colors |
175 | * |
118 | * @kernel_fb_list: list_head in kernel_fb_helper_list |
176 | * This is the main structure used by the fbdev helpers. Drivers supporting |
- | 177 | * fbdev emulation should embedded this into their overall driver structure. |
|
- | 178 | * Drivers must also fill out a struct &drm_fb_helper_funcs with a few |
|
119 | * @delayed_hotplug: was there a hotplug while kms master active? |
179 | * operations. |
120 | */ |
180 | */ |
121 | struct drm_fb_helper { |
181 | struct drm_fb_helper { |
122 | struct drm_framebuffer *fb; |
182 | struct drm_framebuffer *fb; |
123 | struct drm_device *dev; |
183 | struct drm_device *dev; |
Line 127... | Line 187... | ||
127 | int connector_info_alloc_count; |
187 | int connector_info_alloc_count; |
128 | struct drm_fb_helper_connector **connector_info; |
188 | struct drm_fb_helper_connector **connector_info; |
129 | const struct drm_fb_helper_funcs *funcs; |
189 | const struct drm_fb_helper_funcs *funcs; |
130 | struct fb_info *fbdev; |
190 | struct fb_info *fbdev; |
131 | u32 pseudo_palette[17]; |
191 | u32 pseudo_palette[17]; |
- | 192 | ||
- | 193 | /** |
|
- | 194 | * @kernel_fb_list: |
|
- | 195 | * |
|
- | 196 | * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit. |
|
- | 197 | */ |
|
132 | struct list_head kernel_fb_list; |
198 | struct list_head kernel_fb_list; |
Line -... | Line 199... | ||
- | 199 | ||
- | 200 | /** |
|
- | 201 | * @delayed_hotplug: |
|
133 | 202 | * |
|
- | 203 | * A hotplug was received while fbdev wasn't in control of the DRM |
|
134 | /* we got a hotplug but fbdev wasn't running the console |
204 | * device, i.e. another KMS master was active. The output configuration |
- | 205 | * needs to be reprobe when fbdev is in control again. |
|
135 | delay until next set_par */ |
206 | */ |
Line 136... | Line 207... | ||
136 | bool delayed_hotplug; |
207 | bool delayed_hotplug; |
137 | 208 | ||
138 | /** |
209 | /** |