aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-07-30 06:04:17 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 16:28:44 -0400
commit256154fbc31c25a8df4d398232acfa9d4892224c (patch)
tree278582add1a28766a1f3f4dba2f250cdbb191e0a /drivers/video/fbmem.c
parent834a9b8ca7a01c34570be021f88e18884a29f048 (diff)
[PATCH] fbdev: statically link the framebuffer notification functions
The backlight and lcd subsystems can be notified by the framebuffer layer of blanking events. However, these subsystems, as a whole, can function independently from the framebuffer layer. But in order to enable to the lcd and backlight subsystems, the framebuffer has to be compiled also, effectively sucking in a huge amount of unneeded code. To prevent dependency problems, separate out the framebuffer notification mechanism from the framebuffer layer and permanently link it to the kernel. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c54
1 files changed, 11 insertions, 43 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 4fc9df426c1a..17961e3ecaa0 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -52,7 +52,6 @@
52 52
53#define FBPIXMAPSIZE (1024 * 8) 53#define FBPIXMAPSIZE (1024 * 8)
54 54
55static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
56struct fb_info *registered_fb[FB_MAX]; 55struct fb_info *registered_fb[FB_MAX];
57int num_registered_fb; 56int num_registered_fb;
58 57
@@ -791,8 +790,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
791 790
792 event.info = info; 791 event.info = info;
793 event.data = &mode1; 792 event.data = &mode1;
794 ret = blocking_notifier_call_chain(&fb_notifier_list, 793 ret = fb_notifier_call_chain(FB_EVENT_MODE_DELETE, &event);
795 FB_EVENT_MODE_DELETE, &event);
796 } 794 }
797 795
798 if (!ret) 796 if (!ret)
@@ -837,8 +835,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
837 835
838 info->flags &= ~FBINFO_MISC_USEREVENT; 836 info->flags &= ~FBINFO_MISC_USEREVENT;
839 event.info = info; 837 event.info = info;
840 blocking_notifier_call_chain(&fb_notifier_list, 838 fb_notifier_call_chain(evnt, &event);
841 evnt, &event);
842 } 839 }
843 } 840 }
844 } 841 }
@@ -861,8 +858,7 @@ fb_blank(struct fb_info *info, int blank)
861 858
862 event.info = info; 859 event.info = info;
863 event.data = &blank; 860 event.data = &blank;
864 blocking_notifier_call_chain(&fb_notifier_list, 861 fb_notifier_call_chain(FB_EVENT_BLANK, &event);
865 FB_EVENT_BLANK, &event);
866 } 862 }
867 863
868 return ret; 864 return ret;
@@ -933,8 +929,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
933 con2fb.framebuffer = -1; 929 con2fb.framebuffer = -1;
934 event.info = info; 930 event.info = info;
935 event.data = &con2fb; 931 event.data = &con2fb;
936 blocking_notifier_call_chain(&fb_notifier_list, 932 fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
937 FB_EVENT_GET_CONSOLE_MAP, &event);
938 return copy_to_user(argp, &con2fb, 933 return copy_to_user(argp, &con2fb,
939 sizeof(con2fb)) ? -EFAULT : 0; 934 sizeof(con2fb)) ? -EFAULT : 0;
940 case FBIOPUT_CON2FBMAP: 935 case FBIOPUT_CON2FBMAP:
@@ -952,9 +947,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
952 return -EINVAL; 947 return -EINVAL;
953 event.info = info; 948 event.info = info;
954 event.data = &con2fb; 949 event.data = &con2fb;
955 return blocking_notifier_call_chain(&fb_notifier_list, 950 return fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP,
956 FB_EVENT_SET_CONSOLE_MAP, 951 &event);
957 &event);
958 case FBIOBLANK: 952 case FBIOBLANK:
959 acquire_console_sem(); 953 acquire_console_sem();
960 info->flags |= FBINFO_MISC_USEREVENT; 954 info->flags |= FBINFO_MISC_USEREVENT;
@@ -1330,8 +1324,7 @@ register_framebuffer(struct fb_info *fb_info)
1330 registered_fb[i] = fb_info; 1324 registered_fb[i] = fb_info;
1331 1325
1332 event.info = fb_info; 1326 event.info = fb_info;
1333 blocking_notifier_call_chain(&fb_notifier_list, 1327 fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
1334 FB_EVENT_FB_REGISTERED, &event);
1335 return 0; 1328 return 0;
1336} 1329}
1337 1330
@@ -1365,30 +1358,11 @@ unregister_framebuffer(struct fb_info *fb_info)
1365 fb_cleanup_class_device(fb_info); 1358 fb_cleanup_class_device(fb_info);
1366 class_device_destroy(fb_class, MKDEV(FB_MAJOR, i)); 1359 class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
1367 event.info = fb_info; 1360 event.info = fb_info;
1368 blocking_notifier_call_chain(&fb_notifier_list, 1361 fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
1369 FB_EVENT_FB_UNREGISTERED, &event);
1370 return 0; 1362 return 0;
1371} 1363}
1372 1364
1373/** 1365/**
1374 * fb_register_client - register a client notifier
1375 * @nb: notifier block to callback on events
1376 */
1377int fb_register_client(struct notifier_block *nb)
1378{
1379 return blocking_notifier_chain_register(&fb_notifier_list, nb);
1380}
1381
1382/**
1383 * fb_unregister_client - unregister a client notifier
1384 * @nb: notifier block to callback on events
1385 */
1386int fb_unregister_client(struct notifier_block *nb)
1387{
1388 return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
1389}
1390
1391/**
1392 * fb_set_suspend - low level driver signals suspend 1366 * fb_set_suspend - low level driver signals suspend
1393 * @info: framebuffer affected 1367 * @info: framebuffer affected
1394 * @state: 0 = resuming, !=0 = suspending 1368 * @state: 0 = resuming, !=0 = suspending
@@ -1403,13 +1377,11 @@ void fb_set_suspend(struct fb_info *info, int state)
1403 1377
1404 event.info = info; 1378 event.info = info;
1405 if (state) { 1379 if (state) {
1406 blocking_notifier_call_chain(&fb_notifier_list, 1380 fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
1407 FB_EVENT_SUSPEND, &event);
1408 info->state = FBINFO_STATE_SUSPENDED; 1381 info->state = FBINFO_STATE_SUSPENDED;
1409 } else { 1382 } else {
1410 info->state = FBINFO_STATE_RUNNING; 1383 info->state = FBINFO_STATE_RUNNING;
1411 blocking_notifier_call_chain(&fb_notifier_list, 1384 fb_notifier_call_chain(FB_EVENT_RESUME, &event);
1412 FB_EVENT_RESUME, &event);
1413 } 1385 }
1414} 1386}
1415 1387
@@ -1480,9 +1452,7 @@ int fb_new_modelist(struct fb_info *info)
1480 1452
1481 if (!list_empty(&info->modelist)) { 1453 if (!list_empty(&info->modelist)) {
1482 event.info = info; 1454 event.info = info;
1483 err = blocking_notifier_call_chain(&fb_notifier_list, 1455 err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
1484 FB_EVENT_NEW_MODELIST,
1485 &event);
1486 } 1456 }
1487 1457
1488 return err; 1458 return err;
@@ -1594,8 +1564,6 @@ EXPORT_SYMBOL(fb_blank);
1594EXPORT_SYMBOL(fb_pan_display); 1564EXPORT_SYMBOL(fb_pan_display);
1595EXPORT_SYMBOL(fb_get_buffer_offset); 1565EXPORT_SYMBOL(fb_get_buffer_offset);
1596EXPORT_SYMBOL(fb_set_suspend); 1566EXPORT_SYMBOL(fb_set_suspend);
1597EXPORT_SYMBOL(fb_register_client);
1598EXPORT_SYMBOL(fb_unregister_client);
1599EXPORT_SYMBOL(fb_get_options); 1567EXPORT_SYMBOL(fb_get_options);
1600 1568
1601MODULE_LICENSE("GPL"); 1569MODULE_LICENSE("GPL");