From 8c41711f87b45207dce88e8f10feca9dace35743 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Mon, 24 Mar 2014 11:39:44 +0200 Subject: display/qxl: allow primary creation larger than framebuffer The framebuffer size is meaningless once native mode is used, which we enter by primary surface creation io. If the memory allocation is bad spice server will complain. But for valid allocations we can allocate any size from the pci bar. Signed-off-by: Alon Levy --- hw/display/qxl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index abe7a18a8..521494840 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1366,16 +1366,11 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm, { QXLDevSurfaceCreate surface; QXLSurfaceCreate *sc = &qxl->guest_primary.surface; - uint32_t requested_height = le32_to_cpu(sc->height); int requested_stride = le32_to_cpu(sc->stride); - if (requested_stride == INT32_MIN || - abs(requested_stride) * (uint64_t)requested_height - > qxl->vgamem_size) { - qxl_set_guest_bug(qxl, "%s: requested primary larger than framebuffer" - " stride %d x height %" PRIu32 " > %" PRIu32, - __func__, requested_stride, requested_height, - qxl->vgamem_size); + if (requested_stride == INT32_MIN) { + qxl_set_guest_bug(qxl, "%s: requested primary has invalid stride", + __func__); return; } -- cgit v1.2.3