diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fb.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 7ba4a232a97f..2b0fe54cd92c 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -60,10 +60,12 @@ static struct fb_ops intelfb_ops = { | |||
60 | .fb_imageblit = cfb_imageblit, | 60 | .fb_imageblit = cfb_imageblit, |
61 | .fb_pan_display = drm_fb_helper_pan_display, | 61 | .fb_pan_display = drm_fb_helper_pan_display, |
62 | .fb_blank = drm_fb_helper_blank, | 62 | .fb_blank = drm_fb_helper_blank, |
63 | .fb_setcmap = drm_fb_helper_setcmap, | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | static struct drm_fb_helper_funcs intel_fb_helper_funcs = { | 66 | static struct drm_fb_helper_funcs intel_fb_helper_funcs = { |
66 | .gamma_set = intel_crtc_fb_gamma_set, | 67 | .gamma_set = intel_crtc_fb_gamma_set, |
68 | .gamma_get = intel_crtc_fb_gamma_get, | ||
67 | }; | 69 | }; |
68 | 70 | ||
69 | 71 | ||
@@ -110,6 +112,7 @@ EXPORT_SYMBOL(intelfb_resize); | |||
110 | static int intelfb_create(struct drm_device *dev, uint32_t fb_width, | 112 | static int intelfb_create(struct drm_device *dev, uint32_t fb_width, |
111 | uint32_t fb_height, uint32_t surface_width, | 113 | uint32_t fb_height, uint32_t surface_width, |
112 | uint32_t surface_height, | 114 | uint32_t surface_height, |
115 | uint32_t surface_depth, uint32_t surface_bpp, | ||
113 | struct drm_framebuffer **fb_p) | 116 | struct drm_framebuffer **fb_p) |
114 | { | 117 | { |
115 | struct fb_info *info; | 118 | struct fb_info *info; |
@@ -122,12 +125,16 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width, | |||
122 | struct device *device = &dev->pdev->dev; | 125 | struct device *device = &dev->pdev->dev; |
123 | int size, ret, mmio_bar = IS_I9XX(dev) ? 0 : 1; | 126 | int size, ret, mmio_bar = IS_I9XX(dev) ? 0 : 1; |
124 | 127 | ||
128 | /* we don't do packed 24bpp */ | ||
129 | if (surface_bpp == 24) | ||
130 | surface_bpp = 32; | ||
131 | |||
125 | mode_cmd.width = surface_width; | 132 | mode_cmd.width = surface_width; |
126 | mode_cmd.height = surface_height; | 133 | mode_cmd.height = surface_height; |
127 | 134 | ||
128 | mode_cmd.bpp = 32; | 135 | mode_cmd.bpp = surface_bpp; |
129 | mode_cmd.pitch = ALIGN(mode_cmd.width * ((mode_cmd.bpp + 1) / 8), 64); | 136 | mode_cmd.pitch = ALIGN(mode_cmd.width * ((mode_cmd.bpp + 1) / 8), 64); |
130 | mode_cmd.depth = 24; | 137 | mode_cmd.depth = surface_depth; |
131 | 138 | ||
132 | size = mode_cmd.pitch * mode_cmd.height; | 139 | size = mode_cmd.pitch * mode_cmd.height; |
133 | size = ALIGN(size, PAGE_SIZE); | 140 | size = ALIGN(size, PAGE_SIZE); |
@@ -205,7 +212,7 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width, | |||
205 | 212 | ||
206 | // memset(info->screen_base, 0, size); | 213 | // memset(info->screen_base, 0, size); |
207 | 214 | ||
208 | drm_fb_helper_fill_fix(info, fb->pitch); | 215 | drm_fb_helper_fill_fix(info, fb->pitch, fb->depth); |
209 | drm_fb_helper_fill_var(info, fb, fb_width, fb_height); | 216 | drm_fb_helper_fill_var(info, fb, fb_width, fb_height); |
210 | 217 | ||
211 | /* FIXME: we really shouldn't expose mmio space at all */ | 218 | /* FIXME: we really shouldn't expose mmio space at all */ |
@@ -243,7 +250,7 @@ int intelfb_probe(struct drm_device *dev) | |||
243 | int ret; | 250 | int ret; |
244 | 251 | ||
245 | DRM_DEBUG("\n"); | 252 | DRM_DEBUG("\n"); |
246 | ret = drm_fb_helper_single_fb_probe(dev, intelfb_create); | 253 | ret = drm_fb_helper_single_fb_probe(dev, 32, intelfb_create); |
247 | return ret; | 254 | return ret; |
248 | } | 255 | } |
249 | EXPORT_SYMBOL(intelfb_probe); | 256 | EXPORT_SYMBOL(intelfb_probe); |