Re: [PATCH 2.6.20 1/1] fbdev,mm: hecuba/E-Ink fbdev driver

Jaya Kumar
2007-02-21T16:55:20Z

On 2/20/07, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Don't you need a way to specify the maximum deferral time? E.g. a field in
> fb_info.
>

You are right. I will need that. I could put that into struct
fb_deferred_io. So drivers would setup like:

static struct fb_deferred_io hecubafb_defio = {
.delay = HZ,
.deferred_io = hecubafb_dpy_update,
};

where that would be:
struct fb_deferred_io {
unsigned long delay; /* delay between mkwrite and deferred handler */
struct mutex lock; /* mutex that protects the page list */
struct list_head pagelist; /* list of touched pages */
struct delayed_work deferred_work;
void (*deferred_io)(struct fb_info *info, struct list_head
*pagelist); /* callback */
};

and the driver would do:
...
info->fbdefio = hecubafb_defio;
register_framebuffer...

When the driver calls register_framebuffer and unregister_framebuffer,
I can then do the init and destruction of the other members of that
struct. Does this sound okay?

Thanks,
jaya