Commit e80eec1b authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev: Rename pagelist to pagereflist for deferred I/O

Rename various instances of pagelist to pagereflist. The list now
stores pageref structures, so the new name is more appropriate.

In their write-back helpers, several fbdev drivers refer to the
pageref list in struct fb_deferred_io instead of using the one
supplied as argument to the function. Convert them over to the
supplied one. It's the same instance, so no change of behavior
occurs.

v4:
	* fix commit message (Javier)
Suggested-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-5-tzimmermann@suse.de
parent 3ed38112
...@@ -708,13 +708,12 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, ...@@ -708,13 +708,12 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off,
/** /**
* drm_fb_helper_deferred_io() - fbdev deferred_io callback function * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
* @info: fb_info struct pointer * @info: fb_info struct pointer
* @pagelist: list of mmap framebuffer pages that have to be flushed * @pagereflist: list of mmap framebuffer pages that have to be flushed
* *
* This function is used as the &fb_deferred_io.deferred_io * This function is used as the &fb_deferred_io.deferred_io
* callback function for flushing the fbdev mmap writes. * callback function for flushing the fbdev mmap writes.
*/ */
void drm_fb_helper_deferred_io(struct fb_info *info, void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
unsigned long start, end, min, max; unsigned long start, end, min, max;
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
...@@ -722,7 +721,7 @@ void drm_fb_helper_deferred_io(struct fb_info *info, ...@@ -722,7 +721,7 @@ void drm_fb_helper_deferred_io(struct fb_info *info,
min = ULONG_MAX; min = ULONG_MAX;
max = 0; max = 0;
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
start = pageref->offset; start = pageref->offset;
end = start + PAGE_SIZE; end = start + PAGE_SIZE;
min = min(min, start); min = min(min, start);
......
...@@ -316,8 +316,7 @@ static int vmw_fb_pan_display(struct fb_var_screeninfo *var, ...@@ -316,8 +316,7 @@ static int vmw_fb_pan_display(struct fb_var_screeninfo *var,
return 0; return 0;
} }
static void vmw_deferred_io(struct fb_info *info, static void vmw_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct vmw_fb_par *par = info->par; struct vmw_fb_par *par = info->par;
unsigned long start, end, min, max; unsigned long start, end, min, max;
...@@ -327,7 +326,7 @@ static void vmw_deferred_io(struct fb_info *info, ...@@ -327,7 +326,7 @@ static void vmw_deferred_io(struct fb_info *info,
min = ULONG_MAX; min = ULONG_MAX;
max = 0; max = 0;
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *page = pageref->page; struct page *page = pageref->page;
start = page->index << PAGE_SHIFT; start = page->index << PAGE_SHIFT;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE - 1;
......
...@@ -433,7 +433,7 @@ static const struct fb_ops picolcdfb_ops = { ...@@ -433,7 +433,7 @@ static const struct fb_ops picolcdfb_ops = {
/* Callback from deferred IO workqueue */ /* Callback from deferred IO workqueue */
static void picolcd_fb_deferred_io(struct fb_info *info, struct list_head *pagelist) static void picolcd_fb_deferred_io(struct fb_info *info, struct list_head *pagereflist)
{ {
picolcd_fb_update(info); picolcd_fb_update(info);
} }
......
...@@ -322,7 +322,7 @@ static void fbtft_mkdirty(struct fb_info *info, int y, int height) ...@@ -322,7 +322,7 @@ static void fbtft_mkdirty(struct fb_info *info, int y, int height)
schedule_delayed_work(&info->deferred_work, fbdefio->delay); schedule_delayed_work(&info->deferred_work, fbdefio->delay);
} }
static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagelist) static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagereflist)
{ {
struct fbtft_par *par = info->par; struct fbtft_par *par = info->par;
unsigned int dirty_lines_start, dirty_lines_end; unsigned int dirty_lines_start, dirty_lines_end;
...@@ -340,7 +340,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagelist) ...@@ -340,7 +340,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagelist)
spin_unlock(&par->dirty_lock); spin_unlock(&par->dirty_lock);
/* Mark display lines as dirty */ /* Mark display lines as dirty */
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *page = pageref->page; struct page *page = pageref->page;
count++; count++;
index = page->index << PAGE_SHIFT; index = page->index << PAGE_SHIFT;
...@@ -655,9 +655,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, ...@@ -655,9 +655,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
fbops->fb_blank = fbtft_fb_blank; fbops->fb_blank = fbtft_fb_blank;
fbops->fb_mmap = fb_deferred_io_mmap; fbops->fb_mmap = fb_deferred_io_mmap;
fbdefio->delay = HZ / fps; fbdefio->delay = HZ / fps;
fbdefio->sort_pagelist = true; fbdefio->sort_pagereflist = true;
fbdefio->deferred_io = fbtft_deferred_io; fbdefio->deferred_io = fbtft_deferred_io;
fb_deferred_io_init(info); fb_deferred_io_init(info);
snprintf(info->fix.id, sizeof(info->fix.id), "%s", dev->driver->name); snprintf(info->fix.id, sizeof(info->fix.id), "%s", dev->driver->name);
......
...@@ -929,13 +929,11 @@ static void broadsheetfb_dpy_update(struct broadsheetfb_par *par) ...@@ -929,13 +929,11 @@ static void broadsheetfb_dpy_update(struct broadsheetfb_par *par)
} }
/* this is called back from the deferred io workqueue */ /* this is called back from the deferred io workqueue */
static void broadsheetfb_dpy_deferred_io(struct fb_info *info, static void broadsheetfb_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
u16 y1 = 0, h = 0; u16 y1 = 0, h = 0;
int prev_index = -1; int prev_index = -1;
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
struct fb_deferred_io *fbdefio = info->fbdefio;
int h_inc; int h_inc;
u16 yres = info->var.yres; u16 yres = info->var.yres;
u16 xres = info->var.xres; u16 xres = info->var.xres;
...@@ -944,7 +942,7 @@ static void broadsheetfb_dpy_deferred_io(struct fb_info *info, ...@@ -944,7 +942,7 @@ static void broadsheetfb_dpy_deferred_io(struct fb_info *info,
h_inc = DIV_ROUND_UP(PAGE_SIZE , xres); h_inc = DIV_ROUND_UP(PAGE_SIZE , xres);
/* walk the written page list and swizzle the data */ /* walk the written page list and swizzle the data */
list_for_each_entry(pageref, &fbdefio->pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *cur = pageref->page; struct page *cur = pageref->page;
if (prev_index < 0) { if (prev_index < 0) {
/* just starting so assign first page */ /* just starting so assign first page */
...@@ -1060,9 +1058,9 @@ static const struct fb_ops broadsheetfb_ops = { ...@@ -1060,9 +1058,9 @@ static const struct fb_ops broadsheetfb_ops = {
}; };
static struct fb_deferred_io broadsheetfb_defio = { static struct fb_deferred_io broadsheetfb_defio = {
.delay = HZ/4, .delay = HZ/4,
.sort_pagelist = true, .sort_pagereflist = true,
.deferred_io = broadsheetfb_dpy_deferred_io, .deferred_io = broadsheetfb_dpy_deferred_io,
}; };
static int broadsheetfb_probe(struct platform_device *dev) static int broadsheetfb_probe(struct platform_device *dev)
......
...@@ -41,7 +41,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info ...@@ -41,7 +41,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info
struct page *page) struct page *page)
{ {
struct fb_deferred_io *fbdefio = info->fbdefio; struct fb_deferred_io *fbdefio = info->fbdefio;
struct list_head *pos = &fbdefio->pagelist; struct list_head *pos = &fbdefio->pagereflist;
unsigned long pgoff = offset >> PAGE_SHIFT; unsigned long pgoff = offset >> PAGE_SHIFT;
struct fb_deferred_io_pageref *pageref, *cur; struct fb_deferred_io_pageref *pageref, *cur;
...@@ -63,7 +63,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info ...@@ -63,7 +63,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info
pageref->page = page; pageref->page = page;
pageref->offset = pgoff << PAGE_SHIFT; pageref->offset = pgoff << PAGE_SHIFT;
if (unlikely(fbdefio->sort_pagelist)) { if (unlikely(fbdefio->sort_pagereflist)) {
/* /*
* We loop through the list of pagerefs before adding in * We loop through the list of pagerefs before adding in
* order to keep the pagerefs sorted. This has significant * order to keep the pagerefs sorted. This has significant
...@@ -71,7 +71,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info ...@@ -71,7 +71,7 @@ static struct fb_deferred_io_pageref *fb_deferred_io_pageref_get(struct fb_info
* pages. If possible, drivers should try to work with * pages. If possible, drivers should try to work with
* unsorted page lists instead. * unsorted page lists instead.
*/ */
list_for_each_entry(cur, &info->fbdefio->pagelist, list) { list_for_each_entry(cur, &fbdefio->pagereflist, list) {
if (cur->offset > pageref->offset) if (cur->offset > pageref->offset)
break; break;
} }
...@@ -158,7 +158,7 @@ static vm_fault_t fb_deferred_io_track_page(struct fb_info *info, unsigned long ...@@ -158,7 +158,7 @@ static vm_fault_t fb_deferred_io_track_page(struct fb_info *info, unsigned long
mutex_lock(&fbdefio->lock); mutex_lock(&fbdefio->lock);
/* first write in this cycle, notify the driver */ /* first write in this cycle, notify the driver */
if (fbdefio->first_io && list_empty(&fbdefio->pagelist)) if (fbdefio->first_io && list_empty(&fbdefio->pagereflist))
fbdefio->first_io(info); fbdefio->first_io(info);
pageref = fb_deferred_io_pageref_get(info, offset, page); pageref = fb_deferred_io_pageref_get(info, offset, page);
...@@ -249,18 +249,18 @@ static void fb_deferred_io_work(struct work_struct *work) ...@@ -249,18 +249,18 @@ static void fb_deferred_io_work(struct work_struct *work)
/* here we mkclean the pages, then do all deferred IO */ /* here we mkclean the pages, then do all deferred IO */
mutex_lock(&fbdefio->lock); mutex_lock(&fbdefio->lock);
list_for_each_entry(pageref, &fbdefio->pagelist, list) { list_for_each_entry(pageref, &fbdefio->pagereflist, list) {
struct page *cur = pageref->page; struct page *cur = pageref->page;
lock_page(cur); lock_page(cur);
page_mkclean(cur); page_mkclean(cur);
unlock_page(cur); unlock_page(cur);
} }
/* driver's callback with pagelist */ /* driver's callback with pagereflist */
fbdefio->deferred_io(info, &fbdefio->pagelist); fbdefio->deferred_io(info, &fbdefio->pagereflist);
/* clear the list */ /* clear the list */
list_for_each_entry_safe(pageref, next, &fbdefio->pagelist, list) list_for_each_entry_safe(pageref, next, &fbdefio->pagereflist, list)
fb_deferred_io_pageref_put(pageref, info); fb_deferred_io_pageref_put(pageref, info);
mutex_unlock(&fbdefio->lock); mutex_unlock(&fbdefio->lock);
...@@ -280,7 +280,7 @@ int fb_deferred_io_init(struct fb_info *info) ...@@ -280,7 +280,7 @@ int fb_deferred_io_init(struct fb_info *info)
mutex_init(&fbdefio->lock); mutex_init(&fbdefio->lock);
INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work); INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work);
INIT_LIST_HEAD(&fbdefio->pagelist); INIT_LIST_HEAD(&fbdefio->pagereflist);
if (fbdefio->delay == 0) /* set a default of 1 s */ if (fbdefio->delay == 0) /* set a default of 1 s */
fbdefio->delay = HZ; fbdefio->delay = HZ;
......
...@@ -115,8 +115,7 @@ static void hecubafb_dpy_update(struct hecubafb_par *par) ...@@ -115,8 +115,7 @@ static void hecubafb_dpy_update(struct hecubafb_par *par)
} }
/* this is called back from the deferred io workqueue */ /* this is called back from the deferred io workqueue */
static void hecubafb_dpy_deferred_io(struct fb_info *info, static void hecubafb_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
hecubafb_dpy_update(info->par); hecubafb_dpy_update(info->par);
} }
......
...@@ -420,8 +420,7 @@ static void hvfb_docopy(struct hvfb_par *par, ...@@ -420,8 +420,7 @@ static void hvfb_docopy(struct hvfb_par *par,
} }
/* Deferred IO callback */ /* Deferred IO callback */
static void synthvid_deferred_io(struct fb_info *p, static void synthvid_deferred_io(struct fb_info *p, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct hvfb_par *par = p->par; struct hvfb_par *par = p->par;
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
...@@ -437,7 +436,7 @@ static void synthvid_deferred_io(struct fb_info *p, ...@@ -437,7 +436,7 @@ static void synthvid_deferred_io(struct fb_info *p,
* in synthvid_update function by clamping the y2 * in synthvid_update function by clamping the y2
* value to yres. * value to yres.
*/ */
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *page = pageref->page; struct page *page = pageref->page;
start = page->index << PAGE_SHIFT; start = page->index << PAGE_SHIFT;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE - 1;
......
...@@ -465,16 +465,14 @@ static u16 metronomefb_dpy_update_page(struct metronomefb_par *par, int index) ...@@ -465,16 +465,14 @@ static u16 metronomefb_dpy_update_page(struct metronomefb_par *par, int index)
} }
/* this is called back from the deferred io workqueue */ /* this is called back from the deferred io workqueue */
static void metronomefb_dpy_deferred_io(struct fb_info *info, static void metronomefb_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
u16 cksum; u16 cksum;
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
struct fb_deferred_io *fbdefio = info->fbdefio;
struct metronomefb_par *par = info->par; struct metronomefb_par *par = info->par;
/* walk the written page list and swizzle the data */ /* walk the written page list and swizzle the data */
list_for_each_entry(pageref, &fbdefio->pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *cur = pageref->page; struct page *cur = pageref->page;
cksum = metronomefb_dpy_update_page(par, cksum = metronomefb_dpy_update_page(par,
(cur->index << PAGE_SHIFT)); (cur->index << PAGE_SHIFT));
...@@ -569,9 +567,9 @@ static const struct fb_ops metronomefb_ops = { ...@@ -569,9 +567,9 @@ static const struct fb_ops metronomefb_ops = {
}; };
static struct fb_deferred_io metronomefb_defio = { static struct fb_deferred_io metronomefb_defio = {
.delay = HZ, .delay = HZ,
.sort_pagelist = true, .sort_pagereflist = true,
.deferred_io = metronomefb_dpy_deferred_io, .deferred_io = metronomefb_dpy_deferred_io,
}; };
static int metronomefb_probe(struct platform_device *dev) static int metronomefb_probe(struct platform_device *dev)
......
...@@ -435,8 +435,7 @@ static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = { ...@@ -435,8 +435,7 @@ static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
.read_data = lcdc_sys_read_data, .read_data = lcdc_sys_read_data,
}; };
static int sh_mobile_lcdc_sginit(struct fb_info *info, static int sh_mobile_lcdc_sginit(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct sh_mobile_lcdc_chan *ch = info->par; struct sh_mobile_lcdc_chan *ch = info->par;
unsigned int nr_pages_max = ch->fb_size >> PAGE_SHIFT; unsigned int nr_pages_max = ch->fb_size >> PAGE_SHIFT;
...@@ -445,7 +444,7 @@ static int sh_mobile_lcdc_sginit(struct fb_info *info, ...@@ -445,7 +444,7 @@ static int sh_mobile_lcdc_sginit(struct fb_info *info,
sg_init_table(ch->sglist, nr_pages_max); sg_init_table(ch->sglist, nr_pages_max);
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *page = pageref->page; struct page *page = pageref->page;
sg_set_page(&ch->sglist[nr_pages++], page, PAGE_SIZE, 0); sg_set_page(&ch->sglist[nr_pages++], page, PAGE_SIZE, 0);
} }
...@@ -453,8 +452,7 @@ static int sh_mobile_lcdc_sginit(struct fb_info *info, ...@@ -453,8 +452,7 @@ static int sh_mobile_lcdc_sginit(struct fb_info *info,
return nr_pages; return nr_pages;
} }
static void sh_mobile_lcdc_deferred_io(struct fb_info *info, static void sh_mobile_lcdc_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct sh_mobile_lcdc_chan *ch = info->par; struct sh_mobile_lcdc_chan *ch = info->par;
const struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg->panel_cfg; const struct sh_mobile_lcdc_panel_cfg *panel = &ch->cfg->panel_cfg;
...@@ -463,7 +461,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, ...@@ -463,7 +461,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
sh_mobile_lcdc_clk_on(ch->lcdc); sh_mobile_lcdc_clk_on(ch->lcdc);
/* /*
* It's possible to get here without anything on the pagelist via * It's possible to get here without anything on the pagereflist via
* sh_mobile_lcdc_deferred_io_touch() or via a userspace fsync() * sh_mobile_lcdc_deferred_io_touch() or via a userspace fsync()
* invocation. In the former case, the acceleration routines are * invocation. In the former case, the acceleration routines are
* stepped in to when using the framebuffer console causing the * stepped in to when using the framebuffer console causing the
...@@ -473,12 +471,12 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, ...@@ -473,12 +471,12 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
* acceleration routines have their own methods for writing in * acceleration routines have their own methods for writing in
* that still need to be updated. * that still need to be updated.
* *
* The fsync() and empty pagelist case could be optimized for, * The fsync() and empty pagereflist case could be optimized for,
* but we don't bother, as any application exhibiting such * but we don't bother, as any application exhibiting such
* behaviour is fundamentally broken anyways. * behaviour is fundamentally broken anyways.
*/ */
if (!list_empty(pagelist)) { if (!list_empty(pagereflist)) {
unsigned int nr_pages = sh_mobile_lcdc_sginit(info, pagelist); unsigned int nr_pages = sh_mobile_lcdc_sginit(info, pagereflist);
/* trigger panel update */ /* trigger panel update */
dma_map_sg(ch->lcdc->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); dma_map_sg(ch->lcdc->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
......
...@@ -955,12 +955,10 @@ static void ufx_ops_fillrect(struct fb_info *info, ...@@ -955,12 +955,10 @@ static void ufx_ops_fillrect(struct fb_info *info,
* Touching ANY framebuffer memory that triggers a page fault * Touching ANY framebuffer memory that triggers a page fault
* in fb_defio will cause a deadlock, when it also tries to * in fb_defio will cause a deadlock, when it also tries to
* grab the same mutex. */ * grab the same mutex. */
static void ufx_dpy_deferred_io(struct fb_info *info, static void ufx_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct fb_deferred_io_pageref *pageref;
struct fb_deferred_io *fbdefio = info->fbdefio;
struct ufx_data *dev = info->par; struct ufx_data *dev = info->par;
struct fb_deferred_io_pageref *pageref;
if (!fb_defio) if (!fb_defio)
return; return;
...@@ -969,7 +967,7 @@ static void ufx_dpy_deferred_io(struct fb_info *info, ...@@ -969,7 +967,7 @@ static void ufx_dpy_deferred_io(struct fb_info *info,
return; return;
/* walk the written page list and render each to device */ /* walk the written page list and render each to device */
list_for_each_entry(pageref, &fbdefio->pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
/* create a rectangle of full screen width that encloses the /* create a rectangle of full screen width that encloses the
* entire dirty framebuffer page */ * entire dirty framebuffer page */
struct page *cur = pageref->page; struct page *cur = pageref->page;
......
...@@ -371,8 +371,7 @@ static const struct fb_ops ssd1307fb_ops = { ...@@ -371,8 +371,7 @@ static const struct fb_ops ssd1307fb_ops = {
.fb_mmap = fb_deferred_io_mmap, .fb_mmap = fb_deferred_io_mmap,
}; };
static void ssd1307fb_deferred_io(struct fb_info *info, static void ssd1307fb_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
ssd1307fb_update_display(info->par); ssd1307fb_update_display(info->par);
} }
......
...@@ -781,11 +781,9 @@ static void dlfb_ops_fillrect(struct fb_info *info, ...@@ -781,11 +781,9 @@ static void dlfb_ops_fillrect(struct fb_info *info,
* in fb_defio will cause a deadlock, when it also tries to * in fb_defio will cause a deadlock, when it also tries to
* grab the same mutex. * grab the same mutex.
*/ */
static void dlfb_dpy_deferred_io(struct fb_info *info, static void dlfb_dpy_deferred_io(struct fb_info *info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
struct fb_deferred_io *fbdefio = info->fbdefio;
struct dlfb_data *dlfb = info->par; struct dlfb_data *dlfb = info->par;
struct urb *urb; struct urb *urb;
char *cmd; char *cmd;
...@@ -811,7 +809,7 @@ static void dlfb_dpy_deferred_io(struct fb_info *info, ...@@ -811,7 +809,7 @@ static void dlfb_dpy_deferred_io(struct fb_info *info,
cmd = urb->transfer_buffer; cmd = urb->transfer_buffer;
/* walk the written page list and render each to device */ /* walk the written page list and render each to device */
list_for_each_entry(pageref, &fbdefio->pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *cur = pageref->page; struct page *cur = pageref->page;
if (dlfb_render_hline(dlfb, &urb, (char *) info->fix.smem_start, if (dlfb_render_hline(dlfb, &urb, (char *) info->fix.smem_start,
...@@ -984,7 +982,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) ...@@ -984,7 +982,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
if (fbdefio) { if (fbdefio) {
fbdefio->delay = DL_DEFIO_WRITE_DELAY; fbdefio->delay = DL_DEFIO_WRITE_DELAY;
fbdefio->sort_pagelist = true; fbdefio->sort_pagereflist = true;
fbdefio->deferred_io = dlfb_dpy_deferred_io; fbdefio->deferred_io = dlfb_dpy_deferred_io;
} }
......
...@@ -181,8 +181,7 @@ static void xenfb_refresh(struct xenfb_info *info, ...@@ -181,8 +181,7 @@ static void xenfb_refresh(struct xenfb_info *info,
xenfb_do_update(info, x1, y1, x2 - x1 + 1, y2 - y1 + 1); xenfb_do_update(info, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
} }
static void xenfb_deferred_io(struct fb_info *fb_info, static void xenfb_deferred_io(struct fb_info *fb_info, struct list_head *pagereflist)
struct list_head *pagelist)
{ {
struct xenfb_info *info = fb_info->par; struct xenfb_info *info = fb_info->par;
struct fb_deferred_io_pageref *pageref; struct fb_deferred_io_pageref *pageref;
...@@ -191,7 +190,7 @@ static void xenfb_deferred_io(struct fb_info *fb_info, ...@@ -191,7 +190,7 @@ static void xenfb_deferred_io(struct fb_info *fb_info,
miny = INT_MAX; miny = INT_MAX;
maxy = 0; maxy = 0;
list_for_each_entry(pageref, pagelist, list) { list_for_each_entry(pageref, pagereflist, list) {
struct page *page = pageref->page; struct page *page = pageref->page;
beg = page->index << PAGE_SHIFT; beg = page->index << PAGE_SHIFT;
end = beg + PAGE_SIZE - 1; end = beg + PAGE_SIZE - 1;
......
...@@ -229,8 +229,7 @@ void drm_fb_helper_fill_info(struct fb_info *info, ...@@ -229,8 +229,7 @@ void drm_fb_helper_fill_info(struct fb_info *info,
struct drm_fb_helper *fb_helper, struct drm_fb_helper *fb_helper,
struct drm_fb_helper_surface_size *sizes); struct drm_fb_helper_surface_size *sizes);
void drm_fb_helper_deferred_io(struct fb_info *info, void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
struct list_head *pagelist);
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
size_t count, loff_t *ppos); size_t count, loff_t *ppos);
......
...@@ -211,9 +211,9 @@ struct fb_deferred_io_pageref { ...@@ -211,9 +211,9 @@ struct fb_deferred_io_pageref {
struct fb_deferred_io { struct fb_deferred_io {
/* delay between mkwrite and deferred handler */ /* delay between mkwrite and deferred handler */
unsigned long delay; unsigned long delay;
bool sort_pagelist; /* sort pagelist by offset */ bool sort_pagereflist; /* sort pagelist by offset */
struct mutex lock; /* mutex that protects the page list */ struct mutex lock; /* mutex that protects the pageref list */
struct list_head pagelist; /* list of touched pages */ struct list_head pagereflist; /* list of pagerefs for touched pages */
/* callback */ /* callback */
void (*first_io)(struct fb_info *info); void (*first_io)(struct fb_info *info);
void (*deferred_io)(struct fb_info *info, struct list_head *pagelist); void (*deferred_io)(struct fb_info *info, struct list_head *pagelist);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment