---
name: "drm_gem_prime_fd_to_handle"
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_gem_prime_fd_to_handle"
---

# drm\_gem\_prime\_fd\_to\_handle(9)

PRIME import function for GEM drivers

## NAME

drm\_gem\_prime\_fd\_to\_handle - PRIME import function for GEM drivers

## SYNOPSIS

**int drm\_gem\_prime\_fd\_to\_handle(struct drm\_device \*** *dev***, struct drm\_file \*** *file\_priv***, int** *prime\_fd***, uint32\_t \*** *handle***);**

## ARGUMENTS

*dev*

dev to export the buffer from

*file\_priv*

drm file-private structure

*prime\_fd*

fd id of the dma-buf which should be imported

*handle*

pointer to storage for the handle of the imported buffer object

## DESCRIPTION

This is the PRIME import function which must be used mandatorily by GEM drivers to ensure correct lifetime management of the underlying GEM object. The actual importing of GEM object from the dma-buf is done through the gem\_import\_export driver callback.

## 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
