Commit 52571ad5 authored by David Mansfield's avatar David Mansfield Committed by Dave Airlie

drm/qxl: use surface_id 0 for primary surface on all monitors

spice-server and downstream code expect that the primary surface
will always have surface_id = 0, while in reality, once allocated, the
surface_id in qxl.ko is NEVER 0.  In a dual head environment, all
monitors render portions of the primary surface.

However, when the monitor config events are generated and sent,
the primary surface is only mapped to the correct identifier
(i.e. 0) for the primary head (where crtc index is 0).

The fix is to look at the "primary" flag in the bo and always
use id 0, irrespective of which head is being configured.

[airlied: qxl hw really needs to be fixed to scanout surfaces]
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fa7f517c
...@@ -574,6 +574,10 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc, ...@@ -574,6 +574,10 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc,
bo->surf.height, bo->surf.stride, bo->surf.format); bo->surf.height, bo->surf.stride, bo->surf.format);
qxl_io_create_primary(qdev, base_offset, bo); qxl_io_create_primary(qdev, base_offset, bo);
bo->is_primary = true; bo->is_primary = true;
}
if (bo->is_primary) {
DRM_DEBUG_KMS("setting surface_id to 0 for primary surface %d on crtc %d\n", bo->surface_id, qcrtc->index);
surf_id = 0; surf_id = 0;
} else { } else {
surf_id = bo->surface_id; surf_id = bo->surface_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment