#include "re.h"
#include "nv_hw.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <string.h>
#include <SDL/SDL_syswm.h>
#include "NVCtrl.h"
#include "NVCtrlLib.h"
#include "objects.h"
#include "regl.h"
Include dependency graph for re.c:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | mapping |
struct | fifo_descriptor |
typedef mapping | mapping |
Defines | |
#define | NV_DEV "nvidia0" |
#define | MAPFILE "maplist.txt" |
#define | TMPFILE "regtmp.txt" |
#define | FIFO_SIZE1 0x102000 |
#define | FIFO_SIZE2 0x103000 |
#define | FIFO_SIZE3 0x101000 |
#define | FIFO_SIZE_QUADRO2 0x400000 |
#define | WTF_SIZE 0x100000 |
#define | REGS_SIZE 0x004000 |
#define | REGS_SIZE2 0x001000 |
#define | ALL_REGS_SIZE 0x1000000 |
#define | MAPPING_FIFO 1 |
Here is a FIFO area. | |
#define | MAPPING_REGS 2 |
we have found the registers of the gfx card | |
#define | MAPPING_NODUMP 4 |
Nothing of interest here (e.g. unused memory). | |
#define | MAPPING_AGP 8 |
AGP Memory. | |
#define | MAXPRINT 10 |
#define | CMD "head -1" |
#define | QUADRO_FIFO_OFFSET 0xbf400 |
#define | ALLREG_START 0x2000 |
offset of the 1. register from the start of the register mapping | |
#define | ALLREG_SIZE 0x1000 |
Size of the register address range in long words. | |
Functions | |
unsigned int * | gpu_ofs_to_agp (unsigned long ofs) |
void | print_usage (char *argv0) |
void | parse_opts (int argc, char **argv) |
Parse command line options (if any). | |
static int | must_ignore (int r) |
static int | regcmp (unsigned int *m1, unsigned int *m2, int size) |
char * | bit_pattern (unsigned int val) |
int | get_vidram () |
void | init_card () |
initialisize the card and mappings. | |
static void | find_maps () |
finds out the mapping available and determines their types | |
void | print_fifo (int n, int before, int after) |
int | smart_zero_remover (unsigned int value) |
void | dumpreg_before () |
Saves the content of the mapping containing all registers before running commands through the FIFO. | |
void | dumpreg_after () |
Saves the content of the mapping containing all registers after running commands through the FIFO. | |
void | dump_before () |
this is the starting point from which commands and register modifications will be displayed. This function doesn't output anything. | |
static void | set_subchannel (int channel, unsigned int name) |
void | dump_after (int dump_startup) |
this is the end of the dump. This functions outputs the changes in the registers and in the fifo contents since dump_before() was called. | |
void | redirect_output (const char *name) |
void | close_output () |
void | let_it_snow () |
Variables | |
static mapping | mappings [100] |
Storage for all found mappings. | |
static int | ignore_regs [] = {0x25,0x3b,0x15c,0x15d,0x15e,0x16d} |
static int | init_ok = 0 |
static long | agp_base = 0 |
Base address of the AGP aperture. | |
static long | agp_size = 0 |
Size of the AGP aperture memory. | |
unsigned int * | fb = NULL |
Adress of the display memory starting here. | |
unsigned int | fb_size |
Size of the Video memory in Bytes equipped on board. | |
unsigned int * | all_regs = NULL |
Mapping for all available registers. | |
unsigned int | card_family = 0 |
int | card_type = -1 |
data_print_store | user_data_print [MAXPRINT] |
static long | allregmapping_before [ALLREG_SIZE/4] |
static long | allregmapping_after [ALLREG_SIZE/4] |
static fifo_descriptor | fifo_channels [8] |
const char * | dma_opcode_name [4] |
static int | fd |
|
|
|
Size of the register address range in long words.
|
|
offset of the 1. register from the start of the register mapping
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this is the end of the dump. This functions outputs the changes in the registers and in the fifo contents since dump_before() was called.
|
|
this is the starting point from which commands and register modifications will be displayed. This function doesn't output anything. This function looks through the found mappings and stores away the data inside the mapping for future comparison (when dump_after() is called) |
|
Saves the content of the mapping containing all registers after running commands through the FIFO.
|
|
Saves the content of the mapping containing all registers before running commands through the FIFO.
|
|
finds out the mapping available and determines their types This function looks in the maplist of /proc/<pid>/maps for mappings assigned to the nvidia card selected. It initialises the values for start and end address within renouveau's address space, the size and the absolute address. The type of the Mapping is determined by the size of the mapping. |
|
|
|
|
|
initialisize the card and mappings. Deduce card type and family and look for mappings of the video memory and the registers.
|
|
|
|
|
|
Parse command line options (if any). You can call renouveau with the following options:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Base address of the AGP aperture.
|
|
Size of the AGP aperture memory.
|
|
Mapping for all available registers.
|
|
|
|
|
|
in which family belongs the card we are working with? See generic card types |
|
|
|
Initial value: { "METHOD", "JUMP", "NONINC_METHOD", "CALL", } |
|
Adress of the display memory starting here.
|
|
Size of the Video memory in Bytes equipped on board.
|
|
|
|
|
|
|
|
|
|
Storage for all found mappings.
|
|
|