VirtualBox

Changeset 71946 in vbox for trunk


Ignore:
Timestamp:
Apr 20, 2018 2:54:27 PM (7 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: drop some workarounds. No bugref.
Drop a workaround in the drm driver for old 5.0 VirtualBox hosts and for
old drm clients versions which were never used in distributions we supported.

File:
1 edited

Legend:

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

    r70625 r71946  
    769769        bool src_isiomem;
    770770
    771         /*
    772          * Re-set this regularly as in 5.0.20 and earlier the information was
    773          * lost on save and restore.
    774          */
    775         VBoxHGSMIUpdateInputMapping(vbox->guest_pool, 0, 0,
    776                                     vbox->input_mapping_width,
    777                                     vbox->input_mapping_height);
    778771        if (!handle) {
    779772                bool cursor_enabled = false;
     
    825818                        mask_size = ((width + 7) / 8 * height + 3) & ~3;
    826819                        data_size = width * height * 4 + mask_size;
    827                         vbox->cursor_hot_x = min_t(u32, max(hot_x, 0), width);
    828                         vbox->cursor_hot_y = min_t(u32, max(hot_y, 0), height);
     820                        vbox->cursor_hot_x = hot_x;
     821                        vbox->cursor_hot_y = hot_y;
    829822                        vbox->cursor_width = width;
    830823                        vbox->cursor_height = height;
     
    876869{
    877870        struct vbox_private *vbox = crtc->dev->dev_private;
    878         u32 flags = VBOX_MOUSE_POINTER_VISIBLE |
    879             VBOX_MOUSE_POINTER_SHAPE | VBOX_MOUSE_POINTER_ALPHA;
    880871        s32 crtc_x =
    881872            vbox->single_framebuffer ? crtc->x : to_vbox_crtc(crtc)->x_hint;
    882873        s32 crtc_y =
    883874            vbox->single_framebuffer ? crtc->y : to_vbox_crtc(crtc)->y_hint;
    884         u32 host_x, host_y;
    885         u32 hot_x = 0;
    886         u32 hot_y = 0;
    887875        int rc;
    888876
    889         /*
    890          * We compare these to unsigned later and don't
    891          * need to handle negative.
    892          */
    893         if (x + crtc_x < 0 || y + crtc_y < 0 || vbox->cursor_data_size == 0)
     877        x += vbox->cursor_hot_x;
     878        y += vbox->cursor_hot_y;
     879        if (x + crtc_x < 0 || y + crtc_y < 0 ||
     880                x + crtc_x >= vbox->input_mapping_width ||
     881                y + crtc_y >= vbox->input_mapping_width ||
     882                vbox->cursor_data_size == 0)
    894883                return 0;
    895 
    896884        rc = VBoxHGSMICursorPosition(vbox->guest_pool, true, x + crtc_x,
    897                                      y + crtc_y, &host_x, &host_y);
    898         /* Work around a bug after save and restore in 5.0.20 and earlier. */
    899         if (RT_FAILURE(rc) || (host_x == 0 && host_y == 0))
    900                 return rc == VINF_SUCCESS ? 0
    901                     : rc == VERR_NO_MEMORY ? -ENOMEM : -EINVAL;
    902         if (x + crtc_x < host_x)
    903                 hot_x = min(host_x - x - crtc_x, vbox->cursor_width);
    904         if (y + crtc_y < host_y)
    905                 hot_y = min(host_y - y - crtc_y, vbox->cursor_height);
    906         if (hot_x == vbox->cursor_hot_x && hot_y == vbox->cursor_hot_y)
    907                 return 0;
    908         vbox->cursor_hot_x = hot_x;
    909         vbox->cursor_hot_y = hot_y;
    910         rc = VBoxHGSMIUpdatePointerShape(vbox->guest_pool, flags, hot_x, hot_y,
    911                                          vbox->cursor_width,
    912                                          vbox->cursor_height, vbox->cursor_data,
    913                                          vbox->cursor_data_size);
     885                                         y + crtc_y, NULL, NULL);
    914886        return rc == VINF_SUCCESS ? 0 : rc == VERR_NO_MEMORY ? -ENOMEM : rc ==
    915             VERR_NOT_SUPPORTED ? -EBUSY : -EINVAL;
    916 }
     887                VERR_NOT_SUPPORTED ? -EBUSY : -EINVAL;
     888}
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