diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-12 15:39:42 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-13 17:41:02 +0100 |
commit | c221d0356db57c10f5d29ca17fdf592724b35385 (patch) | |
tree | b0d9cc8339122fab1523d5b8bd50ccdc9af128c8 | |
parent | 644b1a903301531e1fb59f27952c15e87888c4c6 (diff) |
sna/dri: Remove the unused id/type members for Resource tracking
...and reduce it to a simple list.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 40c9875f..b3b029c8 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -93,12 +93,6 @@ struct sna_dri_private { struct kgem_bo *bo; }; -struct sna_dri_resource { - XID id; - RESTYPE type; - struct list list; -}; - struct sna_dri_frame_event { struct sna *sna; XID drawable_id; @@ -541,10 +535,10 @@ sna_dri_get_pipe(DrawablePtr pDraw) static RESTYPE frame_event_client_type, frame_event_drawable_type; -static struct sna_dri_resource * +static struct list * get_resource(XID id, RESTYPE type) { - struct sna_dri_resource *resource; + struct list *resource; void *ptr; ptr = NULL; @@ -563,22 +557,20 @@ get_resource(XID id, RESTYPE type) return NULL; } - resource->id = id; - resource->type = type; - list_init(&resource->list); + list_init(resource); return resource; } static int sna_dri_frame_event_client_gone(void *data, XID id) { - struct sna_dri_resource *resource = data; + struct list *resource = data; DBG(("%s(%ld)\n", __FUNCTION__, (long)id)); - while (!list_is_empty(&resource->list)) { + while (!list_is_empty(resource)) { struct sna_dri_frame_event *info = - list_first_entry(&resource->list, + list_first_entry(resource, struct sna_dri_frame_event, client_resource); @@ -593,13 +585,13 @@ sna_dri_frame_event_client_gone(void *data, XID id) static int sna_dri_frame_event_drawable_gone(void *data, XID id) { - struct sna_dri_resource *resource = data; + struct list *resource = data; DBG(("%s(%ld)\n", __FUNCTION__, (long)id)); - while (!list_is_empty(&resource->list)) { + while (!list_is_empty(resource)) { struct sna_dri_frame_event *info = - list_first_entry(&resource->list, + list_first_entry(resource, struct sna_dri_frame_event, drawable_resource); @@ -646,7 +638,7 @@ get_client_id(ClientPtr client) static Bool sna_dri_add_frame_event(struct sna_dri_frame_event *info) { - struct sna_dri_resource *resource; + struct list *resource; resource = get_resource(get_client_id(info->client), frame_event_client_type); @@ -655,7 +647,7 @@ sna_dri_add_frame_event(struct sna_dri_frame_event *info) return FALSE; } - list_add(&info->client_resource, &resource->list); + list_add(&info->client_resource, resource); resource = get_resource(info->drawable_id, frame_event_drawable_type); if (resource == NULL) { @@ -664,7 +656,7 @@ sna_dri_add_frame_event(struct sna_dri_frame_event *info) return FALSE; } - list_add(&info->drawable_resource, &resource->list); + list_add(&info->drawable_resource, resource); return TRUE; } |