From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:52:33
video: deferred io sys helpers
[PATCH 01/05] video: deferred io sys helpers - core
[PATCH 02/05] video: deferred io sys helpers - sh_mobile_lcdcfb
[PATCH 03/05] video: deferred io sys helpers - hecuba / n411
[PATCH 04/05] video: deferred io sys helpers - metronome
[PATCH 05/05] video: deferred io sys helpers - xen
This patchset extends the deferred io core code with commonly used functions.
The following functions are added to and exported from fb_defio.c:
- fb_deferred_io_read()
- fb_deferred_io_write()
- fb_deferred_io_fillrect()
- fb_deferred_io_copyarea()
- fb_deferred_io_imageblit()
To be backwards compatible with the existing behavior the delay variable
"sysdelay" is introduced. It is a separate timeout value for the functions
above. In the sh_mobile_lcdcfb driver we set it to the same as "delay",
but the other drivers keep it as zero which means flush directly.
The deferred io core code now keeps track of a dirty area between the
calls to the functions above. Only xen is currently making use of this.
In the future we may want to extend the dirty area tracking code to
instead modify the dirty bits for the pages backing the frame buffer.
Status:
- sh_mobile_lcdcfb: compiles and works well
- hecuba / n411: compiles on superh, but untested
- metronome: compiles on superh, but untested
- xen: unknown
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 33 +++---------
drivers/video/fb_defio.c | 71 ++++++++++++++++++++++++++
drivers/video/hecubafb.c | 86 +-------------------------------
drivers/video/metronomefb.c | 102 ++++++--------------------------------
drivers/video/sh_mobile_lcdcfb.c | 40 ++------------
drivers/video/xen-fbfront.c | 52 ++++---------------
include/linux/fb.h | 14 +++++
7 files changed, 135 insertions(+), 263 deletions(-)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:52:41
From: Magnus Damm <redacted>
Add shared sys helpers to the deferred io code. Instead of duplicating
the code in each driver we can keep it in one place. This saves a
few lines. This patch also adds "sysdelay" which allows the driver to
select timeout for sys helper functions. While at it, keep track of
the dirty area to allow partial screen update.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 4 ++
drivers/video/fb_defio.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++
include/linux/fb.h | 14 +++++++++
3 files changed, 89 insertions(+)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:52:52
From: Magnus Damm <redacted>
Change the sh_mobile_lcdcfb driver to use the new shared sys helpers.
This allows us to remove some code. Also, "sysdelay" is set to the same
value as "delay" to keep same behavior as before.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 4 ---
drivers/video/sh_mobile_lcdcfb.c | 40 +++++---------------------------------
2 files changed, 6 insertions(+), 38 deletions(-)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:53:01
From: Magnus Damm <redacted>
Change the hecubafb driver and the n411 code to use the new shared sys
helpers. This allows us to remove some duplicated code. In the future
this driver can setup the "sysdelay" value to delay flushing.
While at it, convert space to tabs for the n411 kconfig entry.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 17 +++------
drivers/video/hecubafb.c | 86 ++--------------------------------------------
2 files changed, 11 insertions(+), 92 deletions(-)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:53:09
From: Magnus Damm <redacted>
Change the metronome driver to use the new shared sys helpers.
In the future this driver can setup the "sysdelay" value to
delay flushing.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 4 -
drivers/video/metronomefb.c | 102 +++++++------------------------------------
2 files changed, 17 insertions(+), 89 deletions(-)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2008-12-22 05:53:17
From: Magnus Damm <redacted>
Change the xen driver to use the new shared sys helpers. This allows
us to remove some duplicated code. In the future this driver can
setup the "sysdelay" value to delay flushing.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 4 ---
drivers/video/xen-fbfront.c | 52 +++++++++----------------------------------
2 files changed, 12 insertions(+), 44 deletions(-)
From: Paul Mundt <hidden> Date: 2008-12-22 05:58:01
On Mon, Dec 22, 2008 at 02:53:01PM +0900, Magnus Damm wrote:
quoted hunk
From: Magnus Damm <redacted>
Change the hecubafb driver and the n411 code to use the new shared sys
helpers. This allows us to remove some duplicated code. In the future
this driver can setup the "sysdelay" value to delay flushing.
While at it, convert space to tabs for the n411 kconfig entry.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 17 +++------
drivers/video/hecubafb.c | 86 ++--------------------------------------------
2 files changed, 11 insertions(+), 92 deletions(-)
On Mon, Dec 22, 2008 at 2:58 PM, Paul Mundt [off-list ref] wrote:
On Mon, Dec 22, 2008 at 02:53:01PM +0900, Magnus Damm wrote:
quoted
From: Magnus Damm <redacted>
Change the hecubafb driver and the n411 code to use the new shared sys
helpers. This allows us to remove some duplicated code. In the future
this driver can setup the "sysdelay" value to delay flushing.
While at it, convert space to tabs for the n411 kconfig entry.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 17 +++------
drivers/video/hecubafb.c | 86 ++--------------------------------------------
2 files changed, 11 insertions(+), 92 deletions(-)
On Mon, Dec 22, 2008 at 12:53 AM, Magnus Damm [off-list ref] wrote:
quoted hunk
From: Magnus Damm <redacted>
Change the metronome driver to use the new shared sys helpers.
In the future this driver can setup the "sysdelay" value to
delay flushing.
Signed-off-by: Magnus Damm <redacted>
---
drivers/video/Kconfig | 4 -
drivers/video/metronomefb.c | 102 +++++++------------------------------------
2 files changed, 17 insertions(+), 89 deletions(-)
Okay, overall seems okay. But I'm not confident about this specific
change above. The meaning of dx, etc is not clear to me. Okay, I think
I found a problem with above. Here's my explanation, please correct me
if I'm wrong in my reading of the code you've posted. The typical use
case is just a single mmap client (eg: Xfbdev) and nothing else. No
fbcon. The only code path I see that sets defio->dx is in the
write/blit/* paths via the defio_touch in patch 1/5 and none in the
mmap path so with this implementation, all mmap clients would
repeatedly only hit the above full update scenario and never use the
page based update mechanism.
On Wed, Dec 24, 2008 at 1:58 PM, Jaya Kumar [off-list ref] wrote:
On Mon, Dec 22, 2008 at 12:53 AM, Magnus Damm [off-list ref] wrote:
quoted
+ if (fbdefio->dx != -1) {
+ /* update the entire screen */
+ metronomefb_dpy_update(par);
Okay, overall seems okay. But I'm not confident about this specific
change above. The meaning of dx, etc is not clear to me. Okay, I think
I found a problem with above. Here's my explanation, please correct me
if I'm wrong in my reading of the code you've posted. The typical use
case is just a single mmap client (eg: Xfbdev) and nothing else. No
fbcon. The only code path I see that sets defio->dx is in the
write/blit/* paths via the defio_touch in patch 1/5 and none in the
mmap path so with this implementation, all mmap clients would
repeatedly only hit the above full update scenario and never use the
page based update mechanism.
Hm, I wonder if I reversed the logic by mistake, but I don't think so.
The idea is that dx should be set to -1 by default and stay that way
unless write/blit/* has been used. After each deferred io work dx is
reset to -1. If dx is not -1 in the deferred io callback then we need
to refresh the area specified by dx, dy, width, height _and_ the
pages. The xen driver does this.
In the metronome driver case we update the entire screen if dx has
been set which means we can skip the pages since they are considered
part of the entire screen. This should be the same behavior as before,
the local write/bit/* functions all call metronome_dpy_update()
without this patch.
Or maybe my logic is broken?
Btw, patch [1/5] is somewhat broken today with the handling of
sysdelay vs delay. Ideally I'd like to get rid of sysdelay and let
write/blit/* use the same delay as mmap(). Not sure if you are keen on
that though since it changes the behavior of your drivers. Otoh that
may make fbcon usable on e-paper since it decouples the soft cursor
refresh rate from the screen refresh rate.
Other than the above problem, looks okay and its nice to get rid of
all that stuff above. :-)
On Wed, Dec 24, 2008 at 12:46 AM, Magnus Damm [off-list ref] wrote:
Btw, patch [1/5] is somewhat broken today with the handling of
sysdelay vs delay. Ideally I'd like to get rid of sysdelay and let
write/blit/* use the same delay as mmap(). Not sure if you are keen on
that though since it changes the behavior of your drivers. Otoh that
may make fbcon usable on e-paper since it decouples the soft cursor
refresh rate from the screen refresh rate.
You're right that that would make fbcon be better. I don't think there
are too many users currently so now would be a good time to change. So
yes, I agree with changing the current behavior and droping the
sysdelay stuff.
Thanks,
jaya