summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2010-10-02 00:30:05 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-26 08:12:18 -0500
commit0b9dc625f399dfa5af6484a772673487afdaaa09 (patch)
tree8651fde91a33d9e0acac19fc0b7abda4cf761a69
parentd0457b0e8c8595fbbe4c56dafb5c7daf722b4b23 (diff)
Fix segmentation fault when no surfaces are available
-rw-r--r--src/qxl_driver.c5
-rw-r--r--src/qxl_surface.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 08890cc..70b8d34 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -97,6 +97,11 @@ garbage_collect (qxl_screen_t *qxl)
qxl_image_destroy (qxl, image);
}
}
+ else if (is_drawable && drawable->type == QXL_DRAW_FILL)
+ {
+ if (drawable->surface_id)
+ ErrorF (" done fill for %d freed\n", drawable->surface_id);
+ }
else if (is_surface && surface_cmd->type == QXL_SURFACE_CMD_DESTROY)
{
qxl_surface_recycle (surface_cmd->surface_id);
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 3869845..6b3b036 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -95,11 +95,11 @@ surface_new (void)
{
result = free_surfaces;
free_surfaces = free_surfaces->next;
- }
- result->next = NULL;
- result->in_use = TRUE;
- result->ref_count = 1;
+ result->next = NULL;
+ result->in_use = TRUE;
+ result->ref_count = 1;
+ }
return result;
}
@@ -336,9 +336,7 @@ retry2:
cmd->u.surface_create.physical =
physical_address (qxl, surface->address, qxl->vram_mem_slot);
-#if 0
ErrorF ("create %d\n", cmd->surface_id);
-#endif
push_surface_cmd (qxl, cmd);
@@ -383,10 +381,8 @@ qxl_surface_destroy (qxl_surface_t *surface)
#endif
cmd = make_surface_cmd (qxl, surface->id, QXL_SURFACE_CMD_DESTROY);
-#if 0
ErrorF (" pushing destroy command %lx\n", cmd->release_info.id);
ErrorF ("destroy %d\n", cmd->surface_id);
-#endif
push_surface_cmd (qxl, cmd);
}
@@ -800,6 +796,8 @@ qxl_surface_solid (qxl_surface_t *destination,
qrect.bottom = y2;
qrect.left = x1;
qrect.right = x2;
+
+ ErrorF ("Fill: %d\n", destination->id);
submit_fill (qxl, destination->id, &qrect, destination->u.solid_pixel);
}