---
name: "drm_prime_sg_to_page_addr_arrays"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/drm_prime_sg_to_page_addr_arrays"
---

# drm\_prime\_sg\_to\_page\_addr\_arrays(9)

convert an sg table into a page array

## NAME

drm\_prime\_sg\_to\_page\_addr\_arrays - convert an sg table into a page array

## SYNOPSIS

**int drm\_prime\_sg\_to\_page\_addr\_arrays(struct sg\_table \*** *sgt***, struct page \*\*** *pages***, dma\_addr\_t \*** *addrs***, int** *max\_pages***);**

## ARGUMENTS

*sgt*

scatter-gather table to convert

*pages*

array of page pointers to store the page array in

*addrs*

optional array to store the dma bus address of each page

*max\_pages*

size of both the passed-in arrays

## DESCRIPTION

Exports an sg table into an array of pages and addresses. This is currently required by the TTM driver in order to do correct fault handling.

## AUTHORS

**Jesse Barnes** \<jesse.barnes@intel.com\>\
 Intel Corporation,

Initial version

**Laurent Pinchart** \<laurent.pinchart@ideasonboard.com\>\
 Ideas on board SPRL,

Driver internals

**Daniel Vetter** \<daniel.vetter@ffwll.ch\>\
 Intel Corporation,

Contributions all over the place

## COPYRIGHT
