VirtualBox

Changeset 60285 in vbox


Ignore:
Timestamp:
Apr 1, 2016 10:27:17 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106328
Message:

bugref:8087: Additions/x11: support non-root X server: revert r106327: committed too much.

Location:
trunk/src/VBox/Additions/linux
Files:
4 edited

Legend:

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

    r60284 r60285  
    193193};
    194194
    195 static long vbox_ioctl(struct file *filp, unsigned int cmd,
    196                                 unsigned long arg)
    197 {
    198     struct drm_file *file_priv = filp->private_data;
    199     struct vbox_private *vbox = file_priv->minor->dev->dev_private;
    200 
    201 #ifdef DRM_IOCTL_MODE_CURSOR2
    202     if ((cmd == DRM_IOCTL_MODE_CURSOR) && vbox != NULL)
    203         vbox->have_cursor_hotspot = false;
    204     if ((cmd == DRM_IOCTL_MODE_CURSOR2) && vbox != NULL)
    205         vbox->have_cursor_hotspot = true;
    206 #endif
    207     return drm_ioctl(filp, cmd, arg);
    208 }
    209195
    210196static const struct file_operations vbox_fops =
     
    213199    .open = drm_open,
    214200    .release = drm_release,
    215     .unlocked_ioctl = vbox_ioctl,
     201    .unlocked_ioctl = drm_ioctl,
    216202    .mmap = vbox_mmap,
    217203    .poll = drm_poll,
  • trunk/src/VBox/Additions/linux/drm/vbox_drv.h

    r60284 r60285  
    8585#define VBOX_MAX_CURSOR_WIDTH  64
    8686#define VBOX_MAX_CURSOR_HEIGHT 64
    87 #define CURSOR_PIXEL_COUNT VBOX_MAX_CURSOR_WIDTH * VBOX_MAX_CURSOR_HEIGHT
    88 #define CURSOR_DATA_SIZE CURSOR_PIXEL_COUNT * 4 + CURSOR_PIXEL_COUNT / 8
    8987
    9088struct vbox_fbdev;
     
    125123    bool fbdev_init;
    126124    struct work_struct hotplug_work;
    127     bool have_cursor_hotspot;
    128     uint32_t cursor_width;
    129     uint32_t cursor_height;
    130     size_t cursor_data_size;
    131     uint8_t cursor_data[CURSOR_DATA_SIZE];
    132 };
    133 
    134 #undef CURSOR_PIXEL_COUNT
    135 #undef CURSOR_DATA_SIZE
     125};
    136126
    137127int vbox_driver_load(struct drm_device *dev, unsigned long flags);
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r60284 r60285  
    678678            mask_size  = ((width + 7) / 8 * height + 3) & ~3;
    679679            data_size = width * height * 4 + mask_size;
    680             vbox->cursor_width = width;
    681             vbox->cursor_height = height;
    682             vbox->cursor_data_size = data_size;
    683             dst = vbox->cursor_data;
    684             ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &uobj_map);
    685             if (!ret)
     680            dst = kmalloc(data_size, GFP_KERNEL);
     681            if (dst)
    686682            {
    687                 src = ttm_kmap_obj_virtual(&uobj_map, &src_isiomem);
    688                 if (!src_isiomem)
     683                ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &uobj_map);
     684                if (!ret)
    689685                {
    690                     uint32_t flags =   VBOX_MOUSE_POINTER_VISIBLE
    691                                       | VBOX_MOUSE_POINTER_SHAPE
    692                                       | VBOX_MOUSE_POINTER_ALPHA;
    693                     copy_cursor_image(src, dst, width, height, mask_size);
    694                     rc = VBoxHGSMIUpdatePointerShape(&vbox->submit_info, flags,
    695                                                      hot_x, hot_y, width,
    696                                                      height, dst, data_size);
    697                     ret = -RTErrConvertToErrno(rc);
     686                    src = ttm_kmap_obj_virtual(&uobj_map, &src_isiomem);
     687                    if (!src_isiomem)
     688                    {
     689                        uint32_t flags =   VBOX_MOUSE_POINTER_VISIBLE
     690                                          | VBOX_MOUSE_POINTER_SHAPE
     691                                          | VBOX_MOUSE_POINTER_ALPHA;
     692                        copy_cursor_image(src, dst, width, height, mask_size);
     693                        rc = VBoxHGSMIUpdatePointerShape(&vbox->submit_info, flags,
     694                                                         hot_x, hot_y, width,
     695                                                         height, dst, data_size);
     696                        ret = -RTErrConvertToErrno(rc);
     697                    }
     698                    else
     699                        DRM_ERROR("src cursor bo should be in main memory\n");
     700                    ttm_bo_kunmap(&uobj_map);
    698701                }
    699                 else
    700                     DRM_ERROR("src cursor bo should be in main memory\n");
    701                 ttm_bo_kunmap(&uobj_map);
     702                kfree(dst);
    702703            }
    703             else
    704                 vbox->cursor_data_size = 0;
    705704            vbox_bo_unreserve(bo);
    706705        }
     
    719718{
    720719    struct vbox_private *vbox = crtc->dev->dev_private;
    721     uint32_t flags =   VBOX_MOUSE_POINTER_VISIBLE
    722                       | VBOX_MOUSE_POINTER_SHAPE
    723                       | VBOX_MOUSE_POINTER_ALPHA;
    724     uint32_t host_x, host_y;
    725     uint32_t hot_x = 0;
    726     uint32_t hot_y = 0;
    727     int rc;
    728720
    729721    VBoxHGSMICursorPosition(&vbox->submit_info, true, x + crtc->x,
    730                             y + crtc->y, &host_x, &host_y);
    731     if (!vbox->have_cursor_hotspot && vbox->cursor_data_size != 0) {
    732         if (x + crtc->x > host_x)
    733             hot_x = min(x + crtc->x - host_x, vbox->cursor_width);
    734         if (y + crtc->y > host_y)
    735             hot_y = min(y + crtc->y - host_y, vbox->cursor_height);
    736         rc = VBoxHGSMIUpdatePointerShape(&vbox->submit_info, flags,
    737                                          hot_x < 64 ? hot_x : 64,
    738                                          hot_y < 64 ? hot_y : 64,
    739                                          vbox->cursor_width,
    740                                          vbox->cursor_height,
    741                                          vbox->cursor_data,
    742                                          vbox->cursor_data_size);
    743         return -RTErrConvertToErrno(rc);
    744     }
     722                            y + crtc->y, NULL, NULL);
    745723    return 0;
    746724}
  • trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh

    r60284 r60285  
    368368                vboxvideo_src=""
    369369            }
     370            # Do not install if we can use the kernel driver.
     371            case `uname -r` in
     372                1.* | 2.* | 3.[0-9].* | 3.10.* ) ;;
     373                * ) vboxvideo_src="" ;;
     374            esac
    370375            ;;
    371376        * )
    372377            # For anything else, assume kernel drivers.
    373378            dox11config=""
     379            $MODPROBE vboxvideo ||
     380                echo "Warning: failed to set up the X Window System display integration."
    374381            ;;
    375382    esac
    376     if $MODPROBE vboxvideo; then
    377         # Do not install if we can use the kernel driver.
    378         rm -f "$modules_dir/drivers/vboxvideo_drv.so"
    379         vboxvideo_src=""
    380         dox11config=""
    381     fi
    382383    test -n "${dox11config}" &&
    383384        begin "Installing $xserver_version modules"
Note: See TracChangeset for help on using the changeset viewer.

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