diff options
Diffstat (limited to 'drivers/video/vga16fb.c')
-rw-r--r-- | drivers/video/vga16fb.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index bf638a47a5b3..149c47ac7e93 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c | |||
@@ -1263,10 +1263,19 @@ static void vga16fb_imageblit(struct fb_info *info, const struct fb_image *image | |||
1263 | vga_imageblit_color(info, image); | 1263 | vga_imageblit_color(info, image); |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | static void vga16fb_destroy(struct fb_info *info) | ||
1267 | { | ||
1268 | iounmap(info->screen_base); | ||
1269 | fb_dealloc_cmap(&info->cmap); | ||
1270 | /* XXX unshare VGA regions */ | ||
1271 | framebuffer_release(info); | ||
1272 | } | ||
1273 | |||
1266 | static struct fb_ops vga16fb_ops = { | 1274 | static struct fb_ops vga16fb_ops = { |
1267 | .owner = THIS_MODULE, | 1275 | .owner = THIS_MODULE, |
1268 | .fb_open = vga16fb_open, | 1276 | .fb_open = vga16fb_open, |
1269 | .fb_release = vga16fb_release, | 1277 | .fb_release = vga16fb_release, |
1278 | .fb_destroy = vga16fb_destroy, | ||
1270 | .fb_check_var = vga16fb_check_var, | 1279 | .fb_check_var = vga16fb_check_var, |
1271 | .fb_set_par = vga16fb_set_par, | 1280 | .fb_set_par = vga16fb_set_par, |
1272 | .fb_setcolreg = vga16fb_setcolreg, | 1281 | .fb_setcolreg = vga16fb_setcolreg, |
@@ -1306,6 +1315,11 @@ static int __devinit vga16fb_probe(struct platform_device *dev) | |||
1306 | ret = -ENOMEM; | 1315 | ret = -ENOMEM; |
1307 | goto err_fb_alloc; | 1316 | goto err_fb_alloc; |
1308 | } | 1317 | } |
1318 | info->apertures = alloc_apertures(1); | ||
1319 | if (!info->apertures) { | ||
1320 | ret = -ENOMEM; | ||
1321 | goto err_ioremap; | ||
1322 | } | ||
1309 | 1323 | ||
1310 | /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ | 1324 | /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ |
1311 | info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS, 0); | 1325 | info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS, 0); |
@@ -1335,7 +1349,7 @@ static int __devinit vga16fb_probe(struct platform_device *dev) | |||
1335 | info->fix = vga16fb_fix; | 1349 | info->fix = vga16fb_fix; |
1336 | /* supports rectangles with widths of multiples of 8 */ | 1350 | /* supports rectangles with widths of multiples of 8 */ |
1337 | info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31; | 1351 | info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31; |
1338 | info->flags = FBINFO_FLAG_DEFAULT | | 1352 | info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | |
1339 | FBINFO_HWACCEL_YPAN; | 1353 | FBINFO_HWACCEL_YPAN; |
1340 | 1354 | ||
1341 | i = (info->var.bits_per_pixel == 8) ? 256 : 16; | 1355 | i = (info->var.bits_per_pixel == 8) ? 256 : 16; |
@@ -1354,6 +1368,9 @@ static int __devinit vga16fb_probe(struct platform_device *dev) | |||
1354 | 1368 | ||
1355 | vga16fb_update_fix(info); | 1369 | vga16fb_update_fix(info); |
1356 | 1370 | ||
1371 | info->apertures->ranges[0].base = VGA_FB_PHYS; | ||
1372 | info->apertures->ranges[0].size = VGA_FB_PHYS_LEN; | ||
1373 | |||
1357 | if (register_framebuffer(info) < 0) { | 1374 | if (register_framebuffer(info) < 0) { |
1358 | printk(KERN_ERR "vga16fb: unable to register framebuffer\n"); | 1375 | printk(KERN_ERR "vga16fb: unable to register framebuffer\n"); |
1359 | ret = -EINVAL; | 1376 | ret = -EINVAL; |
@@ -1380,13 +1397,8 @@ static int vga16fb_remove(struct platform_device *dev) | |||
1380 | { | 1397 | { |
1381 | struct fb_info *info = platform_get_drvdata(dev); | 1398 | struct fb_info *info = platform_get_drvdata(dev); |
1382 | 1399 | ||
1383 | if (info) { | 1400 | if (info) |
1384 | unregister_framebuffer(info); | 1401 | unregister_framebuffer(info); |
1385 | iounmap(info->screen_base); | ||
1386 | fb_dealloc_cmap(&info->cmap); | ||
1387 | /* XXX unshare VGA regions */ | ||
1388 | framebuffer_release(info); | ||
1389 | } | ||
1390 | 1402 | ||
1391 | return 0; | 1403 | return 0; |
1392 | } | 1404 | } |