---
name: "drm_gem_prime_handle_to_fd"
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_handle_to_fd"
---

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

PRIME export function for GEM drivers

## NAME

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

## SYNOPSIS

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

## ARGUMENTS

*dev*

dev to export the buffer from

*file\_priv*

drm file-private structure

*handle*

buffer handle to export

*flags*

flags like DRM\_CLOEXEC

*prime\_fd*

pointer to storage for the fd id of the create dma-buf

## DESCRIPTION

This is the PRIME export function which must be used mandatorily by GEM drivers to ensure correct lifetime management of the underlying GEM object. The actual exporting from GEM object to a dma-buf is done through the gem\_prime\_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
