static void tegra_bo_free(struct drm_device *drm, struct tegra_bo *bo) { if (bo->pages) { drm_gem_put_pages(&bo->gem, bo->pages, true, true); sg_free_table(bo->sgt); kfree(bo->sgt); } else if (bo->vaddr) { dma_free_wc(drm->dev, bo->gem.size, bo->vaddr, bo->paddr); } }
/** * vsp1_dl_body_pool_destroy - Release a body pool * @pool: The body pool * * Release all components of a pool allocation. */ void vsp1_dl_body_pool_destroy(struct vsp1_dl_body_pool *pool) { if (!pool) return; if (pool->mem) dma_free_wc(pool->vsp1->bus_master, pool->size, pool->mem, pool->dma); kfree(pool->bodies); kfree(pool); }
/** * drm_gem_cma_free_object - free resources associated with a CMA GEM object * @gem_obj: GEM object to free * * This function frees the backing memory of the CMA GEM object, cleans up the * GEM object state and frees the memory used to store the object itself. * Drivers using the CMA helpers should set this as their DRM driver's * ->gem_free_object() callback. */ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj) { struct drm_gem_cma_object *cma_obj; cma_obj = to_drm_gem_cma_obj(gem_obj); if (cma_obj->vaddr) { dma_free_wc(gem_obj->dev->dev, cma_obj->base.size, cma_obj->vaddr, cma_obj->paddr); } else if (gem_obj->import_attach) { drm_prime_gem_destroy(gem_obj, cma_obj->sgt); } drm_gem_object_release(gem_obj); kfree(cma_obj); }
/* * Clean up push buffer resources */ static void host1x_pushbuffer_destroy(struct push_buffer *pb) { struct host1x_cdma *cdma = pb_to_cdma(pb); struct host1x *host1x = cdma_to_host1x(cdma); if (!pb->mapped) return; if (host1x->domain) { iommu_unmap(host1x->domain, pb->dma, pb->alloc_size); free_iova(&host1x->iova, iova_pfn(&host1x->iova, pb->dma)); } dma_free_wc(host1x->dev, pb->alloc_size, pb->mapped, pb->phys); pb->mapped = NULL; pb->phys = 0; }
static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm) { struct snd_pcm_substream *substream; struct snd_dma_buffer *buf; int stream; for (stream = 0; stream < 2; stream++) { substream = pcm->streams[stream].substream; if (!substream) continue; buf = &substream->dma_buffer; if (!buf->area) continue; dma_free_wc(pcm->card->dev, buf->bytes, buf->area, buf->addr); buf->area = NULL; } }
/* * Cleanup a display list body and free allocated DMA memory allocated. */ static void vsp1_dl_body_cleanup(struct vsp1_dl_body *dlb) { dma_free_wc(dlb->vsp1->dev, dlb->size, dlb->entries, dlb->dma); }
static inline void nuc900fb_unmap_video_memory(struct fb_info *info) { struct nuc900fb_info *fbi = info->par; dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len), info->screen_base, info->fix.smem_start); }
static void lpc32xx_clcd_remove(struct clcd_fb *fb) { dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base, fb->fb.fix.smem_start); }