Rev 6283 | Rev 6937 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6283 | Rev 6296 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | #include |
42 | #include |
43 | #include "intel_drv.h" |
43 | #include "intel_drv.h" |
44 | #include |
44 | #include |
45 | #include "i915_drv.h" |
45 | #include "i915_drv.h" |
Line 46... | Line -... | ||
46 | - | ||
47 | struct fb_info *framebuffer_alloc(size_t size, struct device *dev) |
- | |
48 | { |
- | |
49 | #define BYTES_PER_LONG (BITS_PER_LONG/8) |
- | |
50 | #define PADDING (BYTES_PER_LONG - (sizeof(struct fb_info) % BYTES_PER_LONG)) |
- | |
51 | int fb_info_size = sizeof(struct fb_info); |
- | |
52 | struct fb_info *info; |
- | |
53 | char *p; |
- | |
54 | - | ||
55 | if (size) |
- | |
56 | fb_info_size += PADDING; |
- | |
57 | - | ||
58 | p = kzalloc(fb_info_size + size, GFP_KERNEL); |
- | |
59 | - | ||
60 | if (!p) |
- | |
61 | return NULL; |
- | |
62 | - | ||
63 | info = (struct fb_info *) p; |
- | |
64 | - | ||
65 | if (size) |
- | |
66 | info->par = p + fb_info_size; |
- | |
67 | - | ||
68 | return info; |
- | |
69 | #undef PADDING |
- | |
70 | #undef BYTES_PER_LONG |
- | |
71 | } |
- | |
72 | 46 | ||
73 | static int intel_fbdev_set_par(struct fb_info *info) |
47 | static int intel_fbdev_set_par(struct fb_info *info) |
74 | { |
48 | { |
75 | struct drm_fb_helper *fb_helper = info->par; |
49 | struct drm_fb_helper *fb_helper = info->par; |
76 | struct intel_fbdev *ifbdev = |
50 | struct intel_fbdev *ifbdev = |
Line 265... | Line 239... | ||
265 | 239 | ||
266 | /* setup aperture base/size for vesafb takeover */ |
240 | /* setup aperture base/size for vesafb takeover */ |
267 | info->apertures->ranges[0].base = dev->mode_config.fb_base; |
241 | info->apertures->ranges[0].base = dev->mode_config.fb_base; |
Line -... | Line 242... | ||
- | 242 | info->apertures->ranges[0].size = dev_priv->gtt.mappable_end; |
|
- | 243 | ||
Line 268... | Line 244... | ||
268 | info->apertures->ranges[0].size = dev_priv->gtt.mappable_end; |
244 | info->fix.smem_start = dev->mode_config.fb_base + i915_gem_obj_ggtt_offset(obj); |
269 | 245 | info->fix.smem_len = size; |
|
Line 270... | Line 246... | ||
270 | 246 | ||
Line 524... | Line 500... | ||
524 | .gamma_set = intel_crtc_fb_gamma_set, |
500 | .gamma_set = intel_crtc_fb_gamma_set, |
525 | .gamma_get = intel_crtc_fb_gamma_get, |
501 | .gamma_get = intel_crtc_fb_gamma_get, |
526 | .fb_probe = intelfb_create, |
502 | .fb_probe = intelfb_create, |
527 | }; |
503 | }; |
Line -... | Line 504... | ||
- | 504 | ||
- | 505 | static void intel_fbdev_destroy(struct drm_device *dev, |
|
- | 506 | struct intel_fbdev *ifbdev) |
|
- | 507 | { |
|
- | 508 | ||
- | 509 | drm_fb_helper_unregister_fbi(&ifbdev->helper); |
|
- | 510 | drm_fb_helper_release_fbi(&ifbdev->helper); |
|
- | 511 | ||
- | 512 | drm_fb_helper_fini(&ifbdev->helper); |
|
- | 513 | ||
- | 514 | drm_framebuffer_unregister_private(&ifbdev->fb->base); |
|
- | 515 | drm_framebuffer_remove(&ifbdev->fb->base); |
|
- | 516 | } |
|
528 | 517 | ||
529 | /* |
518 | /* |
530 | * Build an intel_fbdev struct using a BIOS allocated framebuffer, if possible. |
519 | * Build an intel_fbdev struct using a BIOS allocated framebuffer, if possible. |
531 | * The core display code will have read out the current plane configuration, |
520 | * The core display code will have read out the current plane configuration, |
532 | * so we use that to figure out if there's an object for us to use as the |
521 | * so we use that to figure out if there's an object for us to use as the |