XenevaOS
Loading...
Searching...
No Matches
Public Attributes | List of all members
drm_gem_object_funcs Struct Reference

#include <drm_gem.h>

Collaboration diagram for drm_gem_object_funcs:
Collaboration graph
[legend]

Public Attributes

void(* free )(struct drm_gem_object *obj)
 
int(* open )(struct drm_gem_object *obj, struct drm_file *file)
 
void(* close )(struct drm_gem_object *obj, struct drm_file *file)
 
void(* print_info )(struct drm_printer *p, unsigned int indent, const struct drm_gem_object *obj)
 
struct dma_buf *(* export )(struct drm_gem_object *obj, int flags)
 
int(* pin )(struct drm_gem_object *obj)
 
void(* unpin )(struct drm_gem_object *obj)
 
struct sg_table *(* get_sg_table )(struct drm_gem_object *obj)
 
int(* vmap )(struct drm_gem_object *obj, struct iosys_map *map)
 
void(* vunmap )(struct drm_gem_object *obj, struct iosys_map *map)
 
int(* mmap )(struct drm_gem_object *obj, struct vm_area_struct *vma)
 
int(* evict )(struct drm_gem_object *obj)
 
enum drm_gem_object_status(* status )(struct drm_gem_object *obj)
 
size_t(* rss )(struct drm_gem_object *obj)
 
const struct vm_operations_struct * vm_ops
 

Detailed Description

struct drm_gem_object_funcs - GEM object functions

Member Data Documentation

◆ close

void(* drm_gem_object_funcs::close) (struct drm_gem_object *obj, struct drm_file *file)

@close:

Called upon GEM handle release.

This callback is optional.

◆ evict

int(* drm_gem_object_funcs::evict) (struct drm_gem_object *obj)

@evict:

Evicts gem object out from memory. Used by the drm_gem_object_evict() helper. Returns 0 on success, -errno otherwise. Called with a held GEM reservation lock.

This callback is optional.

◆ export

struct dma_buf *(* drm_gem_object_funcs::export) (struct drm_gem_object *obj, int flags)

@export:

Export backing buffer as a &dma_buf. If this is not set drm_gem_prime_export() is used.

This callback is optional.

◆ free

void(* drm_gem_object_funcs::free) (struct drm_gem_object *obj)

@free:

Deconstructor for drm_gem_objects.

This callback is mandatory.

◆ get_sg_table

struct sg_table *(* drm_gem_object_funcs::get_sg_table) (struct drm_gem_object *obj)

@get_sg_table:

Returns a Scatter-Gather table representation of the buffer. Used when exporting a buffer by the drm_gem_map_dma_buf() helper. Releasing is done by calling dma_unmap_sg_attrs() and sg_free_table() in drm_gem_unmap_buf(), therefore these helpers and this callback here cannot be used for sg tables pointing at driver private memory ranges.

See also drm_prime_pages_to_sg().

◆ mmap

int(* drm_gem_object_funcs::mmap) (struct drm_gem_object *obj, struct vm_area_struct *vma)

@mmap:

Handle mmap() of the gem object, setup vma accordingly.

This callback is optional.

The callback is used by both drm_gem_mmap_obj() and drm_gem_prime_mmap(). When @mmap is present @vm_ops is not used, the @mmap callback must set vma->vm_ops instead.

◆ open

int(* drm_gem_object_funcs::open) (struct drm_gem_object *obj, struct drm_file *file)

@open:

Called upon GEM handle creation.

This callback is optional.

◆ pin

int(* drm_gem_object_funcs::pin) (struct drm_gem_object *obj)

@pin:

Pin backing buffer in memory, such that dma-buf importers can access it. Used by the drm_gem_map_attach() helper.

This callback is optional.

◆ print_info

void(* drm_gem_object_funcs::print_info) (struct drm_printer *p, unsigned int indent, const struct drm_gem_object *obj)

@print_info:

If driver subclasses struct &drm_gem_object, it can implement this optional hook for printing additional driver specific info.

drm_printf_indent() should be used in the callback passing it the indent argument.

This callback is called from drm_gem_print_info().

This callback is optional.

◆ rss

size_t(* drm_gem_object_funcs::rss) (struct drm_gem_object *obj)

@rss:

Return resident size of the object in physical memory.

Called by drm_show_memory_stats().

◆ status

enum drm_gem_object_status(* drm_gem_object_funcs::status) (struct drm_gem_object *obj)

@status:

The optional status callback can return additional object state which determines which stats the object is counted against. The callback is called under table_lock. Racing against object status change is "harmless", and the callback can expect to not race against object destruction.

Called by drm_show_memory_stats().

◆ unpin

void(* drm_gem_object_funcs::unpin) (struct drm_gem_object *obj)

@unpin:

Unpin backing buffer. Used by the drm_gem_map_detach() helper.

This callback is optional.

◆ vm_ops

const struct vm_operations_struct* drm_gem_object_funcs::vm_ops

@vm_ops:

Virtual memory operations used with mmap.

This is optional but necessary for mmap support.

◆ vmap

int(* drm_gem_object_funcs::vmap) (struct drm_gem_object *obj, struct iosys_map *map)

@vmap:

Returns a virtual address for the buffer. Used by the drm_gem_dmabuf_vmap() helper. Called with a held GEM reservation lock.

This callback is optional.

◆ vunmap

void(* drm_gem_object_funcs::vunmap) (struct drm_gem_object *obj, struct iosys_map *map)

@vunmap:

Releases the address previously returned by @vmap. Used by the drm_gem_dmabuf_vunmap() helper. Called with a held GEM reservation lock.

This callback is optional.


The documentation for this struct was generated from the following file: