]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: vboxvideo: Stop disabling/enabling accel support on master set / drop
authorHans de Goede <hdegoede@redhat.com>
Thu, 18 Oct 2018 15:03:33 +0000 (17:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Nov 2018 11:27:33 +0000 (12:27 +0100)
Userspace mode-setting (and thus also VESA) is not supported together with
modesetting. KMS userspace apps not properly marking the framebuffer as
dirty are also not supported.

So stop trying to accommodate this and simply enable accel
once at driver init.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vboxvideo/vbox_drv.c
drivers/staging/vboxvideo/vbox_drv.h
drivers/staging/vboxvideo/vbox_main.c

index ef4db193317be78b00a56414ee984ec81e3665be..d7440b9e5eea4e5f148ae22adbd503e011d41751 100644 (file)
@@ -207,21 +207,6 @@ static int vbox_master_set(struct drm_device *dev,
         */
        vbox->initial_mode_queried = false;
 
-       mutex_lock(&vbox->hw_mutex);
-       /*
-        * Disable VBVA when someone releases master in case the next person
-        * tries tries to do VESA.
-        */
-       /** @todo work out if anyone is likely to and whether it will work. */
-       /*
-        * Update: we also disable it because if the new master does not do
-        * dirty rectangle reporting (e.g. old versions of Plymouth) then at
-        * least the first screen will still be updated. We enable it as soon
-        * as we receive a dirty rectangle report.
-        */
-       vbox_disable_accel(vbox);
-       mutex_unlock(&vbox->hw_mutex);
-
        return 0;
 }
 
@@ -231,10 +216,6 @@ static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
 
        /* See vbox_master_set() */
        vbox->initial_mode_queried = false;
-
-       mutex_lock(&vbox->hw_mutex);
-       vbox_disable_accel(vbox);
-       mutex_unlock(&vbox->hw_mutex);
 }
 
 static struct drm_driver driver = {
index 57e9f1f3ba6585de15b8dfb4049961ce5f833c7b..f82e594eca4bc9b848e420e3a7f5eb5dbe0cb5c8 100644 (file)
@@ -166,8 +166,6 @@ void vbox_mode_fini(struct vbox_private *vbox);
 
 #define DRM_MODE_FB_CMD drm_mode_fb_cmd2
 
-void vbox_enable_accel(struct vbox_private *vbox);
-void vbox_disable_accel(struct vbox_private *vbox);
 void vbox_report_caps(struct vbox_private *vbox);
 
 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
index ab510fc9d088bbe9d623dde217452bc15f9a732a..26a90ec9e3d01300367b5dd8bd6a6e4c4f266b6e 100644 (file)
@@ -27,40 +27,6 @@ static void vbox_user_framebuffer_destroy(struct drm_framebuffer *fb)
        kfree(fb);
 }
 
-void vbox_enable_accel(struct vbox_private *vbox)
-{
-       unsigned int i;
-       struct vbva_buffer *vbva;
-
-       if (!vbox->vbva_info || !vbox->vbva_buffers) {
-               /* Should never happen... */
-               DRM_ERROR("vboxvideo: failed to set up VBVA.\n");
-               return;
-       }
-
-       for (i = 0; i < vbox->num_crtcs; ++i) {
-               if (vbox->vbva_info[i].vbva)
-                       continue;
-
-               vbva = (void __force *)vbox->vbva_buffers +
-                       i * VBVA_MIN_BUFFER_SIZE;
-               if (!vbva_enable(&vbox->vbva_info[i],
-                                vbox->guest_pool, vbva, i)) {
-                       /* very old host or driver error. */
-                       DRM_ERROR("vboxvideo: vbva_enable failed\n");
-                       return;
-               }
-       }
-}
-
-void vbox_disable_accel(struct vbox_private *vbox)
-{
-       unsigned int i;
-
-       for (i = 0; i < vbox->num_crtcs; ++i)
-               vbva_disable(&vbox->vbva_info[i], vbox->guest_pool, i);
-}
-
 void vbox_report_caps(struct vbox_private *vbox)
 {
        u32 caps = VBVACAPS_DISABLE_CURSOR_INTEGRATION |
@@ -72,12 +38,7 @@ void vbox_report_caps(struct vbox_private *vbox)
        hgsmi_send_caps_info(vbox->guest_pool, caps);
 }
 
-/*
- * Send information about dirty rectangles to VBVA.  If necessary we enable
- * VBVA first, as this is normally disabled after a change of master in case
- * the new master does not send dirty rectangle information (is this even
- * allowed?)
- */
+/* Send information about dirty rectangles to VBVA. */
 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
                                       struct drm_clip_rect *rects,
                                       unsigned int num_rects)
@@ -97,8 +58,6 @@ void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
                crtc_x = crtc->primary->state->src_x >> 16;
                crtc_y = crtc->primary->state->src_y >> 16;
 
-               vbox_enable_accel(vbox);
-
                for (i = 0; i < num_rects; ++i) {
                        struct vbva_cmd_hdr cmd_hdr;
                        unsigned int crtc_id = to_vbox_crtc(crtc)->crtc_id;
@@ -162,6 +121,7 @@ int vbox_framebuffer_init(struct vbox_private *vbox,
 
 static int vbox_accel_init(struct vbox_private *vbox)
 {
+       struct vbva_buffer *vbva;
        unsigned int i;
 
        vbox->vbva_info = devm_kcalloc(vbox->ddev.dev, vbox->num_crtcs,
@@ -179,18 +139,30 @@ static int vbox_accel_init(struct vbox_private *vbox)
        if (!vbox->vbva_buffers)
                return -ENOMEM;
 
-       for (i = 0; i < vbox->num_crtcs; ++i)
+       for (i = 0; i < vbox->num_crtcs; ++i) {
                vbva_setup_buffer_context(&vbox->vbva_info[i],
                                          vbox->available_vram_size +
                                          i * VBVA_MIN_BUFFER_SIZE,
                                          VBVA_MIN_BUFFER_SIZE);
+               vbva = (void __force *)vbox->vbva_buffers +
+                       i * VBVA_MIN_BUFFER_SIZE;
+               if (!vbva_enable(&vbox->vbva_info[i],
+                                vbox->guest_pool, vbva, i)) {
+                       /* very old host or driver error. */
+                       DRM_ERROR("vboxvideo: vbva_enable failed\n");
+               }
+       }
 
        return 0;
 }
 
 static void vbox_accel_fini(struct vbox_private *vbox)
 {
-       vbox_disable_accel(vbox);
+       unsigned int i;
+
+       for (i = 0; i < vbox->num_crtcs; ++i)
+               vbva_disable(&vbox->vbva_info[i], vbox->guest_pool, i);
+
        pci_iounmap(vbox->ddev.pdev, vbox->vbva_buffers);
 }