diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index c27e153d8882053e2d28ab72cfc784875752f337..070f26f0bf99905f13ecfc7cdf8e361bc697dbbe 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c @@ -107,6 +107,10 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma, /* protect against the workqueue changing the page list */ mutex_lock(&fbdefio->lock); + /* first write in this cycle, notify the driver */ + if (fbdefio->first_io && list_empty(&fbdefio->pagelist)) + fbdefio->first_io(info); + /* * We want the page to remain locked from ->page_mkwrite until * the PTE is marked dirty to avoid page_mkclean() being called diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index ccbfef5e828f3d19815dc7f91c27164c737f4250..99857857f6fa95098e3fc822d48d23f44dbb0451 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c @@ -1083,7 +1083,7 @@ static int ufx_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); + fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); if (fbdefio) { fbdefio->delay = UFX_DEFIO_WRITE_DELAY; diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index a159b63e18b9d3c14a3a989fa979ce21c425a66b..e9d43b403432b1568245358ce662e082caa7ca85 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -893,7 +893,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); + fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); if (fbdefio) { fbdefio->delay = DL_DEFIO_WRITE_DELAY; diff --git a/include/linux/fb.h b/include/linux/fb.h index d31cb682e17371e0271947d59f2311818316152d..c10e71efb8f55bfb9ab9cc4c6541ee9d89f2b714 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -607,6 +607,7 @@ struct fb_deferred_io { struct mutex lock; /* mutex that protects the page list */ struct list_head pagelist; /* list of touched pages */ /* callback */ + void (*first_io)(struct fb_info *info); void (*deferred_io)(struct fb_info *info, struct list_head *pagelist); }; #endif