Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gtt.c File Reference
#include <drm/drmP.h>
#include <linux/shmem_fs.h>
#include "psb_drv.h"

Go to the source code of this file.


void psb_gtt_roll (struct drm_device *dev, struct gtt_range *r, int roll)
int psb_gtt_pin (struct gtt_range *gt)
void psb_gtt_unpin (struct gtt_range *gt)
: resource name

psb_gtt_alloc_range - allocate GTT address space : Our DRM device : length (bytes) of address space required

: resource should be backed by stolen pages

Ask the kernel core to find us a suitable range of addresses to use for a GTT mapping.

Returns a gtt_range structure describing the object, or NULL on error. On successful return the resource is both allocated and marked as in use.

struct gtt_rangepsb_gtt_alloc_range (struct drm_device *dev, int len, const char *name, int backed)
void psb_gtt_free_range (struct drm_device *dev, struct gtt_range *gt)
void psb_gtt_takedown (struct drm_device *dev)
int psb_gtt_init (struct drm_device *dev, int resume)

Function Documentation

struct gtt_range* psb_gtt_alloc_range ( struct drm_device dev,
int  len,
const char name,
int  backed 

Definition at line 330 of file gtt.c.

void psb_gtt_free_range ( struct drm_device dev,
struct gtt_range gt 

psb_gtt_free_range - release GTT address space : our DRM device : a mapping created with psb_gtt_alloc_range

Release a resource that was allocated with psb_gtt_alloc_range. If the object has been pinned by mmap users we clean this up here currently.

Definition at line 376 of file gtt.c.

int psb_gtt_init ( struct drm_device dev,
int  resume 

Definition at line 412 of file gtt.c.

int psb_gtt_pin ( struct gtt_range gt)

psb_gtt_pin - pin pages into the GTT : range to pin

Pin a set of pages into the GTT. The pins are refcounted so that multiple pins need multiple unpins to undo.

Non GEM backed objects treat this as a no-op as they are always GTT backed objects.

Definition at line 260 of file gtt.c.

void psb_gtt_roll ( struct drm_device dev,
struct gtt_range r,
int  roll 

psb_gtt_roll - set scrolling position : our DRM device : the gtt mapping we are using : roll offset

Roll an existing pinned mapping by moving the pages through the GTT. This allows us to implement hardware scrolling on the consoles without a 2D engine

Definition at line 155 of file gtt.c.

void psb_gtt_takedown ( struct drm_device dev)

Definition at line 394 of file gtt.c.

void psb_gtt_unpin ( struct gtt_range gt)

psb_gtt_unpin - Drop a GTT pin requirement : range to pin

Undoes the effect of psb_gtt_pin. On the last drop the GEM object will be removed from the GTT which will also drop the page references and allow the VM to clean up or page stuff.

Non GEM backed objects treat this as a no-op as they are always GTT backed objects.

Definition at line 295 of file gtt.c.