diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-10-19 08:21:50 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-10-23 08:23:11 +0200 |
commit | 62676d10b483a2ff6e8b08c5e7c7d63a831343f5 (patch) | |
tree | 303a852f58fe70dd7e1c2b9672b16240eda8110d /drivers/gpu/drm/qxl/qxl_cmd.c | |
parent | drm/qxl: replace QXL_INFO with DRM_DEBUG_DRIVER (diff) | |
download | linux-62676d10b483a2ff6e8b08c5e7c7d63a831343f5.tar.xz linux-62676d10b483a2ff6e8b08c5e7c7d63a831343f5.zip |
qxl: alloc & use shadow for dumb buffers
This patch changes the way the primary surface is used for dumb
framebuffers. Instead of configuring the bo itself as primary surface
a shadow bo is created and used instead. Framebuffers can share the
shadow bo in case they have the same format and resolution.
On atomic plane updates we don't have to update the primary surface in
case we pageflip from one framebuffer to another framebuffer which
shares the same shadow. This in turn avoids the flicker caused by the
primary-destroy + primary-create cycle, which is very annonying when
running wayland on qxl.
The qxl driver never actually writes to the shadow bo. It sends qxl
blit commands which update it though, and the spice server might
actually execute them (and thereby write to the shadow) in case the
local rendering is kicked for some reason. This happens for example in
case qemu is asked to write out a dump of the guest display (screendump
monitor command).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20171019062150.28090-3-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_cmd.c')
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_cmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index 8ec53d5abd62..c0fb52c6d4ca 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -387,7 +387,11 @@ void qxl_io_create_primary(struct qxl_device *qdev, create->width = bo->surf.width; create->height = bo->surf.height; create->stride = bo->surf.stride; - create->mem = qxl_bo_physical_address(qdev, bo, offset); + if (bo->shadow) { + create->mem = qxl_bo_physical_address(qdev, bo->shadow, offset); + } else { + create->mem = qxl_bo_physical_address(qdev, bo, offset); + } DRM_DEBUG_DRIVER("mem = %llx, from %p\n", create->mem, bo->kptr); |