summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2014-03-24 11:39:44 +0200
committerAlon Levy <alevy@redhat.com>2014-04-03 13:52:33 +0300
commit8c41711f87b45207dce88e8f10feca9dace35743 (patch)
tree023b558f00421048efe69a60799c804ef993785e
parentc4ac90f2c9c4cf13f26999f1df080b85f0fbf424 (diff)
display/qxl: allow primary creation larger than framebufferqxl-fixes
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 <alevy@redhat.com>
-rw-r--r--hw/display/qxl.c11
1 files 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;
}