Lines Matching defs:sg
972 * drm_prime_pages_to_sg - converts a page array into an sg list
976 * This helper creates an sg table object from a set of pages
984 struct sg_table *sg = NULL;
987 sg = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
988 if (!sg) {
993 ret = sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
998 return sg;
1000 kfree(sg);
1141 struct sg_table *sg;
1144 sg = kmalloc(sizeof(*sg), GFP_KERNEL);
1145 if (sg == NULL) {
1150 ret = sg_alloc_table_from_bus_dmamem(sg, dmat, segs, nsegs,
1155 return sg;
1157 kfree(sg);
1162 drm_prime_sg_size(struct sg_table *sg)
1165 return sg->sgl->sg_npgs << PAGE_SHIFT;
1169 drm_prime_sg_free(struct sg_table *sg)
1172 sg_free_table(sg);
1173 kfree(sg);
1232 * drm_prime_sg_to_page_addr_arrays - convert an sg table into a page array
1238 * Exports an sg table into an array of pages and addresses. This is currently
1248 struct scatterlist *sg;
1254 for_each_sg(sgt->sgl, sg, sgt->nents, count) {
1255 len = sg->length;
1256 page = sg_page(sg);
1257 addr = sg_dma_address(sg);
1282 * @sg: the sg-table which was pinned at import time
1287 void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg)
1292 if (sg)
1293 dma_buf_unmap_attachment(attach, sg, DMA_BIDIRECTIONAL);