projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream-fixes' into upstream
[powerpc.git]
/
drivers
/
video
/
fbmem.c
diff --git
a/drivers/video/fbmem.c
b/drivers/video/fbmem.c
index
07d882b
..
372aa17
100644
(file)
--- a/
drivers/video/fbmem.c
+++ b/
drivers/video/fbmem.c
@@
-55,7
+55,7
@@
#define FBPIXMAPSIZE (1024 * 8)
#define FBPIXMAPSIZE (1024 * 8)
-static
struct notifier_block *fb_notifier_list
;
+static
BLOCKING_NOTIFIER_HEAD(fb_notifier_list)
;
struct fb_info *registered_fb[FB_MAX];
int num_registered_fb;
struct fb_info *registered_fb[FB_MAX];
int num_registered_fb;
@@
-435,6
+435,11
@@
int fb_prepare_logo(struct fb_info *info, int rotate)
depth = info->var.green.length;
}
depth = info->var.green.length;
}
+ if (info->fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR) {
+ /* assume console colormap */
+ depth = 4;
+ }
+
if (depth >= 8) {
switch (info->fix.visual) {
case FB_VISUAL_TRUECOLOR:
if (depth >= 8) {
switch (info->fix.visual) {
case FB_VISUAL_TRUECOLOR:
@@
-669,13
+674,19
@@
fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
total_size = info->fix.smem_len;
if (p > total_size)
total_size = info->fix.smem_len;
if (p > total_size)
- return
0
;
+ return
-EFBIG
;
- if (count >= total_size)
+ if (count > total_size) {
+ err = -EFBIG;
count = total_size;
count = total_size;
+ }
+
+ if (count + p > total_size) {
+ if (!err)
+ err = -ENOSPC;
- if (count + p > total_size)
count = total_size - p;
count = total_size - p;
+ }
buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
GFP_KERNEL);
buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
GFP_KERNEL);
@@
-717,7
+728,7
@@
fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
kfree(buffer);
kfree(buffer);
- return (
err) ? err : cnt
;
+ return (
cnt) ? cnt : err
;
}
#ifdef CONFIG_KMOD
}
#ifdef CONFIG_KMOD
@@
-784,7
+795,7
@@
fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
event.info = info;
event.data = &mode1;
event.info = info;
event.data = &mode1;
- ret = notifier_call_chain(&fb_notifier_list,
+ ret =
blocking_
notifier_call_chain(&fb_notifier_list,
FB_EVENT_MODE_DELETE, &event);
}
FB_EVENT_MODE_DELETE, &event);
}
@@
-830,8
+841,8
@@
fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
info->flags &= ~FBINFO_MISC_USEREVENT;
event.info = info;
info->flags &= ~FBINFO_MISC_USEREVENT;
event.info = info;
-
notifier_call_chain(&fb_notifier_list, evn
t,
-
&event);
+
blocking_notifier_call_chain(&fb_notifier_lis
t,
+
evnt,
&event);
}
}
}
}
}
}
@@
-854,7
+865,8
@@
fb_blank(struct fb_info *info, int blank)
event.info = info;
event.data = ␣
event.info = info;
event.data = ␣
- notifier_call_chain(&fb_notifier_list, FB_EVENT_BLANK, &event);
+ blocking_notifier_call_chain(&fb_notifier_list,
+ FB_EVENT_BLANK, &event);
}
return ret;
}
return ret;
@@
-925,7
+937,7
@@
fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
con2fb.framebuffer = -1;
event.info = info;
event.data = &con2fb;
con2fb.framebuffer = -1;
event.info = info;
event.data = &con2fb;
- notifier_call_chain(&fb_notifier_list,
+
blocking_
notifier_call_chain(&fb_notifier_list,
FB_EVENT_GET_CONSOLE_MAP, &event);
return copy_to_user(argp, &con2fb,
sizeof(con2fb)) ? -EFAULT : 0;
FB_EVENT_GET_CONSOLE_MAP, &event);
return copy_to_user(argp, &con2fb,
sizeof(con2fb)) ? -EFAULT : 0;
@@
-944,7
+956,7
@@
fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
return -EINVAL;
event.info = info;
event.data = &con2fb;
return -EINVAL;
event.info = info;
event.data = &con2fb;
- return notifier_call_chain(&fb_notifier_list,
+ return
blocking_
notifier_call_chain(&fb_notifier_list,
FB_EVENT_SET_CONSOLE_MAP,
&event);
case FBIOBLANK:
FB_EVENT_SET_CONSOLE_MAP,
&event);
case FBIOBLANK:
@@
-1324,7
+1336,7
@@
register_framebuffer(struct fb_info *fb_info)
devfs_mk_cdev(MKDEV(FB_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO, "fb/%d", i);
event.info = fb_info;
devfs_mk_cdev(MKDEV(FB_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO, "fb/%d", i);
event.info = fb_info;
- notifier_call_chain(&fb_notifier_list,
+
blocking_
notifier_call_chain(&fb_notifier_list,
FB_EVENT_FB_REGISTERED, &event);
return 0;
}
FB_EVENT_FB_REGISTERED, &event);
return 0;
}
@@
-1366,7
+1378,7
@@
unregister_framebuffer(struct fb_info *fb_info)
*/
int fb_register_client(struct notifier_block *nb)
{
*/
int fb_register_client(struct notifier_block *nb)
{
- return notifier_chain_register(&fb_notifier_list, nb);
+ return
blocking_
notifier_chain_register(&fb_notifier_list, nb);
}
/**
}
/**
@@
-1375,7
+1387,7
@@
int fb_register_client(struct notifier_block *nb)
*/
int fb_unregister_client(struct notifier_block *nb)
{
*/
int fb_unregister_client(struct notifier_block *nb)
{
- return notifier_chain_unregister(&fb_notifier_list, nb);
+ return
blocking_
notifier_chain_unregister(&fb_notifier_list, nb);
}
/**
}
/**
@@
-1393,11
+1405,13
@@
void fb_set_suspend(struct fb_info *info, int state)
event.info = info;
if (state) {
event.info = info;
if (state) {
- notifier_call_chain(&fb_notifier_list, FB_EVENT_SUSPEND, &event);
+ blocking_notifier_call_chain(&fb_notifier_list,
+ FB_EVENT_SUSPEND, &event);
info->state = FBINFO_STATE_SUSPENDED;
} else {
info->state = FBINFO_STATE_RUNNING;
info->state = FBINFO_STATE_SUSPENDED;
} else {
info->state = FBINFO_STATE_RUNNING;
- notifier_call_chain(&fb_notifier_list, FB_EVENT_RESUME, &event);
+ blocking_notifier_call_chain(&fb_notifier_list,
+ FB_EVENT_RESUME, &event);
}
}
}
}
@@
-1469,7
+1483,7
@@
int fb_new_modelist(struct fb_info *info)
if (!list_empty(&info->modelist)) {
event.info = info;
if (!list_empty(&info->modelist)) {
event.info = info;
- err = notifier_call_chain(&fb_notifier_list,
+ err =
blocking_
notifier_call_chain(&fb_notifier_list,
FB_EVENT_NEW_MODELIST,
&event);
}
FB_EVENT_NEW_MODELIST,
&event);
}
@@
-1495,7
+1509,7
@@
int fb_con_duit(struct fb_info *info, int event, void *data)
evnt.info = info;
evnt.data = data;
evnt.info = info;
evnt.data = data;
- return notifier_call_chain(&fb_notifier_list, event, &evnt);
+ return
blocking_
notifier_call_chain(&fb_notifier_list, event, &evnt);
}
EXPORT_SYMBOL(fb_con_duit);
}
EXPORT_SYMBOL(fb_con_duit);
@@
-1585,7
+1599,7
@@
static int __init video_setup(char *options)
}
}
}
}
- return
0
;
+ return
1
;
}
__setup("video=", video_setup);
#endif
}
__setup("video=", video_setup);
#endif