linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: aliguori@us.ibm.com, adaplas@gmail.com, linux-sh@vger.kernel.org,
	armbru@redhat.com, lethal@linux-sh.org,
	Magnus Damm <magnus.damm@gmail.com>,
	jayakumar.lkml@gmail.com
Subject: [PATCH 05/05] video: deferred io sys helpers - xen V2
Date: Wed, 24 Dec 2008 17:30:26 +0900	[thread overview]
Message-ID: <20081224083026.1848.92193.sendpatchset@rx1.opensource.se> (raw)
In-Reply-To: <20081224082946.1848.46644.sendpatchset@rx1.opensource.se>

From: Magnus Damm <damm@igel.co.jp>

Change the xen driver to use the new shared sys helpers. This
allows us to remove some duplicated code. The use of the new
shared sys helpers will change the behavior of this driver from
syncing all operations directly to using the deferred io delay.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Changes since V1:
 - Only cosmetic

 drivers/video/Kconfig       |    4 ---
 drivers/video/xen-fbfront.c |   51 +++++++++----------------------------------
 2 files changed, 11 insertions(+), 44 deletions(-)

--- 0005/drivers/video/Kconfig
+++ work/drivers/video/Kconfig	2008-12-24 16:42:47.000000000 +0900
@@ -2057,10 +2057,6 @@ config FB_VIRTUAL
 config XEN_FBDEV_FRONTEND
 	tristate "Xen virtual frame buffer support"
 	depends on FB && XEN
-	select FB_SYS_FILLRECT
-	select FB_SYS_COPYAREA
-	select FB_SYS_IMAGEBLIT
-	select FB_SYS_FOPS
 	select FB_DEFERRED_IO
 	default y
 	help
--- 0001/drivers/video/xen-fbfront.c
+++ work/drivers/video/xen-fbfront.c	2008-12-24 16:44:19.000000000 +0900
@@ -177,11 +177,17 @@ static void xenfb_refresh(struct xenfb_i
 static void xenfb_deferred_io(struct fb_info *fb_info,
 			      struct list_head *pagelist)
 {
+	struct fb_deferred_io *fbdefio = fb_info->fbdefio;
 	struct xenfb_info *info = fb_info->par;
 	struct page *page;
 	unsigned long beg, end;
 	int y1, y2, miny, maxy;
 
+	if (fbdefio->dx != -1)
+		xenfb_refresh(info, fbdefio->dx, fbdefio->dy,
+			      min_t(int, info->page->width, fbdefio->width),
+			      min_t(int, info->page->height, fbdefio->height));
+
 	miny = INT_MAX;
 	maxy = 0;
 	list_for_each_entry(page, pagelist, lru) {
@@ -235,41 +241,6 @@ static int xenfb_setcolreg(unsigned regn
 	return 0;
 }
 
-static void xenfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
-{
-	struct xenfb_info *info = p->par;
-
-	sys_fillrect(p, rect);
-	xenfb_refresh(info, rect->dx, rect->dy, rect->width, rect->height);
-}
-
-static void xenfb_imageblit(struct fb_info *p, const struct fb_image *image)
-{
-	struct xenfb_info *info = p->par;
-
-	sys_imageblit(p, image);
-	xenfb_refresh(info, image->dx, image->dy, image->width, image->height);
-}
-
-static void xenfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
-{
-	struct xenfb_info *info = p->par;
-
-	sys_copyarea(p, area);
-	xenfb_refresh(info, area->dx, area->dy, area->width, area->height);
-}
-
-static ssize_t xenfb_write(struct fb_info *p, const char __user *buf,
-			size_t count, loff_t *ppos)
-{
-	struct xenfb_info *info = p->par;
-	ssize_t res;
-
-	res = fb_sys_write(p, buf, count, ppos);
-	xenfb_refresh(info, 0, 0, info->page->width, info->page->height);
-	return res;
-}
-
 static int
 xenfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
@@ -323,12 +294,12 @@ static int xenfb_set_par(struct fb_info 
 
 static struct fb_ops xenfb_fb_ops = {
 	.owner		= THIS_MODULE,
-	.fb_read	= fb_sys_read,
-	.fb_write	= xenfb_write,
+	.fb_read        = fb_deferred_io_read,
+	.fb_write	= fb_deferred_io_write,
+	.fb_fillrect	= fb_deferred_io_fillrect,
+	.fb_copyarea	= fb_deferred_io_copyarea,
+	.fb_imageblit	= fb_deferred_io_imageblit,
 	.fb_setcolreg	= xenfb_setcolreg,
-	.fb_fillrect	= xenfb_fillrect,
-	.fb_copyarea	= xenfb_copyarea,
-	.fb_imageblit	= xenfb_imageblit,
 	.fb_check_var	= xenfb_check_var,
 	.fb_set_par     = xenfb_set_par,
 };

      parent reply	other threads:[~2008-12-24  8:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-24  8:29 [PATCH 00/05] video: deferred io sys helpers V2 Magnus Damm
2008-12-24  8:29 ` [PATCH 01/05] video: deferred io sys helpers - core V2 Magnus Damm
2008-12-25 19:03   ` Jaya Kumar
2008-12-24  8:30 ` [PATCH 02/05] video: deferred io sys helpers - sh_mobile_lcdcfb V2 Magnus Damm
2008-12-24  8:30 ` [PATCH 03/05] video: deferred io sys helpers - hecuba / n411 V2 Magnus Damm
2008-12-24  8:30 ` [PATCH 04/05] video: deferred io sys helpers - metronome V2 Magnus Damm
2008-12-24  8:30 ` Magnus Damm [this message]

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=20081224083026.1848.92193.sendpatchset@rx1.opensource.se \
    --to=magnus.damm@gmail.com \
    --cc=adaplas@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-sh@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;
as well as URLs for NNTP newsgroup(s).