non-linear frame buffer read/write access
PATCH 1/1 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).
Patch is against 2.6.14
drivers/video/fbmem.c +2 -3
@@ -965,6 +965,7 @@ fb_open(struct inode *inode, struct filereturn -ENODEV ;if (!try_module_get (info->fbops->owner))return -ENODEV ; + file->private_data = info;if (info->fbops->fb_open) { res = info->fbops->fb_open (info,1 );if (res)
@@ -976,11 +977,9 @@ fb_open(struct inode *inode, struct filestatic int fb_release (struct inode *inode,struct file *file) { -int fbidx =iminor (inode); -struct fb_info *info; +struct fb_info *const info = (struct fb_info *) file->private_data;lock_kernel (); - info = registered_fb[fbidx];if (info->fbops->fb_release) info->fbops->fb_release (info,1 );module_put (info->fbops->owner);
Signature · 2 lines
Thomas Koeller thomas at koeller dot dyndns dot org
Quoted 7 lines · Thomas Koeller
While the code in
fbmem.callows for hooking read/write access to non-linear frame buffers by means offb_readandfb_writein structfb_ops, I could not find a way tho access the actual frame buffer memory from within these routines. I therefore had to patchfbmem.c, to be able to retrieve a pointer to structfb_infofrom the 'file' argument to these functions.
Quoted 7 lines
The second hunk of the patch is not strictly required, I only did that for symmetry reasons (and the code is somewhat shorter).
Patch is against 2.6.14
Signed-off-by Thomas Koeller <[email protected]>
Okay.
Tony