vmwgfx: Resend the cursor after legacy modeset
[pandora-kernel.git] / drivers / gpu / drm / vmwgfx / vmwgfx_ldu.c
index 92f56bc..8f8dbd4 100644 (file)
@@ -74,9 +74,10 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
 {
        struct vmw_legacy_display *lds = dev_priv->ldu_priv;
        struct vmw_legacy_display_unit *entry;
+       struct vmw_display_unit *du = NULL;
        struct drm_framebuffer *fb = NULL;
        struct drm_crtc *crtc = NULL;
-       int i = 0;
+       int i = 0, ret;
 
        /* If there is no display topology the host just assumes
         * that the guest will set the same layout as the host.
@@ -129,6 +130,25 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
 
        lds->last_num_active = lds->num_active;
 
+
+       /* Find the first du with a cursor. */
+       list_for_each_entry(entry, &lds->active, active) {
+               du = &entry->base;
+
+               if (!du->cursor_dmabuf)
+                       continue;
+
+               ret = vmw_cursor_update_dmabuf(dev_priv,
+                                              du->cursor_dmabuf,
+                                              64, 64,
+                                              du->hotspot_x,
+                                              du->hotspot_y);
+               if (ret == 0)
+                       break;
+
+               DRM_ERROR("Could not update cursor image\n");
+       }
+
        return 0;
 }
 
@@ -337,13 +357,14 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
        ldu->base.pref_width = 800;
        ldu->base.pref_height = 600;
        ldu->base.pref_mode = NULL;
+       ldu->base.is_implicit = true;
 
        drm_connector_init(dev, connector, &vmw_legacy_connector_funcs,
-                          DRM_MODE_CONNECTOR_LVDS);
+                          DRM_MODE_CONNECTOR_VIRTUAL);
        connector->status = vmw_du_connector_detect(connector, true);
 
        drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs,
-                        DRM_MODE_ENCODER_LVDS);
+                        DRM_MODE_ENCODER_VIRTUAL);
        drm_mode_connector_attach_encoder(connector, encoder);
        encoder->possible_crtcs = (1 << unit);
        encoder->possible_clones = 0;