Searched refs:gman (Results 1 - 1 of 1) sorted by relevance

/linux-4.1.27/drivers/gpu/drm/vmwgfx/
H A Dvmwgfx_gmrid_manager.c52 struct vmwgfx_gmrid_man *gman = vmw_gmrid_man_get_node() local
59 spin_lock(&gman->lock); vmw_gmrid_man_get_node()
61 if (gman->max_gmr_pages > 0) { vmw_gmrid_man_get_node()
62 gman->used_gmr_pages += bo->num_pages; vmw_gmrid_man_get_node()
63 if (unlikely(gman->used_gmr_pages > gman->max_gmr_pages)) vmw_gmrid_man_get_node()
68 spin_unlock(&gman->lock); vmw_gmrid_man_get_node()
69 if (unlikely(ida_pre_get(&gman->gmr_ida, GFP_KERNEL) == 0)) { vmw_gmrid_man_get_node()
73 spin_lock(&gman->lock); vmw_gmrid_man_get_node()
75 ret = ida_get_new(&gman->gmr_ida, &id); vmw_gmrid_man_get_node()
76 if (unlikely(ret == 0 && id >= gman->max_gmr_ids)) { vmw_gmrid_man_get_node()
77 ida_remove(&gman->gmr_ida, id); vmw_gmrid_man_get_node()
84 mem->mm_node = gman; vmw_gmrid_man_get_node()
90 spin_unlock(&gman->lock); vmw_gmrid_man_get_node()
94 spin_lock(&gman->lock); vmw_gmrid_man_get_node()
96 gman->used_gmr_pages -= bo->num_pages; vmw_gmrid_man_get_node()
97 spin_unlock(&gman->lock); vmw_gmrid_man_get_node()
104 struct vmwgfx_gmrid_man *gman = vmw_gmrid_man_put_node() local
108 spin_lock(&gman->lock); vmw_gmrid_man_put_node()
109 ida_remove(&gman->gmr_ida, mem->start); vmw_gmrid_man_put_node()
110 gman->used_gmr_pages -= mem->num_pages; vmw_gmrid_man_put_node()
111 spin_unlock(&gman->lock); vmw_gmrid_man_put_node()
121 struct vmwgfx_gmrid_man *gman = vmw_gmrid_man_init() local
122 kzalloc(sizeof(*gman), GFP_KERNEL); vmw_gmrid_man_init()
124 if (unlikely(gman == NULL)) vmw_gmrid_man_init()
127 spin_lock_init(&gman->lock); vmw_gmrid_man_init()
128 gman->used_gmr_pages = 0; vmw_gmrid_man_init()
129 ida_init(&gman->gmr_ida); vmw_gmrid_man_init()
133 gman->max_gmr_ids = dev_priv->max_gmr_ids; vmw_gmrid_man_init()
134 gman->max_gmr_pages = dev_priv->max_gmr_pages; vmw_gmrid_man_init()
137 gman->max_gmr_ids = VMWGFX_NUM_MOB; vmw_gmrid_man_init()
138 gman->max_gmr_pages = dev_priv->max_mob_pages; vmw_gmrid_man_init()
143 man->priv = (void *) gman; vmw_gmrid_man_init()
149 struct vmwgfx_gmrid_man *gman = vmw_gmrid_man_takedown() local
152 if (gman) { vmw_gmrid_man_takedown()
153 ida_destroy(&gman->gmr_ida); vmw_gmrid_man_takedown()
154 kfree(gman); vmw_gmrid_man_takedown()

Completed in 96 milliseconds