diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-07-04 14:02:00 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2015-07-06 17:19:20 +0200 |
commit | 66e7f16c149e0f531924b40037e042e222110a86 (patch) | |
tree | c04f967c2f4e8b764826f50e18259f824870038d | |
parent | 4fe73acfb7aec35981b1782be4ce0028da109246 (diff) |
fbdev defio init cleanup
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | gm12u320_fb.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/gm12u320_fb.c b/gm12u320_fb.c index dd862d2..5093f0b 100644 --- a/gm12u320_fb.c +++ b/gm12u320_fb.c @@ -26,17 +26,9 @@ struct gm12u320_fbdev { struct drm_fb_helper helper; struct gm12u320_framebuffer fb; - struct fb_deferred_io defio; struct list_head fbdev_list; }; -static void gm12u320_defio_cb(struct fb_info *info, struct list_head *pl) -{ - struct gm12u320_fbdev *fbdev = info->par; - - gm12u320_update_frame(&fbdev->fb); -} - static int gm12u320_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { unsigned long start = vma->vm_start; @@ -86,7 +78,7 @@ static int gm12u320_fb_release(struct fb_info *info, int user) return 0; } -static struct fb_ops gm12u320fb_ops = { +static struct fb_ops gm12u320_fb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, @@ -103,6 +95,18 @@ static struct fb_ops gm12u320fb_ops = { .fb_release = gm12u320_fb_release, }; +static void gm12u320_fb_defio_cb(struct fb_info *info, struct list_head *pl) +{ + struct gm12u320_fbdev *fbdev = info->par; + + gm12u320_update_frame(&fbdev->fb); +} + +static struct fb_deferred_io gm12u320_fb_defio = { + .delay = HZ / 50, + .deferred_io = gm12u320_fb_defio_cb, +}; + static int gm12u320_user_framebuffer_dirty(struct drm_framebuffer *drm_fb, struct drm_file *file, unsigned flags, unsigned color, @@ -227,12 +231,10 @@ static int gm12u320fb_create(struct drm_fb_helper *helper, info->fix.smem_start = (unsigned long)fbdev->fb.obj->vmapping; info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT; - info->fbops = &gm12u320fb_ops; - info->fbdefio = &fbdev->defio; + info->fbops = &gm12u320_fb_ops; + info->fbdefio = &gm12u320_fb_defio; drm_fb_helper_fill_fix(info, drm_fb->pitches[0], drm_fb->depth); drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width, sizes->fb_height); - fbdev->defio.delay = msecs_to_jiffies(20); - fbdev->defio.deferred_io = gm12u320_defio_cb; fb_deferred_io_init(info); ret = fb_alloc_cmap(&info->cmap, 256, 0); |