VirtualBox

Changeset 60085 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 17, 2016 7:06:05 PM (9 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: fix disabling of virtual screens from the host in the kernel graphics driver.

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

Legend:

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

    r60058 r60085  
    136136    struct drm_connector base;
    137137    char name[32];
    138     unsigned crtc_id;
     138    struct vbox_crtc *vbox_crtc;
    139139    struct {
    140140        uint16_t width;
     
    147147    struct drm_crtc base;
    148148    bool blanked;
     149    bool disconnected;
    149150    unsigned crtc_id;
    150151    uint32_t fb_offset;
  • trunk/src/VBox/Additions/linux/drm/vbox_irq.c

    r59956 r60085  
    8989    struct vbox_connector *vbox_connector;
    9090    struct VBVAMODEHINT *hints;
     91    uint16_t flags;
     92    bool disconnected;
     93    unsigned crtc_id;
    9194    int rc;
    9295
     
    101104    list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
    102105        vbox_connector = to_vbox_connector(connector);
    103         hints = &vbox->last_mode_hints[vbox_connector->crtc_id];
     106        hints = &vbox->last_mode_hints[vbox_connector->vbox_crtc->crtc_id];
    104107        if (hints->magic == VBVAMODEHINT_MAGIC) {
    105108            LogFunc(("vboxvideo: %d: crtc_id=%u, mode %hdx%hd(enabled:%d),%hdx%hd\n",
    106                      __LINE__, (unsigned)vbox_connector->crtc_id,
     109                     __LINE__, (unsigned)vbox_connector->vbox_crtc->crtc_id,
    107110                     (short)hints->cx, (short)hints->cy, (int)hints->fEnabled,
    108111                     (short)hints->dx, (short)hints->dy));
     112            disconnected = !(hints->fEnabled);
     113            crtc_id = vbox_connector->vbox_crtc->crtc_id;
     114            flags =   VBVA_SCREEN_F_ACTIVE
     115                    | (disconnected ? VBVA_SCREEN_F_DISABLED : VBVA_SCREEN_F_BLANK);
    109116            vbox_connector->mode_hint.width = hints->cx & 0x8fff;
    110117            vbox_connector->mode_hint.height = hints->cy & 0x8fff;
    111             vbox_connector->mode_hint.disconnected = !(hints->fEnabled);
     118            vbox_connector->mode_hint.disconnected = disconnected;
     119            if (vbox_connector->vbox_crtc->disconnected != disconnected) {
     120                VBoxHGSMIProcessDisplayInfo(&vbox->submit_info, crtc_id,
     121                                            0, 0, 0, hints->cx * 4, hints->cx,
     122                                            hints->cy, 0, flags);
     123                vbox_connector->vbox_crtc->disconnected = disconnected;
     124            }
    112125#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
    113126            if ((hints->dx < 0xffff) && (hints->dy < 0xffff)) {
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r60058 r60085  
    9292                                  crtc->x, crtc->y); */
    9393    flags = VBVA_SCREEN_F_ACTIVE;
    94     flags |= (crtc->enabled ? 0 : VBVA_SCREEN_F_DISABLED);
     94    flags |= (crtc->enabled && !vbox_crtc->blanked ? 0 : VBVA_SCREEN_F_BLANK);
     95    flags |= (vbox_crtc->disconnected ? VBVA_SCREEN_F_DISABLED : 0);
    9596    VBoxHGSMIProcessDisplayInfo(&vbox->submit_info, vbox_crtc->crtc_id,
    9697                                crtc->x, crtc->y,
     
    312313};
    313314
    314 static int vbox_crtc_init(struct drm_device *dev, unsigned i)
    315 {
    316     struct vbox_crtc *crtc;
    317 
    318     LogFunc(("vboxvideo: %d\n", __LINE__));
    319     crtc = kzalloc(sizeof(struct vbox_crtc), GFP_KERNEL);
    320     if (!crtc)
    321         return -ENOMEM;
    322     crtc->crtc_id = i;
    323 
    324     drm_crtc_init(dev, &crtc->base, &vbox_crtc_funcs);
    325     drm_mode_crtc_set_gamma_size(&crtc->base, 256);
    326     drm_crtc_helper_add(&crtc->base, &vbox_crtc_helper_funcs);
    327     LogFunc(("vboxvideo: %d: crtc=%p\n", __LINE__, crtc));
    328 
    329     return 0;
     315static struct vbox_crtc *vbox_crtc_init(struct drm_device *dev, unsigned i)
     316{
     317    struct vbox_crtc *vbox_crtc;
     318
     319    LogFunc(("vboxvideo: %d\n", __LINE__));
     320    vbox_crtc = kzalloc(sizeof(struct vbox_crtc), GFP_KERNEL);
     321    if (!vbox_crtc)
     322        return NULL;
     323    vbox_crtc->crtc_id = i;
     324
     325    drm_crtc_init(dev, &vbox_crtc->base, &vbox_crtc_funcs);
     326    drm_mode_crtc_set_gamma_size(&vbox_crtc->base, 256);
     327    drm_crtc_helper_add(&vbox_crtc->base, &vbox_crtc_helper_funcs);
     328    LogFunc(("vboxvideo: %d: crtc=%p\n", __LINE__, vbox_crtc));
     329
     330    return vbox_crtc;
    330331}
    331332
     
    474475    LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector));
    475476    vbox_connector = to_vbox_connector(connector);
    476     return !vbox_connector->mode_hint.disconnected;
     477    return vbox_connector->mode_hint.disconnected ?
     478                connector_status_disconnected : connector_status_connected;
    477479}
    478480
     
    508510};
    509511
    510 static int vbox_connector_init(struct drm_device *dev, unsigned cScreen,
     512static int vbox_connector_init(struct drm_device *dev,
     513                               struct vbox_crtc *vbox_crtc,
    511514                               struct drm_encoder *encoder)
    512515{
     
    521524
    522525    connector = &vbox_connector->base;
    523     vbox_connector->crtc_id = cScreen;
     526    vbox_connector->vbox_crtc = vbox_crtc;
    524527
    525528    drm_connector_init(dev, connector, &vbox_connector_funcs,
     
    553556    struct vbox_private *vbox = dev->dev_private;
    554557    struct drm_encoder *encoder;
     558    struct vbox_crtc *vbox_crtc;
    555559    unsigned i;
    556560    /* vbox_cursor_init(dev); */
     
    558562    for (i = 0; i < vbox->num_crtcs; ++i)
    559563    {
    560         vbox_crtc_init(dev, i);
     564        vbox_crtc = vbox_crtc_init(dev, i);
     565        if (!vbox_crtc)
     566            return -ENOMEM;
    561567        encoder = vbox_encoder_init(dev, i);
    562         if (encoder)
    563             vbox_connector_init(dev, i, encoder);
     568        if (!encoder)
     569            return -ENOMEM;
     570        vbox_connector_init(dev, vbox_crtc, encoder);
    564571    }
    565572    return 0;
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