VirtualBox

Ignore:
Timestamp:
Aug 16, 2016 1:02:19 PM (8 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: the modesetting driver with X.Org Server prior to version 1.18.4 had a bug which caused it do disable dirty updates if it submitted more rectangles at once than the kernel wished to handle. Work around that by hiding the EINVAL error code that it looks for. Time-limited to pre-4.7 kernels, which should be enough.

File:
1 edited

Legend:

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

    r62557 r63551  
    195195};
    196196
     197#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
     198/* This works around a bug in X servers prior to 1.18.4, which sometimes
     199 * submit more dirty rectangles than the kernel is willing to handle and
     200 * then disable dirty rectangle handling altogether when they see the
     201 * EINVAL error.  I do not want the code to hang around forever, which is
     202 * why I am limiting it to certain kernel versions.  We can increase the
     203 * limit if some distributions uses old X servers with new kernels. */
     204long vbox_ioctl(struct file *filp,
     205                unsigned int cmd, unsigned long arg)
     206{
     207    long rc = drm_ioctl(filp, cmd, arg);
     208    if (cmd == DRM_IOCTL_MODE_DIRTYFB && rc == -EINVAL)
     209        return -EOVERFLOW;
     210    return rc;
     211}
     212#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) */
     213
    197214static const struct file_operations vbox_fops =
    198215{
     
    200217    .open = drm_open,
    201218    .release = drm_release,
     219#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
     220    .unlocked_ioctl = vbox_ioctl,
     221#else
    202222    .unlocked_ioctl = drm_ioctl,
     223#endif
    203224    .mmap = vbox_mmap,
    204225    .poll = drm_poll,
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