diff options
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 372aa1776827..31143afe7c95 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #endif | 34 | #endif |
35 | #include <linux/devfs_fs_kernel.h> | 35 | #include <linux/devfs_fs_kernel.h> |
36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
37 | #include <linux/kernel.h> | ||
38 | #include <linux/device.h> | 37 | #include <linux/device.h> |
39 | #include <linux/efi.h> | 38 | #include <linux/efi.h> |
40 | 39 | ||
@@ -162,7 +161,6 @@ char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size | |||
162 | } | 161 | } |
163 | 162 | ||
164 | #ifdef CONFIG_LOGO | 163 | #ifdef CONFIG_LOGO |
165 | #include <linux/linux_logo.h> | ||
166 | 164 | ||
167 | static inline unsigned safe_shift(unsigned d, int n) | 165 | static inline unsigned safe_shift(unsigned d, int n) |
168 | { | 166 | { |
@@ -336,11 +334,11 @@ static void fb_rotate_logo_ud(const u8 *in, u8 *out, u32 width, u32 height) | |||
336 | 334 | ||
337 | static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height) | 335 | static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height) |
338 | { | 336 | { |
339 | int i, j, w = width - 1; | 337 | int i, j, h = height - 1; |
340 | 338 | ||
341 | for (i = 0; i < height; i++) | 339 | for (i = 0; i < height; i++) |
342 | for (j = 0; j < width; j++) | 340 | for (j = 0; j < width; j++) |
343 | out[height * j + w - i] = *in++; | 341 | out[height * j + h - i] = *in++; |
344 | } | 342 | } |
345 | 343 | ||
346 | static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height) | 344 | static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height) |
@@ -358,24 +356,24 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst, | |||
358 | u32 tmp; | 356 | u32 tmp; |
359 | 357 | ||
360 | if (rotate == FB_ROTATE_UD) { | 358 | if (rotate == FB_ROTATE_UD) { |
361 | image->dx = info->var.xres - image->width; | ||
362 | image->dy = info->var.yres - image->height; | ||
363 | fb_rotate_logo_ud(image->data, dst, image->width, | 359 | fb_rotate_logo_ud(image->data, dst, image->width, |
364 | image->height); | 360 | image->height); |
361 | image->dx = info->var.xres - image->width; | ||
362 | image->dy = info->var.yres - image->height; | ||
365 | } else if (rotate == FB_ROTATE_CW) { | 363 | } else if (rotate == FB_ROTATE_CW) { |
366 | tmp = image->width; | ||
367 | image->width = image->height; | ||
368 | image->height = tmp; | ||
369 | image->dx = info->var.xres - image->height; | ||
370 | fb_rotate_logo_cw(image->data, dst, image->width, | 364 | fb_rotate_logo_cw(image->data, dst, image->width, |
371 | image->height); | 365 | image->height); |
372 | } else if (rotate == FB_ROTATE_CCW) { | ||
373 | tmp = image->width; | 366 | tmp = image->width; |
374 | image->width = image->height; | 367 | image->width = image->height; |
375 | image->height = tmp; | 368 | image->height = tmp; |
376 | image->dy = info->var.yres - image->width; | 369 | image->dx = info->var.xres - image->width; |
370 | } else if (rotate == FB_ROTATE_CCW) { | ||
377 | fb_rotate_logo_ccw(image->data, dst, image->width, | 371 | fb_rotate_logo_ccw(image->data, dst, image->width, |
378 | image->height); | 372 | image->height); |
373 | tmp = image->width; | ||
374 | image->width = image->height; | ||
375 | image->height = tmp; | ||
376 | image->dy = info->var.yres - image->height; | ||
379 | } | 377 | } |
380 | 378 | ||
381 | image->data = dst; | 379 | image->data = dst; |
@@ -435,7 +433,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate) | |||
435 | depth = info->var.green.length; | 433 | depth = info->var.green.length; |
436 | } | 434 | } |
437 | 435 | ||
438 | if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) { | 436 | if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR && depth > 4) { |
439 | /* assume console colormap */ | 437 | /* assume console colormap */ |
440 | depth = 4; | 438 | depth = 4; |
441 | } | 439 | } |
@@ -1278,8 +1276,8 @@ static struct file_operations fb_fops = { | |||
1278 | #endif | 1276 | #endif |
1279 | }; | 1277 | }; |
1280 | 1278 | ||
1281 | static struct class *fb_class; | 1279 | struct class *fb_class; |
1282 | 1280 | EXPORT_SYMBOL(fb_class); | |
1283 | /** | 1281 | /** |
1284 | * register_framebuffer - registers a frame buffer device | 1282 | * register_framebuffer - registers a frame buffer device |
1285 | * @fb_info: frame buffer info structure | 1283 | * @fb_info: frame buffer info structure |
@@ -1355,6 +1353,7 @@ register_framebuffer(struct fb_info *fb_info) | |||
1355 | int | 1353 | int |
1356 | unregister_framebuffer(struct fb_info *fb_info) | 1354 | unregister_framebuffer(struct fb_info *fb_info) |
1357 | { | 1355 | { |
1356 | struct fb_event event; | ||
1358 | int i; | 1357 | int i; |
1359 | 1358 | ||
1360 | i = fb_info->node; | 1359 | i = fb_info->node; |
@@ -1362,13 +1361,17 @@ unregister_framebuffer(struct fb_info *fb_info) | |||
1362 | return -EINVAL; | 1361 | return -EINVAL; |
1363 | devfs_remove("fb/%d", i); | 1362 | devfs_remove("fb/%d", i); |
1364 | 1363 | ||
1365 | if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) | 1364 | if (fb_info->pixmap.addr && |
1365 | (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) | ||
1366 | kfree(fb_info->pixmap.addr); | 1366 | kfree(fb_info->pixmap.addr); |
1367 | fb_destroy_modelist(&fb_info->modelist); | 1367 | fb_destroy_modelist(&fb_info->modelist); |
1368 | registered_fb[i]=NULL; | 1368 | registered_fb[i]=NULL; |
1369 | num_registered_fb--; | 1369 | num_registered_fb--; |
1370 | fb_cleanup_class_device(fb_info); | 1370 | fb_cleanup_class_device(fb_info); |
1371 | class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); | 1371 | class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); |
1372 | event.info = fb_info; | ||
1373 | blocking_notifier_call_chain(&fb_notifier_list, | ||
1374 | FB_EVENT_FB_UNREGISTERED, &event); | ||
1372 | return 0; | 1375 | return 0; |
1373 | } | 1376 | } |
1374 | 1377 | ||
@@ -1491,28 +1494,6 @@ int fb_new_modelist(struct fb_info *info) | |||
1491 | return err; | 1494 | return err; |
1492 | } | 1495 | } |
1493 | 1496 | ||
1494 | /** | ||
1495 | * fb_con_duit - user<->fbcon passthrough | ||
1496 | * @info: struct fb_info | ||
1497 | * @event: notification event to be passed to fbcon | ||
1498 | * @data: private data | ||
1499 | * | ||
1500 | * DESCRIPTION | ||
1501 | * This function is an fbcon-user event passing channel | ||
1502 | * which bypasses fbdev. This is hopefully temporary | ||
1503 | * until a user interface for fbcon is created | ||
1504 | */ | ||
1505 | int fb_con_duit(struct fb_info *info, int event, void *data) | ||
1506 | { | ||
1507 | struct fb_event evnt; | ||
1508 | |||
1509 | evnt.info = info; | ||
1510 | evnt.data = data; | ||
1511 | |||
1512 | return blocking_notifier_call_chain(&fb_notifier_list, event, &evnt); | ||
1513 | } | ||
1514 | EXPORT_SYMBOL(fb_con_duit); | ||
1515 | |||
1516 | static char *video_options[FB_MAX]; | 1497 | static char *video_options[FB_MAX]; |
1517 | static int ofonly; | 1498 | static int ofonly; |
1518 | 1499 | ||
@@ -1622,6 +1603,5 @@ EXPORT_SYMBOL(fb_set_suspend); | |||
1622 | EXPORT_SYMBOL(fb_register_client); | 1603 | EXPORT_SYMBOL(fb_register_client); |
1623 | EXPORT_SYMBOL(fb_unregister_client); | 1604 | EXPORT_SYMBOL(fb_unregister_client); |
1624 | EXPORT_SYMBOL(fb_get_options); | 1605 | EXPORT_SYMBOL(fb_get_options); |
1625 | EXPORT_SYMBOL(fb_new_modelist); | ||
1626 | 1606 | ||
1627 | MODULE_LICENSE("GPL"); | 1607 | MODULE_LICENSE("GPL"); |