VirtualBox

Ignore:
Timestamp:
Jun 9, 2016 6:24:00 AM (9 years ago)
Author:
vboxsync
Message:

bugref:4567: Linux kernel driver maintenance
drm/vboxvideo: Add delayed update to support fbdev

Due to the virtrual nature of the emulated hardware, the
hardware needs help to know about updates to screen content.
The fb layer provides this with 'deferred IO'.
This patch adds support for this to the vboxvideo DRM driver.

Signed-off-by: Egbert Eich <eich@…>
Signed-off-by: Egbert Eich <eich@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_fb.c

    r61596 r61597  
    6969#include "vbox_drv.h"
    7070
     71#define VBOX_DIRTY_DELAY (HZ / 30)
    7172/**
    7273 * Tell the host about dirty rectangles to update.
     
    161162    vbox_bo_unreserve(bo);
    162163}
     164
     165static void vbox_deferred_io(struct fb_info *info,
     166                             struct list_head *pagelist)
     167{
     168        struct vbox_fbdev *fbdev = info->par;
     169        unsigned long start, end, min, max;
     170        struct page *page;
     171        int y1, y2;
     172
     173        min = ULONG_MAX;
     174        max = 0;
     175        list_for_each_entry(page, pagelist, lru) {
     176                start = page->index << PAGE_SHIFT;
     177                end = start + PAGE_SIZE - 1;
     178                min = min(min, start);
     179                max = max(max, end);
     180        }
     181
     182        if (min < max) {
     183                y1 = min / info->fix.line_length;
     184                y2 = (max / info->fix.line_length) + 1;
     185                printk(KERN_INFO "%s: Calling dirty update: 0, %d, %d, %d\n",
     186                       __func__, y1, info->var.xres, y2 - y1 - 1);
     187                vbox_dirty_update(fbdev, 0, y1, info->var.xres, y2 - y1 - 1);
     188        }
     189}
     190
     191static struct fb_deferred_io vbox_defio =
     192{
     193        .delay          = VBOX_DIRTY_DELAY,
     194        .deferred_io    = vbox_deferred_io,
     195};
    163196
    164197static void vbox_fillrect(struct fb_info *info,
     
    324357    info->screen_size = size;
    325358
     359    info->fbdefio = &vbox_defio;
     360    fb_deferred_io_init(info);
     361
    326362    info->pixmap.flags = FB_PIXMAP_SYSTEM;
    327363
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette