1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>drm_gem_get_pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux DRM Developer's Guide"><link rel="up" href="drm-memory-management.html#idp1122600572" title="GEM Function Reference"><link rel="prev" href="API-drm-gem-create-mmap-offset.html" title="drm_gem_create_mmap_offset"><link rel="next" href="API-drm-gem-put-pages.html" title="drm_gem_put_pages"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">drm_gem_get_pages</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-drm-gem-create-mmap-offset.html">Prev</a> </td><th width="60%" align="center">GEM Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="API-drm-gem-put-pages.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-drm-gem-get-pages"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>drm_gem_get_pages — 2 helper to allocate backing pages for a GEM object from shmem 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">struct page ** <b class="fsfunc">drm_gem_get_pages </b>(</code></td><td>struct drm_gem_object * <var class="pdparam">obj</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1122675324"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>obj</code></em></span></dt><dd><p> 4 obj in question 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1122676852"></a><h2>Description</h2><p> 6 This reads the page-array of the shmem-backing storage of the given gem 7 object. An array of pages is returned. If a page is not allocated or 8 swapped-out, this will allocate/swap-in the required pages. Note that the 9 whole object is covered by the page-array and pinned in memory. 10 </p><p> 11 12 Use <code class="function">drm_gem_put_pages</code> to release the array and unpin all pages. 13 </p><p> 14 15 This uses the GFP-mask set on the shmem-mapping (see <code class="function">mapping_set_gfp_mask</code>). 16 If you require other GFP-masks, you have to do those allocations yourself. 17 </p><p> 18 19 Note that you are not allowed to change gfp-zones during runtime. That is, 20 <code class="function">shmem_read_mapping_page_gfp</code> must be called with the same gfp_zone(gfp) as 21 set during initialization. If you have special zone constraints, set them 22 after <code class="function">drm_gem_init_object</code> via <code class="function">mapping_set_gfp_mask</code>. shmem-core takes care 23 to keep pages in the required zone during swap-in. 24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-drm-gem-create-mmap-offset.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="drm-memory-management.html#idp1122600572">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-drm-gem-put-pages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">drm_gem_create_mmap_offset</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">drm_gem_put_pages</span></td></tr></table></div></body></html> 25