summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2014-03-24 11:39:44 +0200
committerAlon Levy <alevy@redhat.com>2014-03-24 11:39:44 +0200
commit20d6c7d6eb0f663f9e6f2b36934329f917120a35 (patch)
treee20f927b6a3bc2ea031a1547e2baa59d4d776cc0
parent20a4f8b80ee0029187277089ffa911c5a94af59f (diff)
display/qxl: allow primary creation larger than framebuffermaster
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;
}