From: Paul Mundt <lethal@linux-sh.org>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: linux-fbdev-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC 2.6.20 1/1] fbdev,mm: Deferred IO and hecubafb driver
Date: Fri, 23 Feb 2007 18:22:37 +0900 [thread overview]
Message-ID: <20070223092237.GA16889@linux-sh.org> (raw)
In-Reply-To: <20070223063228.GA9906@localhost>
On Fri, Feb 23, 2007 at 07:32:28AM +0100, Jaya Kumar wrote:
> This is a first pass at abstracting deferred IO out from hecubafb and
> into fbdev as was discussed before:
> http://marc.theaimsgroup.com/?l=linux-fbdev-devel&m=117187443327466&w=2
>
> Please let me know your feedback and if it looks okay so far.
>
How about this for an fsync()? I wonder if this will be sufficient for
msync() based flushing, or whether the ->sync VMA op is needed again..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
--
drivers/video/fb_defio.c | 12 ++++++++++++
drivers/video/fbmem.c | 3 +++
include/linux/fb.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index c3e57cc..8a66dc8 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -52,6 +52,18 @@ static void fb_deferred_io_work(struct work_struct *work)
mutex_unlock(&fbdefio->lock);
}
+int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
+{
+ struct fb_info *info = file->private_data;
+
+ /* Kill off the delayed work */
+ cancel_rearming_delayed_work(&info->deferred_work);
+
+ /* Run it immediately */
+ return schedule_delayed_work(&info->deferred_work, 0);
+}
+EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
+
/* vm_ops->page_mkwrite handler */
int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
struct page *page)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 863126a..69bbbe2 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1266,6 +1266,9 @@ static const struct file_operations fb_fops = {
#ifdef HAVE_ARCH_FB_UNMAPPED_AREA
.get_unmapped_area = get_fb_unmapped_area,
#endif
+#ifdef CONFIG_FB_DEFERRED_IO
+ .fsync = fb_deferred_io_fsync,
+#endif
};
struct class *fb_class;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index af217dd..3f62652 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -933,6 +933,8 @@ extern void fb_deferred_io_init(struct fb_info *info);
extern void fb_deferred_io_cleanup(struct fb_info *info);
extern int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
struct page *page);
+extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry,
+ int datasync);
#else
#define fb_deferred_io_init(fb_info) do { } while (0)
#define fb_deferred_io_cleanup(fb_info) do { } while (0)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-02-23 9:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-23 6:32 Jaya Kumar
2007-02-23 9:22 ` Paul Mundt [this message]
2007-02-24 8:24 ` Jaya Kumar
2007-02-24 6:51 ` [Linux-fbdev-devel] [RFC 2.6.20 1/1] fbdev, mm: " Antonino A. Daplas
2007-02-24 8:14 ` Jaya Kumar
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=20070223092237.GA16889@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=jayakumar.lkml@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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