Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
r100.c File Reference
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <drm/drmP.h>
#include <drm/radeon_drm.h>
#include "radeon_reg.h"
#include "radeon.h"
#include "radeon_asic.h"
#include "r100d.h"
#include "rs100d.h"
#include "rv200d.h"
#include "rv250d.h"
#include "atom.h"
#include <linux/firmware.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include "r100_reg_safe.h"
#include "rn50_reg_safe.h"
#include "r100_track.h"

Go to the source code of this file.

Macros

#define FIRMWARE_R100   "radeon/R100_cp.bin"
 
#define FIRMWARE_R200   "radeon/R200_cp.bin"
 
#define FIRMWARE_R300   "radeon/R300_cp.bin"
 
#define FIRMWARE_R420   "radeon/R420_cp.bin"
 
#define FIRMWARE_RS690   "radeon/RS690_cp.bin"
 
#define FIRMWARE_RS600   "radeon/RS600_cp.bin"
 
#define FIRMWARE_R520   "radeon/R520_cp.bin"
 

Functions

 MODULE_FIRMWARE (FIRMWARE_R100)
 
 MODULE_FIRMWARE (FIRMWARE_R200)
 
 MODULE_FIRMWARE (FIRMWARE_R300)
 
 MODULE_FIRMWARE (FIRMWARE_R420)
 
 MODULE_FIRMWARE (FIRMWARE_RS690)
 
 MODULE_FIRMWARE (FIRMWARE_RS600)
 
 MODULE_FIRMWARE (FIRMWARE_R520)
 
void r100_wait_for_vblank (struct radeon_device *rdev, int crtc)
 
void r100_pre_page_flip (struct radeon_device *rdev, int crtc)
 
void r100_post_page_flip (struct radeon_device *rdev, int crtc)
 
u32 r100_page_flip (struct radeon_device *rdev, int crtc_id, u64 crtc_base)
 
void r100_pm_get_dynpm_state (struct radeon_device *rdev)
 
void r100_pm_init_profile (struct radeon_device *rdev)
 
void r100_pm_misc (struct radeon_device *rdev)
 
void r100_pm_prepare (struct radeon_device *rdev)
 
void r100_pm_finish (struct radeon_device *rdev)
 
bool r100_gui_idle (struct radeon_device *rdev)
 
bool r100_hpd_sense (struct radeon_device *rdev, enum radeon_hpd_id hpd)
 
void r100_hpd_set_polarity (struct radeon_device *rdev, enum radeon_hpd_id hpd)
 
void r100_hpd_init (struct radeon_device *rdev)
 
void r100_hpd_fini (struct radeon_device *rdev)
 
void r100_pci_gart_tlb_flush (struct radeon_device *rdev)
 
int r100_pci_gart_init (struct radeon_device *rdev)
 
int r100_pci_gart_enable (struct radeon_device *rdev)
 
void r100_pci_gart_disable (struct radeon_device *rdev)
 
int r100_pci_gart_set_page (struct radeon_device *rdev, int i, uint64_t addr)
 
void r100_pci_gart_fini (struct radeon_device *rdev)
 
int r100_irq_set (struct radeon_device *rdev)
 
void r100_irq_disable (struct radeon_device *rdev)
 
int r100_irq_process (struct radeon_device *rdev)
 
u32 r100_get_vblank_counter (struct radeon_device *rdev, int crtc)
 
void r100_fence_ring_emit (struct radeon_device *rdev, struct radeon_fence *fence)
 
void r100_semaphore_ring_emit (struct radeon_device *rdev, struct radeon_ring *ring, struct radeon_semaphore *semaphore, bool emit_wait)
 
int r100_copy_blit (struct radeon_device *rdev, uint64_t src_offset, uint64_t dst_offset, unsigned num_gpu_pages, struct radeon_fence **fence)
 
void r100_ring_start (struct radeon_device *rdev, struct radeon_ring *ring)
 
int r100_cp_init (struct radeon_device *rdev, unsigned ring_size)
 
void r100_cp_fini (struct radeon_device *rdev)
 
void r100_cp_disable (struct radeon_device *rdev)
 
int r100_reloc_pitch_offset (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt, unsigned idx, unsigned reg)
 
int r100_packet3_load_vbpntr (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt, int idx)
 
int r100_cs_parse_packet0 (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt, const unsigned *auth, unsigned n, radeon_packet0_check_t check)
 
void r100_cs_dump_packet (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt)
 
int r100_cs_packet_parse (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt, unsigned idx)
 
int r100_cs_packet_parse_vline (struct radeon_cs_parser *p)
 
int r100_cs_packet_next_reloc (struct radeon_cs_parser *p, struct radeon_cs_reloc **cs_reloc)
 
int r100_cs_track_check_pkt3_indx_buffer (struct radeon_cs_parser *p, struct radeon_cs_packet *pkt, struct radeon_bo *robj)
 
int r100_cs_parse (struct radeon_cs_parser *p)
 
int r100_cs_track_check (struct radeon_device *rdev, struct r100_cs_track *track)
 
void r100_cs_track_clear (struct radeon_device *rdev, struct r100_cs_track *track)
 
int r100_gui_wait_for_idle (struct radeon_device *rdev)
 
int r100_mc_wait_for_idle (struct radeon_device *rdev)
 
bool r100_gpu_is_lockup (struct radeon_device *rdev, struct radeon_ring *ring)
 
void r100_enable_bm (struct radeon_device *rdev)
 
void r100_bm_disable (struct radeon_device *rdev)
 
int r100_asic_reset (struct radeon_device *rdev)
 
void r100_set_common_regs (struct radeon_device *rdev)
 
void r100_vram_init_sizes (struct radeon_device *rdev)
 
void r100_vga_set_state (struct radeon_device *rdev, bool state)
 
void r100_pll_errata_after_index (struct radeon_device *rdev)
 
uint32_t r100_pll_rreg (struct radeon_device *rdev, uint32_t reg)
 
void r100_pll_wreg (struct radeon_device *rdev, uint32_t reg, uint32_t v)
 
int r100_debugfs_rbbm_init (struct radeon_device *rdev)
 
int r100_debugfs_cp_init (struct radeon_device *rdev)
 
int r100_debugfs_mc_info_init (struct radeon_device *rdev)
 
int r100_set_surface_reg (struct radeon_device *rdev, int reg, uint32_t tiling_flags, uint32_t pitch, uint32_t offset, uint32_t obj_size)
 
void r100_clear_surface_reg (struct radeon_device *rdev, int reg)
 
void r100_bandwidth_update (struct radeon_device *rdev)
 
int r100_ring_test (struct radeon_device *rdev, struct radeon_ring *ring)
 
void r100_ring_ib_execute (struct radeon_device *rdev, struct radeon_ib *ib)
 
int r100_ib_test (struct radeon_device *rdev, struct radeon_ring *ring)
 
void r100_mc_stop (struct radeon_device *rdev, struct r100_mc_save *save)
 
void r100_mc_resume (struct radeon_device *rdev, struct r100_mc_save *save)
 
void r100_vga_render_disable (struct radeon_device *rdev)
 
int r100_resume (struct radeon_device *rdev)
 
int r100_suspend (struct radeon_device *rdev)
 
void r100_fini (struct radeon_device *rdev)
 
void r100_restore_sanity (struct radeon_device *rdev)
 
int r100_init (struct radeon_device *rdev)
 
uint32_t r100_mm_rreg (struct radeon_device *rdev, uint32_t reg)
 
void r100_mm_wreg (struct radeon_device *rdev, uint32_t reg, uint32_t v)
 
u32 r100_io_rreg (struct radeon_device *rdev, u32 reg)
 
void r100_io_wreg (struct radeon_device *rdev, u32 reg, u32 v)
 

Macro Definition Documentation

#define FIRMWARE_R100   "radeon/R100_cp.bin"

Definition at line 49 of file r100.c.

#define FIRMWARE_R200   "radeon/R200_cp.bin"

Definition at line 50 of file r100.c.

#define FIRMWARE_R300   "radeon/R300_cp.bin"

Definition at line 51 of file r100.c.

#define FIRMWARE_R420   "radeon/R420_cp.bin"

Definition at line 52 of file r100.c.

#define FIRMWARE_R520   "radeon/R520_cp.bin"

Definition at line 55 of file r100.c.

#define FIRMWARE_RS600   "radeon/RS600_cp.bin"

Definition at line 54 of file r100.c.

#define FIRMWARE_RS690   "radeon/RS690_cp.bin"

Definition at line 53 of file r100.c.

Function Documentation

MODULE_FIRMWARE ( FIRMWARE_R100  )
MODULE_FIRMWARE ( FIRMWARE_R200  )
MODULE_FIRMWARE ( FIRMWARE_R300  )
MODULE_FIRMWARE ( FIRMWARE_R420  )
MODULE_FIRMWARE ( FIRMWARE_RS690  )
MODULE_FIRMWARE ( FIRMWARE_RS600  )
MODULE_FIRMWARE ( FIRMWARE_R520  )
int r100_asic_reset ( struct radeon_device rdev)

Definition at line 2620 of file r100.c.

void r100_bandwidth_update ( struct radeon_device rdev)

Definition at line 3205 of file r100.c.

void r100_bm_disable ( struct radeon_device rdev)

Definition at line 2603 of file r100.c.

void r100_clear_surface_reg ( struct radeon_device rdev,
int  reg 
)

Definition at line 3199 of file r100.c.

int r100_copy_blit ( struct radeon_device rdev,
uint64_t  src_offset,
uint64_t  dst_offset,
unsigned  num_gpu_pages,
struct radeon_fence **  fence 
)

Definition at line 853 of file r100.c.

void r100_cp_disable ( struct radeon_device rdev)

Definition at line 1190 of file r100.c.

void r100_cp_fini ( struct radeon_device rdev)

Definition at line 1178 of file r100.c.

int r100_cp_init ( struct radeon_device rdev,
unsigned  ring_size 
)

Definition at line 1055 of file r100.c.

void r100_cs_dump_packet ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt 
)

Definition at line 1358 of file r100.c.

int r100_cs_packet_next_reloc ( struct radeon_cs_parser p,
struct radeon_cs_reloc **  cs_reloc 
)

r100_cs_packet_next_reloc() - parse next packet which should be reloc packet3 : parser structure holding parsing context. : pointer to relocation data : starting offset : offset mask (to align start offset on) : reloc informations

Check next packet is relocation packet3, do bo validation and compute GPU offset using the provided start.

Definition at line 1520 of file r100.c.

int r100_cs_packet_parse ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt,
unsigned  idx 
)

r100_cs_packet_parse() - parse cp packet and point ib index to next packet : parser structure holding parsing context. : where to store packet informations

Assume that chunk_ib_index is properly set. Will return -EINVAL if packet is bigger than remaining ib size. or if packets is unknown.

Definition at line 1380 of file r100.c.

int r100_cs_packet_parse_vline ( struct radeon_cs_parser p)

r100_cs_packet_next_vline() - parse userspace VLINE packet : parser structure holding parsing context.

Userspace sends a special sequence for VLINE waits. PACKET0 - VLINE_START_END + value PACKET0 - WAIT_UNTIL +_value RELOC (P3) - crtc_id in reloc.

This function parses this and relocates the VLINE START END and WAIT UNTIL packets to the correct crtc. It also detects a switched off crtc and nulls out the wait in that case.

Definition at line 1433 of file r100.c.

int r100_cs_parse ( struct radeon_cs_parser p)

Definition at line 2091 of file r100.c.

int r100_cs_parse_packet0 ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt,
const unsigned *  auth,
unsigned  n,
radeon_packet0_check_t  check 
)

Definition at line 1313 of file r100.c.

int r100_cs_track_check ( struct radeon_device rdev,
struct r100_cs_track track 
)

Definition at line 2298 of file r100.c.

int r100_cs_track_check_pkt3_indx_buffer ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt,
struct radeon_bo robj 
)

Definition at line 1952 of file r100.c.

void r100_cs_track_clear ( struct radeon_device rdev,
struct r100_cs_track track 
)

Definition at line 2435 of file r100.c.

int r100_debugfs_cp_init ( struct radeon_device rdev)

Definition at line 3130 of file r100.c.

int r100_debugfs_mc_info_init ( struct radeon_device rdev)

Definition at line 3139 of file r100.c.

int r100_debugfs_rbbm_init ( struct radeon_device rdev)

Definition at line 3121 of file r100.c.

void r100_enable_bm ( struct radeon_device rdev)

Definition at line 2595 of file r100.c.

void r100_fence_ring_emit ( struct radeon_device rdev,
struct radeon_fence fence 
)

Definition at line 818 of file r100.c.

void r100_fini ( struct radeon_device rdev)

Definition at line 4011 of file r100.c.

u32 r100_get_vblank_counter ( struct radeon_device rdev,
int  crtc 
)

Definition at line 808 of file r100.c.

bool r100_gpu_is_lockup ( struct radeon_device rdev,
struct radeon_ring ring 
)

Definition at line 2580 of file r100.c.

bool r100_gui_idle ( struct radeon_device rdev)

r100_gui_idle - gui idle callback.

: radeon_device pointer

Check of the GUI (2D/3D engines) are idle (r1xx-r5xx). Returns true if idle, false if not.

Definition at line 493 of file r100.c.

int r100_gui_wait_for_idle ( struct radeon_device rdev)

Definition at line 2545 of file r100.c.

void r100_hpd_fini ( struct radeon_device rdev)

r100_hpd_fini - hpd tear down callback.

: radeon_device pointer

Tear down the hpd pins used by the card (r1xx-r4xx). Disable the hpd interrupts.

Definition at line 596 of file r100.c.

void r100_hpd_init ( struct radeon_device rdev)

r100_hpd_init - hpd setup callback.

: radeon_device pointer

Setup the hpd pins used by the card (r1xx-r4xx). Set the polarity, and enable the hpd interrupts.

Definition at line 574 of file r100.c.

bool r100_hpd_sense ( struct radeon_device rdev,
enum radeon_hpd_id  hpd 
)

r100_hpd_sense - hpd sense callback.

: radeon_device pointer : hpd (hotplug detect) pin

Checks if a digital monitor is connected (r1xx-r4xx). Returns true if connected, false if not connected.

Definition at line 511 of file r100.c.

void r100_hpd_set_polarity ( struct radeon_device rdev,
enum radeon_hpd_id  hpd 
)

r100_hpd_set_polarity - hpd set polarity callback.

: radeon_device pointer : hpd (hotplug detect) pin

Set the polarity of the hpd pin (r1xx-r4xx).

Definition at line 538 of file r100.c.

int r100_ib_test ( struct radeon_device rdev,
struct radeon_ring ring 
)

Definition at line 3744 of file r100.c.

int r100_init ( struct radeon_device rdev)

Definition at line 4053 of file r100.c.

u32 r100_io_rreg ( struct radeon_device rdev,
u32  reg 
)

Definition at line 4158 of file r100.c.

void r100_io_wreg ( struct radeon_device rdev,
u32  reg,
u32  v 
)

Definition at line 4168 of file r100.c.

void r100_irq_disable ( struct radeon_device rdev)

Definition at line 720 of file r100.c.

int r100_irq_process ( struct radeon_device rdev)

Definition at line 744 of file r100.c.

int r100_irq_set ( struct radeon_device rdev)

Definition at line 690 of file r100.c.

void r100_mc_resume ( struct radeon_device rdev,
struct r100_mc_save save 
)

Definition at line 3845 of file r100.c.

void r100_mc_stop ( struct radeon_device rdev,
struct r100_mc_save save 
)

Definition at line 3803 of file r100.c.

int r100_mc_wait_for_idle ( struct radeon_device rdev)

Definition at line 2564 of file r100.c.

uint32_t r100_mm_rreg ( struct radeon_device rdev,
uint32_t  reg 
)

Definition at line 4138 of file r100.c.

void r100_mm_wreg ( struct radeon_device rdev,
uint32_t  reg,
uint32_t  v 
)

Definition at line 4148 of file r100.c.

int r100_packet3_load_vbpntr ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt,
int  idx 
)

Definition at line 1249 of file r100.c.

u32 r100_page_flip ( struct radeon_device rdev,
int  crtc_id,
u64  crtc_base 
)

r100_page_flip - pageflip callback.

: radeon_device pointer : crtc to cleanup pageflip on : new address of the crtc (GPU MC address)

Does the actual pageflip (r1xx-r4xx). During vblank we take the crtc lock and wait for the update_pending bit to go high, when it does, we release the lock, and allow the double buffered update to take place. Returns the current update pending status.

Definition at line 159 of file r100.c.

void r100_pci_gart_disable ( struct radeon_device rdev)

Definition at line 661 of file r100.c.

int r100_pci_gart_enable ( struct radeon_device rdev)

Definition at line 638 of file r100.c.

void r100_pci_gart_fini ( struct radeon_device rdev)

Definition at line 683 of file r100.c.

int r100_pci_gart_init ( struct radeon_device rdev)

Definition at line 620 of file r100.c.

int r100_pci_gart_set_page ( struct radeon_device rdev,
int  i,
uint64_t  addr 
)

Definition at line 672 of file r100.c.

void r100_pci_gart_tlb_flush ( struct radeon_device rdev)

Definition at line 612 of file r100.c.

void r100_pll_errata_after_index ( struct radeon_device rdev)

Definition at line 2911 of file r100.c.

uint32_t r100_pll_rreg ( struct radeon_device rdev,
uint32_t  reg 
)

Definition at line 2944 of file r100.c.

void r100_pll_wreg ( struct radeon_device rdev,
uint32_t  reg,
uint32_t  v 
)

Definition at line 2955 of file r100.c.

void r100_pm_finish ( struct radeon_device rdev)

r100_pm_finish - post-power state change callback.

: radeon_device pointer

Clean up after a power state change (r1xx-r4xx).

Definition at line 461 of file r100.c.

void r100_pm_get_dynpm_state ( struct radeon_device rdev)

r100_pm_get_dynpm_state - look up dynpm power state callback.

: radeon_device pointer

Look up the optimal power state based on the current state of the GPU (r1xx-r5xx). Used for dynpm only.

Definition at line 194 of file r100.c.

void r100_pm_init_profile ( struct radeon_device rdev)

r100_pm_init_profile - Initialize power profiles callback.

: radeon_device pointer

Initialize the power states used in profile mode (r1xx-r3xx). Used for profile mode only.

Definition at line 285 of file r100.c.

void r100_pm_misc ( struct radeon_device rdev)

r100_pm_misc - set additional pm hw parameters callback.

: radeon_device pointer

Set non-clock parameters associated with a power state (voltage, pcie lanes, etc.) (r1xx-r4xx).

Definition at line 332 of file r100.c.

void r100_pm_prepare ( struct radeon_device rdev)

r100_pm_prepare - pre-power state change callback.

: radeon_device pointer

Prepare for a power state change (r1xx-r4xx).

Definition at line 430 of file r100.c.

void r100_post_page_flip ( struct radeon_device rdev,
int  crtc 
)

r100_post_page_flip - pos-pageflip callback.

: radeon_device pointer : crtc to cleanup pageflip on

Post-pageflip callback (r1xx-r4xx). Disables the pageflip irq (vblank irq).

Definition at line 140 of file r100.c.

void r100_pre_page_flip ( struct radeon_device rdev,
int  crtc 
)

r100_pre_page_flip - pre-pageflip callback.

: radeon_device pointer : crtc to prepare for pageflip on

Pre-pageflip callback (r1xx-r4xx). Enables the pageflip irq (vblank irq).

Definition at line 125 of file r100.c.

int r100_reloc_pitch_offset ( struct radeon_cs_parser p,
struct radeon_cs_packet pkt,
unsigned  idx,
unsigned  reg 
)

Definition at line 1207 of file r100.c.

void r100_restore_sanity ( struct radeon_device rdev)

Definition at line 4035 of file r100.c.

int r100_resume ( struct radeon_device rdev)

Definition at line 3971 of file r100.c.

void r100_ring_ib_execute ( struct radeon_device rdev,
struct radeon_ib ib 
)

Definition at line 3729 of file r100.c.

void r100_ring_start ( struct radeon_device rdev,
struct radeon_ring ring 
)

Definition at line 942 of file r100.c.

int r100_ring_test ( struct radeon_device rdev,
struct radeon_ring ring 
)

Definition at line 3689 of file r100.c.

void r100_semaphore_ring_emit ( struct radeon_device rdev,
struct radeon_ring ring,
struct radeon_semaphore semaphore,
bool  emit_wait 
)

Definition at line 844 of file r100.c.

void r100_set_common_regs ( struct radeon_device rdev)

Definition at line 2676 of file r100.c.

int r100_set_surface_reg ( struct radeon_device rdev,
int  reg,
uint32_t  tiling_flags,
uint32_t  pitch,
uint32_t  offset,
uint32_t  obj_size 
)

Definition at line 3148 of file r100.c.

int r100_suspend ( struct radeon_device rdev)

Definition at line 4001 of file r100.c.

void r100_vga_render_disable ( struct radeon_device rdev)

Definition at line 3861 of file r100.c.

void r100_vga_set_state ( struct radeon_device rdev,
bool  state 
)

Definition at line 2877 of file r100.c.

void r100_vram_init_sizes ( struct radeon_device rdev)

Definition at line 2836 of file r100.c.

void r100_wait_for_vblank ( struct radeon_device rdev,
int  crtc 
)

r100_wait_for_vblank - vblank wait asic callback.

: radeon_device pointer : crtc to wait for vblank on

Wait for vblank on the requested crtc (r1xx-r4xx).

Definition at line 80 of file r100.c.