mm = >t_mm->base;
- /*will use tt_start ~ 128M for IMG TT buffers*/
+ /* will use tt_start ~ 128M for IMG TT buffers */
ret = drm_mm_init(mm, tt_start, ((tt_size / 2) - tt_start));
if (ret) {
DRM_DEBUG("drm_mm_int error(%d)\n", ret);
}
*/
- /*Insert the given entry*/
+ /* Insert the given entry */
ret = drm_ht_insert_item(&mm->hash, item);
if (ret) {
DRM_DEBUG("Insert failure\n");
struct psb_gtt_hash_entry *hentry;
int ret;
- /*if the hentry for this tgid exists, just get it and return*/
+ /* if the hentry for this tgid exists, just get it and return */
spin_lock(&mm->lock);
hentry = psb_gtt_mm_get_ht_by_pid_locked(mm, tgid);
if (!IS_ERR(hentry)) {
return NULL;
}
- /*remove it from ht*/
+ /* remove it from ht */
drm_ht_remove_item(&mm->hash, &tmp->item);
mm->count--;
return -EINVAL;
}
- /*delete ht*/
+ /* delete ht */
drm_ht_remove(&entry->ht);
- /*free this entry*/
+ /* free this entry */
kfree(entry);
return 0;
}
return ERR_PTR(-EINVAL);
}
- /*try to get this mem_map */
+ /* try to get this mem_map */
spin_lock(&mm->lock);
mapping = psb_gtt_mm_get_mem_mapping_locked(ht, key);
if (!IS_ERR(mapping)) {
}
spin_unlock(&mm->lock);
- /*remove mapping entry*/
+ /* remove mapping entry */
spin_lock(&mm->lock);
tmp = psb_gtt_mm_remove_free_mem_mapping_locked(&hentry->ht, key);
if (IS_ERR(tmp)) {
return ERR_CAST(tmp);
}
- /*check the count of mapping entry*/
+ /* check the count of mapping entry */
if (!hentry->count) {
DRM_DEBUG("count of mapping entry is zero, tgid=%u\n", tgid);
psb_gtt_mm_remove_free_ht_locked(mm, tgid);
if (!kmem)
DRM_DEBUG("kmem is NULL");
- /*get pages*/
+ /* get pages */
ret = psb_get_pages_by_mem_handle(psKernelMemInfo->sMemBlk.hOSMemHandle,
&page_list);
if (ret) {
DRM_DEBUG("get %u pages\n", pages);
- /*alloc memory in TT apeture*/
+ /* alloc memory in TT apeture */
node = psb_gtt_mm_alloc_mem(mm, pages, 0);
if (IS_ERR(node)) {
DRM_DEBUG("alloc TT memory error\n");
goto failed_pages_alloc;
}
- /*update psb_gtt_mm*/
+ /* update psb_gtt_mm */
mapping = psb_gtt_add_node(mm, psb_get_tgid(), (u32) hKernelMemInfo,
node);
if (IS_ERR(mapping)) {
DRM_DEBUG("get free node for %u pages, offset %u pages",
pages, offset_pages);
- /*update gtt*/
+ /* update gtt */
psb_gtt_insert_pages(pg, page_list, offset_pages, pages, 0, 0, 0);
*offset = offset_pages;
return PTR_ERR(node);
}
- /*remove gtt entries*/
+ /* remove gtt entries */
offset_pages = node->start;
pages = node->size;
psb_gtt_remove_pages(pg, offset_pages, pages, 0, 0);
- /*free tt node*/
+ /* free tt node */
psb_gtt_mm_free_mem(mm, node);
return 0;
size = ui32PagesNum * PAGE_SIZE;
pages = 0;
- /*alloc memory in TT apeture*/
+ /* alloc memory in TT apeture */
node = psb_gtt_mm_alloc_mem(mm, ui32PagesNum, ui32Align);
if (IS_ERR(node)) {
DRM_DEBUG("alloc TT memory error\n");
goto failed_pages_alloc;
}
- /*update psb_gtt_mm*/
+ /* update psb_gtt_mm */
mapping = psb_gtt_add_node(mm, ui32TaskId, (u32) hHandle, node);
if (IS_ERR(mapping)) {
DRM_DEBUG("add_node failed");
DRM_DEBUG("get free node for %u pages, offset %u pages", pages, offset_pages);
- /*update gtt*/
+ /* update gtt */
psb_gtt_insert_phys_addresses(pg, pPages, offset_pages,
ui32PagesNum, 0);
return PTR_ERR(node);
}
- /*remove gtt entries*/
+ /* remove gtt entries */
offset_pages = node->start;
pages = node->size;
psb_gtt_remove_pages(pg, offset_pages, pages, 0, 0);
- /*free tt node*/
+ /* free tt node */
psb_gtt_mm_free_mem(mm, node);
return 0;
}