Skip to content

Commit b63f5e5

Browse files
author
Thomas Zimmermann
committed
fbdev/xen-fbfront: Generate deferred I/O ops
Use the existing generator macros to create deferred-I/O helpers for xen-fbfront and set them in the fb_ops structure. Functions for damage handling on memory ranges and areas are provided by the driver. Xen-fbfront's implementation of fb_write writes to system memory, so the generated code can use the respective helper internally. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Acked-by: Helge Deller <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c623eca commit b63f5e5

File tree

1 file changed

+20
-41
lines changed

1 file changed

+20
-41
lines changed

drivers/video/fbdev/xen-fbfront.c

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -240,41 +240,6 @@ static int xenfb_setcolreg(unsigned regno, unsigned red, unsigned green,
240240
return 0;
241241
}
242242

243-
static void xenfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
244-
{
245-
struct xenfb_info *info = p->par;
246-
247-
sys_fillrect(p, rect);
248-
xenfb_refresh(info, rect->dx, rect->dy, rect->width, rect->height);
249-
}
250-
251-
static void xenfb_imageblit(struct fb_info *p, const struct fb_image *image)
252-
{
253-
struct xenfb_info *info = p->par;
254-
255-
sys_imageblit(p, image);
256-
xenfb_refresh(info, image->dx, image->dy, image->width, image->height);
257-
}
258-
259-
static void xenfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
260-
{
261-
struct xenfb_info *info = p->par;
262-
263-
sys_copyarea(p, area);
264-
xenfb_refresh(info, area->dx, area->dy, area->width, area->height);
265-
}
266-
267-
static ssize_t xenfb_write(struct fb_info *p, const char __user *buf,
268-
size_t count, loff_t *ppos)
269-
{
270-
struct xenfb_info *info = p->par;
271-
ssize_t res;
272-
273-
res = fb_sys_write(p, buf, count, ppos);
274-
xenfb_refresh(info, 0, 0, info->page->width, info->page->height);
275-
return res;
276-
}
277-
278243
static int
279244
xenfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
280245
{
@@ -326,17 +291,31 @@ static int xenfb_set_par(struct fb_info *info)
326291
return 0;
327292
}
328293

294+
static void xenfb_defio_damage_range(struct fb_info *info, off_t off, size_t len)
295+
{
296+
struct xenfb_info *xenfb_info = info->par;
297+
298+
xenfb_refresh(xenfb_info, 0, 0, xenfb_info->page->width, xenfb_info->page->height);
299+
}
300+
301+
static void xenfb_defio_damage_area(struct fb_info *info, u32 x, u32 y,
302+
u32 width, u32 height)
303+
{
304+
struct xenfb_info *xenfb_info = info->par;
305+
306+
xenfb_refresh(xenfb_info, x, y, width, height);
307+
}
308+
309+
FB_GEN_DEFAULT_DEFERRED_SYS_OPS(xenfb,
310+
xenfb_defio_damage_range,
311+
xenfb_defio_damage_area)
312+
329313
static const struct fb_ops xenfb_fb_ops = {
330314
.owner = THIS_MODULE,
331-
.fb_read = fb_sys_read,
332-
.fb_write = xenfb_write,
315+
FB_DEFAULT_DEFERRED_OPS(xenfb),
333316
.fb_setcolreg = xenfb_setcolreg,
334-
.fb_fillrect = xenfb_fillrect,
335-
.fb_copyarea = xenfb_copyarea,
336-
.fb_imageblit = xenfb_imageblit,
337317
.fb_check_var = xenfb_check_var,
338318
.fb_set_par = xenfb_set_par,
339-
.fb_mmap = fb_deferred_io_mmap,
340319
};
341320

342321
static irqreturn_t xenfb_event_handler(int rq, void *dev_id)

0 commit comments

Comments
 (0)