VirtualBox

Ignore:
Timestamp:
Oct 13, 2017 4:03:36 PM (7 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: Fix reporting invalid suggested-offset-properties.
bugref:8524: Additions/linux: play nicely with distribution-installed Additions

The x and y hints receives from the host are unsigned 32 bit integers and
they get set to -1 (0xffffffff) when invalid. Before this commit the
vboxvideo driver was storing them in an u16 causing the -1 to be truncated
to 65535 which, once reported to userspace, was breaking gnome 3.26+
in Wayland mode.

This commit stores the host values in 32 bit variables, removing the
truncation and checks for -1, replacing it with 0 as -1 is not a valid
suggested-offset-property value. Likewise the properties are now
initialized to 0 instead of -1, since -1 is not a valid value.
This fixes gnome 3.26+ in Wayland mode not working with the vboxvideo
driver.

Reported-by: Gianfranco Costamagna <locutusofborg@…>
Signed-off-by: Hans de Goede <hdegoede@…>

Location:
trunk/src/VBox/Additions/linux/drm
Files:
3 edited

Legend:

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

    r68848 r69083  
    179179        struct vbox_crtc *vbox_crtc;
    180180        struct {
    181                 u16 width;
    182                 u16 height;
     181                u32 width;
     182                u32 height;
    183183                bool disconnected;
    184184        } mode_hint;
     
    192192        u32 fb_offset;
    193193        bool cursor_enabled;
    194         u16 x_hint;
    195         u16 y_hint;
     194        u32 x_hint;
     195        u32 y_hint;
    196196};
    197197
  • trunk/src/VBox/Additions/linux/drm/vbox_irq.c

    r68334 r69083  
    161161                            | (disconnected ? VBVA_SCREEN_F_DISABLED :
    162162                               VBVA_SCREEN_F_BLANK);
    163                         vbox_connector->mode_hint.width = hints->cx & 0x8fff;
    164                         vbox_connector->mode_hint.height = hints->cy & 0x8fff;
     163                        vbox_connector->mode_hint.width = hints->cx;
     164                        vbox_connector->mode_hint.height = hints->cy;
    165165                        vbox_connector->vbox_crtc->x_hint = hints->dx;
    166166                        vbox_connector->vbox_crtc->y_hint = hints->dy;
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r68848 r69083  
    593593        }
    594594        vbox_set_edid(connector, preferred_width, preferred_height);
     595
    595596#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || defined(RHEL_73)
    596         drm_object_property_set_value(
    597                 &connector->base, vbox->dev->mode_config.suggested_x_property,
    598                 vbox_connector->vbox_crtc->x_hint);
    599         drm_object_property_set_value(
    600                 &connector->base, vbox->dev->mode_config.suggested_y_property,
    601                 vbox_connector->vbox_crtc->y_hint);
     597        if (vbox_connector->vbox_crtc->x_hint != -1)
     598                drm_object_property_set_value(&connector->base,
     599                        vbox->dev->mode_config.suggested_x_property,
     600                        vbox_connector->vbox_crtc->x_hint);
     601        else
     602                drm_object_property_set_value(&connector->base,
     603                        vbox->dev->mode_config.suggested_x_property, 0);
     604
     605        if (vbox_connector->vbox_crtc->y_hint != -1)
     606                drm_object_property_set_value(&connector->base,
     607                        vbox->dev->mode_config.suggested_y_property,
     608                        vbox_connector->vbox_crtc->y_hint);
     609        else
     610                drm_object_property_set_value(&connector->base,
     611                        vbox->dev->mode_config.suggested_y_property, 0);
    602612#endif
    603613
     
    691701        drm_mode_create_suggested_offset_properties(dev);
    692702        drm_object_attach_property(&connector->base,
    693                                    dev->mode_config.suggested_x_property, -1);
     703                                   dev->mode_config.suggested_x_property, 0);
    694704        drm_object_attach_property(&connector->base,
    695                                    dev->mode_config.suggested_y_property, -1);
     705                                   dev->mode_config.suggested_y_property, 0);
    696706#endif
    697707#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_73)
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