aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Mansfield <spice@dm.cobite.com>2014-06-03 22:12:15 -0400
committerDave Airlie <airlied@redhat.com>2014-06-03 22:13:22 -0400
commit52571ad5f4c57067ac593a6bdb1f7a35ed032d27 (patch)
tree0d3ced34dd9fea55f97bc26a7b6553b5bebefaa1
parentfa7f517cb26eb1a1a1f0baffcced39f6c3ec3337 (diff)
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: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/qxl/qxl_display.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 3ab9072d3623..5d7ea2461852 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -574,6 +574,10 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc,
574 bo->surf.height, bo->surf.stride, bo->surf.format); 574 bo->surf.height, bo->surf.stride, bo->surf.format);
575 qxl_io_create_primary(qdev, base_offset, bo); 575 qxl_io_create_primary(qdev, base_offset, bo);
576 bo->is_primary = true; 576 bo->is_primary = true;
577 }
578
579 if (bo->is_primary) {
580 DRM_DEBUG_KMS("setting surface_id to 0 for primary surface %d on crtc %d\n", bo->surface_id, qcrtc->index);
577 surf_id = 0; 581 surf_id = 0;
578 } else { 582 } else {
579 surf_id = bo->surface_id; 583 surf_id = bo->surface_id;