提交 cae8a12f 编写于 作者: T Thomas Koeller 提交者: Linus Torvalds

[PATCH] non-linear frame buffer read/write access

While the code in fbmem.c allows for hooking read/write access to
non-linear frame buffers by means of fb_read and fb_write in struct fb_ops,
I could not find a way tho access the actual frame buffer memory from
within these routines.  I therefore had to patch fbmem.c, to be able to
retrieve a pointer to struct fb_info from the 'file' argument to these
functions.

The second hunk of the patch is not strictly required, I only did that for
symmetry reasons (and the code is somewhat shorter).
Signed-off-by: NThomas Koeller <thomas@koeller.dyndns.org>
Acked-by: N"Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 74b4f042
...@@ -1234,6 +1234,7 @@ fb_open(struct inode *inode, struct file *file) ...@@ -1234,6 +1234,7 @@ fb_open(struct inode *inode, struct file *file)
return -ENODEV; return -ENODEV;
if (!try_module_get(info->fbops->owner)) if (!try_module_get(info->fbops->owner))
return -ENODEV; return -ENODEV;
file->private_data = info;
if (info->fbops->fb_open) { if (info->fbops->fb_open) {
res = info->fbops->fb_open(info,1); res = info->fbops->fb_open(info,1);
if (res) if (res)
...@@ -1245,11 +1246,9 @@ fb_open(struct inode *inode, struct file *file) ...@@ -1245,11 +1246,9 @@ fb_open(struct inode *inode, struct file *file)
static int static int
fb_release(struct inode *inode, struct file *file) fb_release(struct inode *inode, struct file *file)
{ {
int fbidx = iminor(inode); struct fb_info * const info = file->private_data;
struct fb_info *info;
lock_kernel(); lock_kernel();
info = registered_fb[fbidx];
if (info->fbops->fb_release) if (info->fbops->fb_release)
info->fbops->fb_release(info,1); info->fbops->fb_release(info,1);
module_put(info->fbops->owner); module_put(info->fbops->owner);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册