Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
radeon_drv.c File Reference
#include <drm/drmP.h>
#include <drm/radeon_drm.h>
#include "radeon_drv.h"
#include <drm/drm_pciids.h>
#include <linux/console.h>
#include <linux/module.h>

Go to the source code of this file.

Macros

#define KMS_DRIVER_MAJOR   2
 
#define KMS_DRIVER_MINOR   24
 
#define KMS_DRIVER_PATCHLEVEL   0
 

Functions

int radeon_driver_load_kms (struct drm_device *dev, unsigned long flags)
 
int radeon_driver_unload_kms (struct drm_device *dev)
 
int radeon_driver_firstopen_kms (struct drm_device *dev)
 
void radeon_driver_lastclose_kms (struct drm_device *dev)
 
int radeon_driver_open_kms (struct drm_device *dev, struct drm_file *file_priv)
 
void radeon_driver_postclose_kms (struct drm_device *dev, struct drm_file *file_priv)
 
void radeon_driver_preclose_kms (struct drm_device *dev, struct drm_file *file_priv)
 
int radeon_suspend_kms (struct drm_device *dev, pm_message_t state)
 
int radeon_resume_kms (struct drm_device *dev)
 
u32 radeon_get_vblank_counter_kms (struct drm_device *dev, int crtc)
 
int radeon_enable_vblank_kms (struct drm_device *dev, int crtc)
 
void radeon_disable_vblank_kms (struct drm_device *dev, int crtc)
 
int radeon_get_vblank_timestamp_kms (struct drm_device *dev, int crtc, int *max_error, struct timeval *vblank_time, unsigned flags)
 
void radeon_driver_irq_preinstall_kms (struct drm_device *dev)
 
int radeon_driver_irq_postinstall_kms (struct drm_device *dev)
 
void radeon_driver_irq_uninstall_kms (struct drm_device *dev)
 
irqreturn_t radeon_driver_irq_handler_kms (DRM_IRQ_ARGS)
 
int radeon_dma_ioctl_kms (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int radeon_gem_object_init (struct drm_gem_object *obj)
 
void radeon_gem_object_free (struct drm_gem_object *obj)
 
int radeon_gem_object_open (struct drm_gem_object *obj, struct drm_file *file_priv)
 
void radeon_gem_object_close (struct drm_gem_object *obj, struct drm_file *file_priv)
 
int radeon_get_crtc_scanoutpos (struct drm_device *dev, int crtc, int *vpos, int *hpos)
 
int radeon_mmap (struct file *filp, struct vm_area_struct *vma)
 
int radeon_mode_dumb_mmap (struct drm_file *filp, struct drm_device *dev, uint32_t handle, uint64_t *offset_p)
 
int radeon_mode_dumb_create (struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args)
 
int radeon_mode_dumb_destroy (struct drm_file *file_priv, struct drm_device *dev, uint32_t handle)
 
struct dma_bufradeon_gem_prime_export (struct drm_device *dev, struct drm_gem_object *obj, int flags)
 
struct drm_gem_object * radeon_gem_prime_import (struct drm_device *dev, struct dma_buf *dma_buf)
 
 MODULE_PARM_DESC (no_wb,"Disable AGP writeback for scratch registers")
 
 module_param_named (no_wb, radeon_no_wb, int, 0444)
 
 MODULE_PARM_DESC (modeset,"Disable/Enable modesetting")
 
 module_param_named (modeset, radeon_modeset, int, 0400)
 
 MODULE_PARM_DESC (dynclks,"Disable/Enable dynamic clocks")
 
 module_param_named (dynclks, radeon_dynclks, int, 0444)
 
 MODULE_PARM_DESC (r4xx_atom,"Enable ATOMBIOS modesetting for R4xx")
 
 module_param_named (r4xx_atom, radeon_r4xx_atom, int, 0444)
 
 MODULE_PARM_DESC (vramlimit,"Restrict VRAM for testing")
 
 module_param_named (vramlimit, radeon_vram_limit, int, 0600)
 
 MODULE_PARM_DESC (agpmode,"AGP Mode (-1 == PCI)")
 
 module_param_named (agpmode, radeon_agpmode, int, 0444)
 
 MODULE_PARM_DESC (gartsize,"Size of PCIE/IGP gart to setup in megabytes (32, 64, etc)")
 
 module_param_named (gartsize, radeon_gart_size, int, 0600)
 
 MODULE_PARM_DESC (benchmark,"Run benchmark")
 
 module_param_named (benchmark, radeon_benchmarking, int, 0444)
 
 MODULE_PARM_DESC (test,"Run tests")
 
 module_param_named (test, radeon_testing, int, 0444)
 
 MODULE_PARM_DESC (connector_table,"Force connector table")
 
 module_param_named (connector_table, radeon_connector_table, int, 0444)
 
 MODULE_PARM_DESC (tv,"TV enable (0 = disable)")
 
 module_param_named (tv, radeon_tv, int, 0444)
 
 MODULE_PARM_DESC (audio,"Audio enable (1 = enable)")
 
 module_param_named (audio, radeon_audio, int, 0444)
 
 MODULE_PARM_DESC (disp_priority,"Display Priority (0 = auto, 1 = normal, 2 = high)")
 
 module_param_named (disp_priority, radeon_disp_priority, int, 0444)
 
 MODULE_PARM_DESC (hw_i2c,"hw i2c engine enable (0 = disable)")
 
 module_param_named (hw_i2c, radeon_hw_i2c, int, 0444)
 
 MODULE_PARM_DESC (pcie_gen2,"PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)")
 
 module_param_named (pcie_gen2, radeon_pcie_gen2, int, 0444)
 
 MODULE_PARM_DESC (msi,"MSI support (1 = enable, 0 = disable, -1 = auto)")
 
 module_param_named (msi, radeon_msi, int, 0444)
 
 MODULE_PARM_DESC (lockup_timeout,"GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)")
 
 module_param_named (lockup_timeout, radeon_lockup_timeout, int, 0444)
 
 module_init (radeon_init)
 
 module_exit (radeon_exit)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL and additional rights")
 

Variables

struct drm_ioctl_desc radeon_ioctls_kms []
 
int radeon_max_kms_ioctl
 
int radeon_no_wb
 
int radeon_modeset = -1
 
int radeon_dynclks = -1
 
int radeon_r4xx_atom = 0
 
int radeon_agpmode = 0
 
int radeon_vram_limit = 0
 
int radeon_gart_size = 512
 
int radeon_benchmarking = 0
 
int radeon_testing = 0
 
int radeon_connector_table = 0
 
int radeon_tv = 1
 
int radeon_audio = 0
 
int radeon_disp_priority = 0
 
int radeon_hw_i2c = 0
 
int radeon_pcie_gen2 = -1
 
int radeon_msi = -1
 
int radeon_lockup_timeout = 10000
 

Detailed Description

ATI Radeon driver

Author
Gareth Hughes garet.nosp@m.h@va.nosp@m.linux.nosp@m..com

Definition in file radeon_drv.c.

Macro Definition Documentation

#define KMS_DRIVER_MAJOR   2

Definition at line 69 of file radeon_drv.c.

#define KMS_DRIVER_MINOR   24

Definition at line 70 of file radeon_drv.c.

#define KMS_DRIVER_PATCHLEVEL   0

Definition at line 71 of file radeon_drv.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
module_exit ( radeon_exit  )
module_init ( radeon_init  )
MODULE_LICENSE ( "GPL and additional rights"  )
module_param_named ( no_wb  ,
radeon_no_wb  ,
int  ,
0444   
)
module_param_named ( modeset  ,
radeon_modeset  ,
int  ,
0400   
)
module_param_named ( dynclks  ,
radeon_dynclks  ,
int  ,
0444   
)
module_param_named ( r4xx_atom  ,
radeon_r4xx_atom  ,
int  ,
0444   
)
module_param_named ( vramlimit  ,
radeon_vram_limit  ,
int  ,
0600   
)
module_param_named ( agpmode  ,
radeon_agpmode  ,
int  ,
0444   
)
module_param_named ( gartsize  ,
radeon_gart_size  ,
int  ,
0600   
)
module_param_named ( benchmark  ,
radeon_benchmarking  ,
int  ,
0444   
)
module_param_named ( test  ,
radeon_testing  ,
int  ,
0444   
)
module_param_named ( connector_table  ,
radeon_connector_table  ,
int  ,
0444   
)
module_param_named ( tv  ,
radeon_tv  ,
int  ,
0444   
)
module_param_named ( audio  ,
radeon_audio  ,
int  ,
0444   
)
module_param_named ( disp_priority  ,
radeon_disp_priority  ,
int  ,
0444   
)
module_param_named ( hw_i2c  ,
radeon_hw_i2c  ,
int  ,
0444   
)
module_param_named ( pcie_gen2  ,
radeon_pcie_gen2  ,
int  ,
0444   
)
module_param_named ( msi  ,
radeon_msi  ,
int  ,
0444   
)
module_param_named ( lockup_timeout  ,
radeon_lockup_timeout  ,
int  ,
0444   
)
MODULE_PARM_DESC ( no_wb  ,
"Disable AGP writeback for scratch registers  
)
MODULE_PARM_DESC ( modeset  ,
"Disable/Enable modesetting"   
)
MODULE_PARM_DESC ( dynclks  ,
"Disable/Enable dynamic clocks"   
)
MODULE_PARM_DESC ( r4xx_atom  ,
"Enable ATOMBIOS modesetting for R4xx"   
)
MODULE_PARM_DESC ( vramlimit  ,
"Restrict VRAM for testing"   
)
MODULE_PARM_DESC ( agpmode  ,
"AGP Mode (-1 == PCI)"   
)
MODULE_PARM_DESC ( gartsize  ,
"Size of PCIE/IGP gart to setup in megabytes (32, 64, etc)"   
)
MODULE_PARM_DESC ( benchmark  ,
"Run benchmark"   
)
MODULE_PARM_DESC ( test  ,
"Run tests"   
)
MODULE_PARM_DESC ( connector_table  ,
"Force connector table  
)
MODULE_PARM_DESC ( tv  ,
"TV enable (0 = disable)"   
)
MODULE_PARM_DESC ( audio  ,
"Audio enable (1 = enable)"   
)
MODULE_PARM_DESC ( disp_priority  ,
"Display Priority (0 = auto, 1 = normal, 2 = high)"   
)
MODULE_PARM_DESC ( hw_i2c  ,
"hw i2c engine enable (0 = disable)"   
)
MODULE_PARM_DESC ( pcie_gen2  ,
"PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)"   
)
MODULE_PARM_DESC ( msi  ,
"MSI support (1 = enable, 0 = disable, -1 = auto)"   
)
MODULE_PARM_DESC ( lockup_timeout  ,
"GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)"   
)
void radeon_disable_vblank_kms ( struct drm_device dev,
int  crtc 
)

radeon_disable_vblank_kms - disable vblank interrupt

: drm dev pointer : crtc to disable vblank interrupt for

Disable the interrupt on the requested crtc (all asics).

Definition at line 562 of file radeon_kms.c.

int radeon_dma_ioctl_kms ( struct drm_device dev,
void data,
struct drm_file *  file_priv 
)

Definition at line 616 of file radeon_kms.c.

int radeon_driver_firstopen_kms ( struct drm_device dev)

radeon_driver_firstopen_kms - drm callback for first open

: drm dev pointer

Nothing to be done for KMS (all asics). Returns 0 on success.

Definition at line 387 of file radeon_kms.c.

irqreturn_t radeon_driver_irq_handler_kms ( DRM_IRQ_ARGS  )

radeon_driver_irq_handler_kms - irq handler for KMS

: args

This is the irq handler for the radeon KMS driver (all asics). radeon_irq_process is a macro that points to the per-asic irq handler callback.

Definition at line 46 of file radeon_irq_kms.c.

int radeon_driver_irq_postinstall_kms ( struct drm_device dev)

radeon_driver_irq_postinstall_kms - drm irq preinstall callback

: drm dev pointer

Handles stuff to be done after enabling irqs (all asics). Returns 0 on success.

Definition at line 123 of file radeon_irq_kms.c.

void radeon_driver_irq_preinstall_kms ( struct drm_device dev)

radeon_driver_irq_preinstall_kms - drm irq preinstall callback

: drm dev pointer

Gets the hw ready to enable irqs (all asics). This function disables all interrupt sources on the GPU.

Definition at line 92 of file radeon_irq_kms.c.

void radeon_driver_irq_uninstall_kms ( struct drm_device dev)

radeon_driver_irq_uninstall_kms - drm irq uninstall callback

: drm dev pointer

This function disables all interrupt sources on the GPU (all asics).

Definition at line 136 of file radeon_irq_kms.c.

void radeon_driver_lastclose_kms ( struct drm_device dev)

radeon_driver_firstopen_kms - drm callback for last close

: drm dev pointer

Switch vga switcheroo state after last close (all asics).

Definition at line 399 of file radeon_kms.c.

int radeon_driver_load_kms ( struct drm_device dev,
unsigned long  flags 
)

radeon_driver_load_kms - Main load function for KMS.

: drm dev pointer : device flags

This is the main load function for KMS (all asics). It calls radeon_device_init() to set up the non-display parts of the chip (asic init, CP, writeback, etc.), and radeon_modeset_init() to set up the display parts (crtcs, encoders, hotplug detect, etc.). Returns 0 on success, error on failure.

Definition at line 74 of file radeon_kms.c.

int radeon_driver_open_kms ( struct drm_device dev,
struct drm_file *  file_priv 
)

radeon_driver_open_kms - drm callback for open

: drm dev pointer : drm file

On device open, init vm on cayman+ (all asics). Returns 0 on success, error on failure.

Definition at line 413 of file radeon_kms.c.

void radeon_driver_postclose_kms ( struct drm_device dev,
struct drm_file *  file_priv 
)

radeon_driver_postclose_kms - drm callback for post close

: drm dev pointer : drm file

On device post close, tear down vm on cayman+ (all asics).

Definition at line 458 of file radeon_kms.c.

void radeon_driver_preclose_kms ( struct drm_device dev,
struct drm_file *  file_priv 
)

radeon_driver_preclose_kms - drm callback for pre close

: drm dev pointer : drm file

On device pre close, tear down hyperz and cmask filps on r1xx-r5xx (all asics).

Definition at line 493 of file radeon_kms.c.

int radeon_driver_unload_kms ( struct drm_device dev)

radeon_driver_unload_kms - Main unload function for KMS.

: drm dev pointer

This is the main unload function for KMS (all asics). It calls radeon_modeset_fini() to tear down the displays, and radeon_device_fini() to tear down the rest of the device (CP, writeback, etc.). Returns 0 on success.

Definition at line 47 of file radeon_kms.c.

int radeon_enable_vblank_kms ( struct drm_device dev,
int  crtc 
)

radeon_enable_vblank_kms - enable vblank interrupt

: drm dev pointer : crtc to enable vblank interrupt for

Enable the interrupt on the requested crtc (all asics). Returns 0 on success, -EINVAL on failure.

Definition at line 536 of file radeon_kms.c.

void radeon_gem_object_close ( struct drm_gem_object *  obj,
struct drm_file *  file_priv 
)

Definition at line 169 of file radeon_gem.c.

void radeon_gem_object_free ( struct drm_gem_object *  obj)

Definition at line 39 of file radeon_gem.c.

int radeon_gem_object_init ( struct drm_gem_object *  obj)

Definition at line 32 of file radeon_gem.c.

int radeon_gem_object_open ( struct drm_gem_object *  obj,
struct drm_file *  file_priv 
)

Definition at line 140 of file radeon_gem.c.

struct dma_buf* radeon_gem_prime_export ( struct drm_device dev,
struct drm_gem_object *  obj,
int  flags 
)
read

Definition at line 164 of file radeon_prime.c.

struct drm_gem_object* radeon_gem_prime_import ( struct drm_device dev,
struct dma_buf dma_buf 
)
read

Definition at line 185 of file radeon_prime.c.

int radeon_get_crtc_scanoutpos ( struct drm_device dev,
int  crtc,
int vpos,
int hpos 
)

Definition at line 1531 of file radeon_display.c.

u32 radeon_get_vblank_counter_kms ( struct drm_device dev,
int  crtc 
)

radeon_get_vblank_counter_kms - get frame count

: drm dev pointer : crtc to get the frame count from

Gets the frame count on the requested crtc (all asics). Returns frame count on success, -EINVAL on failure.

Definition at line 515 of file radeon_kms.c.

int radeon_get_vblank_timestamp_kms ( struct drm_device dev,
int  crtc,
int max_error,
struct timeval vblank_time,
unsigned  flags 
)

radeon_get_vblank_timestamp_kms - get vblank timestamp

: drm dev pointer : crtc to get the timestamp for : max error : time value : flags passed to the driver

Gets the timestamp on the requested crtc based on the scanout position. (all asics). Returns postive status flags on success, negative error on failure.

Definition at line 591 of file radeon_kms.c.

int radeon_mmap ( struct file filp,
struct vm_area_struct vma 
)

Definition at line 804 of file radeon_ttm.c.

int radeon_mode_dumb_create ( struct drm_file *  file_priv,
struct drm_device dev,
struct drm_mode_create_dumb args 
)

Definition at line 542 of file radeon_gem.c.

int radeon_mode_dumb_destroy ( struct drm_file *  file_priv,
struct drm_device dev,
uint32_t  handle 
)

Definition at line 572 of file radeon_gem.c.

int radeon_mode_dumb_mmap ( struct drm_file *  filp,
struct drm_device dev,
uint32_t  handle,
uint64_t offset_p 
)

Definition at line 312 of file radeon_gem.c.

int radeon_resume_kms ( struct drm_device dev)

radeon_resume_kms - initiate device resume

: drm dev pointer

Bring the hw back to operating state (all asics). Returns 0 for success or an error on failure. Called at driver resume.

Definition at line 1243 of file radeon_device.c.

int radeon_suspend_kms ( struct drm_device dev,
pm_message_t  state 
)

radeon_suspend_kms - initiate device suspend

: drm dev pointer : suspend state

Puts the hw in the suspend state (all asics). Returns 0 for success or an error on failure. Called at driver suspend.

Definition at line 1160 of file radeon_device.c.

Variable Documentation

int radeon_agpmode = 0

Definition at line 132 of file radeon_drv.c.

int radeon_audio = 0

Definition at line 139 of file radeon_drv.c.

int radeon_benchmarking = 0

Definition at line 135 of file radeon_drv.c.

Definition at line 137 of file radeon_drv.c.

int radeon_disp_priority = 0

Definition at line 140 of file radeon_drv.c.

int radeon_dynclks = -1

Definition at line 130 of file radeon_drv.c.

int radeon_gart_size = 512

Definition at line 134 of file radeon_drv.c.

int radeon_hw_i2c = 0

Definition at line 141 of file radeon_drv.c.

struct drm_ioctl_desc radeon_ioctls_kms[]

Definition at line 662 of file radeon_kms.c.

int radeon_lockup_timeout = 10000

Definition at line 144 of file radeon_drv.c.

int radeon_max_kms_ioctl

Definition at line 705 of file radeon_kms.c.

int radeon_modeset = -1

Definition at line 129 of file radeon_drv.c.

int radeon_msi = -1

Definition at line 143 of file radeon_drv.c.

int radeon_no_wb

Definition at line 128 of file radeon_drv.c.

int radeon_pcie_gen2 = -1

Definition at line 142 of file radeon_drv.c.

int radeon_r4xx_atom = 0

Definition at line 131 of file radeon_drv.c.

int radeon_testing = 0

Definition at line 136 of file radeon_drv.c.

int radeon_tv = 1

Definition at line 138 of file radeon_drv.c.

int radeon_vram_limit = 0

Definition at line 133 of file radeon_drv.c.