From: Thomas Koeller <thomas@koeller.dyndns.org>
To: adaplas@pol.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] non-linear frame buffer read/write access
Date: Tue, 3 Jan 2006 23:39:24 +0100 [thread overview]
Message-ID: <200601032339.24927.thomas@koeller.dyndns.org> (raw)
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
Signed-off-by: Thomas Koeller <thomas@koeller.dyndns.org>
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index e2667dd..145c18f 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -965,6 +965,7 @@ fb_open(struct inode *inode, struct file
return -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 file
static 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);
--
Thomas Koeller
thomas at koeller dot dyndns dot org
next reply other threads:[~2006-01-03 22:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-03 22:39 Thomas Koeller [this message]
2006-01-06 21:25 ` Antonino A. Daplas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200601032339.24927.thomas@koeller.dyndns.org \
--to=thomas@koeller.dyndns.org \
--cc=adaplas@pol.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®