Rev 3746 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3746 | Rev 4104 | ||
---|---|---|---|
Line 92... | Line 92... | ||
92 | }; |
92 | }; |
Line 93... | Line 93... | ||
93 | 93 | ||
94 | static int intelfb_create(struct drm_fb_helper *helper, |
94 | static int intelfb_create(struct drm_fb_helper *helper, |
95 | struct drm_fb_helper_surface_size *sizes) |
95 | struct drm_fb_helper_surface_size *sizes) |
- | 96 | { |
|
96 | { |
97 | struct intel_fbdev *ifbdev = |
97 | struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper; |
98 | container_of(helper, struct intel_fbdev, helper); |
98 | struct drm_device *dev = ifbdev->helper.dev; |
99 | struct drm_device *dev = helper->dev; |
99 | struct drm_i915_private *dev_priv = dev->dev_private; |
100 | struct drm_i915_private *dev_priv = dev->dev_private; |
100 | struct fb_info *info; |
101 | struct fb_info *info; |
101 | struct drm_framebuffer *fb; |
102 | struct drm_framebuffer *fb; |
102 | struct drm_mode_fb_cmd2 mode_cmd = {}; |
103 | struct drm_mode_fb_cmd2 mode_cmd = {}; |
Line 146... | Line 147... | ||
146 | 147 | ||
147 | lfb_vm_node.size = LFB_SIZE; |
148 | lfb_vm_node.size = LFB_SIZE; |
148 | lfb_vm_node.start = 0; |
149 | lfb_vm_node.start = 0; |
Line 149... | Line -... | ||
149 | lfb_vm_node.mm = NULL; |
- | |
150 | - | ||
151 | obj->gtt_space = &lfb_vm_node; |
150 | lfb_vm_node.mm = NULL; |
152 | obj->gtt_offset = 0; |
151 | |
153 | obj->pin_count = 2; |
152 | obj->pin_count = 2; |
154 | obj->cache_level = I915_CACHE_NONE; |
153 | obj->cache_level = I915_CACHE_NONE; |
Line 162... | Line 161... | ||
162 | if (!info) { |
161 | if (!info) { |
163 | ret = -ENOMEM; |
162 | ret = -ENOMEM; |
164 | goto out_unpin; |
163 | goto out_unpin; |
165 | } |
164 | } |
Line 166... | Line 165... | ||
166 | 165 | ||
Line 167... | Line 166... | ||
167 | info->par = ifbdev; |
166 | info->par = helper; |
168 | 167 | ||
169 | ret = intel_framebuffer_init(dev, &ifbdev->ifb, &mode_cmd, obj); |
168 | ret = intel_framebuffer_init(dev, &ifbdev->ifb, &mode_cmd, obj); |
Line 187... | Line 186... | ||
187 | goto out_unpin; |
186 | goto out_unpin; |
188 | } |
187 | } |
189 | info->apertures->ranges[0].base = dev->mode_config.fb_base; |
188 | info->apertures->ranges[0].base = dev->mode_config.fb_base; |
190 | info->apertures->ranges[0].size = dev_priv->gtt.mappable_end; |
189 | info->apertures->ranges[0].size = dev_priv->gtt.mappable_end; |
Line 191... | Line 190... | ||
191 | 190 | ||
192 | info->fix.smem_start = dev->mode_config.fb_base + obj->gtt_offset; |
191 | info->fix.smem_start = dev->mode_config.fb_base + i915_gem_obj_ggtt_offset(obj); |
Line 193... | Line 192... | ||
193 | info->fix.smem_len = size; |
192 | info->fix.smem_len = size; |
194 | 193 | ||
Line 195... | Line -... | ||
195 | info->screen_base = (void*) 0xFE000000; |
- | |
Line 196... | Line 194... | ||
196 | info->screen_size = size; |
194 | info->screen_base = (void*) 0xFE000000; |
197 | 195 | info->screen_size = size; |
|
Line 198... | Line 196... | ||
198 | // memset(info->screen_base, 0, size); |
196 | |
Line 199... | Line 197... | ||
199 | 197 | ||
200 | drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); |
198 | drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); |
201 | drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); |
199 | drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); |
Line 202... | Line 200... | ||
202 | 200 | ||
Line 203... | Line 201... | ||
203 | /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ |
201 | /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ |
Line 230... | Line 228... | ||
230 | 228 | ||
231 | 229 | ||
232 | int intel_fbdev_init(struct drm_device *dev) |
230 | int intel_fbdev_init(struct drm_device *dev) |
233 | { |
231 | { |
234 | struct intel_fbdev *ifbdev; |
232 | struct intel_fbdev *ifbdev; |
Line 235... | Line 233... | ||
235 | drm_i915_private_t *dev_priv = dev->dev_private; |
233 | struct drm_i915_private *dev_priv = dev->dev_private; |
236 | int ret; |
234 | int ret; |
237 | 235 | ||
Line 255... | Line 253... | ||
255 | return 0; |
253 | return 0; |
256 | } |
254 | } |
Line 257... | Line 255... | ||
257 | 255 | ||
258 | void intel_fbdev_initial_config(struct drm_device *dev) |
256 | void intel_fbdev_initial_config(struct drm_device *dev) |
259 | { |
257 | { |
Line 260... | Line 258... | ||
260 | drm_i915_private_t *dev_priv = dev->dev_private; |
258 | struct drm_i915_private *dev_priv = dev->dev_private; |
261 | 259 | ||
262 | /* Due to peculiar init order wrt to hpd handling this is separate. */ |
260 | /* Due to peculiar init order wrt to hpd handling this is separate. */ |
Line 263... | Line 261... | ||
263 | drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32); |
261 | drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32); |
264 | } |
262 | } |
265 | 263 | ||
266 | void intel_fb_output_poll_changed(struct drm_device *dev) |
264 | void intel_fb_output_poll_changed(struct drm_device *dev) |
267 | { |
265 | { |