aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/qxl
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-18 13:20:07 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-01-28 14:24:53 +0100
commit1f85535cd04cb0b135971df9dcfd51749c9783f3 (patch)
tree588cf92617ba9577f2fbb3c1e35a6e6ecc688182 /drivers/gpu/drm/qxl
parentdrm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects (diff)
downloadlinux-dev-1f85535cd04cb0b135971df9dcfd51749c9783f3.tar.xz
linux-dev-1f85535cd04cb0b135971df9dcfd51749c9783f3.zip
drm/qxl: move qxl_primary_apply_cursor to correct place
The qxl device ties the cursor to the primary surface. Therefore calling qxl_io_destroy_primary() and qxl_io_create_primary() to switch the framebuffer causes the cursor information being lost and the driver must re-apply it. The correct call order to do that is qxl_io_destroy_primary() + qxl_io_create_primary() + qxl_primary_apply_cursor(). The old code did qxl_io_destroy_primary() + qxl_primary_apply_cursor() + qxl_io_create_primary(). Due to qxl_primary_apply_cursor request being queued in a ringbuffer and qxl_io_create_primary() trapping to the hypervisor instantly there is a high chance that qxl_io_create_primary() is processed first even with the wrong call order. But it's racy and thus not reliable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Noralf Trønnes <noralf@tronnes.org> Link: http://patchwork.freedesktop.org/patch/msgid/20190118122020.27596-11-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/qxl')
-rw-r--r--drivers/gpu/drm/qxl/qxl_display.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index c4dd71a80c2f..6180b4a714b6 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -533,7 +533,6 @@ static void qxl_primary_atomic_update(struct drm_plane *plane,
.x2 = plane->state->fb->width,
.y2 = plane->state->fb->height
};
- int ret;
bool same_shadow = false;
if (old_state->fb) {
@@ -554,16 +553,13 @@ static void qxl_primary_atomic_update(struct drm_plane *plane,
if (!same_shadow)
qxl_io_destroy_primary(qdev);
bo_old->is_primary = false;
-
- ret = qxl_primary_apply_cursor(plane);
- if (ret)
- DRM_ERROR(
- "could not set cursor after creating primary");
}
if (!bo->is_primary) {
- if (!same_shadow)
+ if (!same_shadow) {
qxl_io_create_primary(qdev, 0, bo);
+ qxl_primary_apply_cursor(plane);
+ }
bo->is_primary = true;
}