Changeset 60285 in vbox
- Timestamp:
- Apr 1, 2016 10:27:17 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106328
- Location:
- trunk/src/VBox/Additions/linux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r60284 r60285 193 193 }; 194 194 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_CURSOR2202 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 #endif207 return drm_ioctl(filp, cmd, arg);208 }209 195 210 196 static const struct file_operations vbox_fops = … … 213 199 .open = drm_open, 214 200 .release = drm_release, 215 .unlocked_ioctl = vbox_ioctl,201 .unlocked_ioctl = drm_ioctl, 216 202 .mmap = vbox_mmap, 217 203 .poll = drm_poll, -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r60284 r60285 85 85 #define VBOX_MAX_CURSOR_WIDTH 64 86 86 #define VBOX_MAX_CURSOR_HEIGHT 64 87 #define CURSOR_PIXEL_COUNT VBOX_MAX_CURSOR_WIDTH * VBOX_MAX_CURSOR_HEIGHT88 #define CURSOR_DATA_SIZE CURSOR_PIXEL_COUNT * 4 + CURSOR_PIXEL_COUNT / 889 87 90 88 struct vbox_fbdev; … … 125 123 bool fbdev_init; 126 124 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 }; 136 126 137 127 int vbox_driver_load(struct drm_device *dev, unsigned long flags); -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r60284 r60285 678 678 mask_size = ((width + 7) / 8 * height + 3) & ~3; 679 679 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) 686 682 { 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) 689 685 { 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); 698 701 } 699 else 700 DRM_ERROR("src cursor bo should be in main memory\n"); 701 ttm_bo_kunmap(&uobj_map); 702 kfree(dst); 702 703 } 703 else704 vbox->cursor_data_size = 0;705 704 vbox_bo_unreserve(bo); 706 705 } … … 719 718 { 720 719 struct vbox_private *vbox = crtc->dev->dev_private; 721 uint32_t flags = VBOX_MOUSE_POINTER_VISIBLE722 | VBOX_MOUSE_POINTER_SHAPE723 | 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;728 720 729 721 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); 745 723 return 0; 746 724 } -
trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh
r60284 r60285 368 368 vboxvideo_src="" 369 369 } 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 370 375 ;; 371 376 * ) 372 377 # For anything else, assume kernel drivers. 373 378 dox11config="" 379 $MODPROBE vboxvideo || 380 echo "Warning: failed to set up the X Window System display integration." 374 381 ;; 375 382 esac 376 if $MODPROBE vboxvideo; then377 # 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 fi382 383 test -n "${dox11config}" && 383 384 begin "Installing $xserver_version modules"
Note:
See TracChangeset
for help on using the changeset viewer.