[Spice-devel] [spice-protocol PATCH 27/46] qxlhw: qxl_driver.c: remove qxl_garbage_collect (moved to qxlhw_pci.c)
Alon Levy
alevy at redhat.com
Tue Apr 10 04:50:23 PDT 2012
---
src/qxl.h | 5 ----
src/qxl_driver.c | 71 ------------------------------------------------------
2 files changed, 76 deletions(-)
diff --git a/src/qxl.h b/src/qxl.h
index c58f7ff..6cedba3 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -371,11 +371,6 @@ void qxl_drop_image_cache (qxl_screen_t *qxl);
/*
- * Malloc
- */
-int qxl_garbage_collect (qxl_screen_t *qxl);
-
-/*
* I/O port commands
*/
void qxl_memslot_add(qxl_screen_t *qxl, uint8_t id);
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 32b7b46..c551282 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -133,77 +133,6 @@ qxl_available_options (int chipid, int busid)
return DefaultOptions;
}
-int
-qxl_garbage_collect (qxl_screen_t *qxl)
-{
- uint64_t id;
- int i = 0;
-
- while (qxl_ring_pop (qxl->release_ring, &id))
- {
- while (id)
- {
- /* We assume that there the two low bits of a pointer are
- * available. If the low one is set, then the command in
- * question is a cursor command
- */
-#define POINTER_MASK ((1 << 2) - 1)
-
- union QXLReleaseInfo *info = u64_to_pointer (id & ~POINTER_MASK);
- struct QXLCursorCmd *cmd = (struct QXLCursorCmd *)info;
- struct QXLDrawable *drawable = (struct QXLDrawable *)info;
- struct QXLSurfaceCmd *surface_cmd = (struct QXLSurfaceCmd *)info;
- int is_cursor = FALSE;
- int is_surface = FALSE;
- int is_drawable = FALSE;
-
- if ((id & POINTER_MASK) == 1)
- is_cursor = TRUE;
- else if ((id & POINTER_MASK) == 2)
- is_surface = TRUE;
- else
- is_drawable = TRUE;
-
- if (is_cursor && cmd->type == QXL_CURSOR_SET)
- {
- struct QXLCursor *cursor = (void *)virtual_address (
- qxl, u64_to_pointer (cmd->u.set.shape), qxl->main_mem_slot);
-
- qxl_free (qxl->mem, cursor);
- }
- else if (is_drawable && drawable->type == QXL_DRAW_COPY)
- {
- struct QXLImage *image = virtual_address (
- qxl, u64_to_pointer (drawable->u.copy.src_bitmap), qxl->main_mem_slot);
-
- if (image->descriptor.type == SPICE_IMAGE_TYPE_SURFACE)
- {
- qxl_surface_unref (qxl->surface_cache, image->surface_image.surface_id);
- qxl_surface_cache_sanity_check (qxl->surface_cache);
- qxl_free (qxl->mem, image);
- }
- else
- {
- qxl_image_destroy (qxl, image);
- }
- }
- else if (is_surface && surface_cmd->type == QXL_SURFACE_CMD_DESTROY)
- {
- qxl_surface_recycle (qxl->surface_cache, surface_cmd->surface_id);
- qxl_surface_cache_sanity_check (qxl->surface_cache);
- }
-
- id = info->next;
-
- qxl_free (qxl->mem, info);
-
- ++i;
- }
- }
-
- return i;
-}
-
static Bool
qxl_blank_screen(ScreenPtr pScreen, int mode)
{
--
1.7.9.3
More information about the Spice-devel
mailing list