📄 radeon_interface.h
字号:
uint bpp; // bytes per pixel uint32 pitch; // byte offset between two lines uint32 eff_width, eff_height; // size of visible area (including both monitors) uint32 fb_mem_handle; // memory handle uint32 fb_offset; // offset of frame buffer in graphics mem cursor_info cursor; bool swap_displays; // true to swap monitors bool use_laptop_panel; // true to always use laptop panel tv_standard_e tv_standard; // standard to use for TV Out bool enforce_mode_change; // set to make sure next display mode change // is executed even if display mode seems to be // still the same frame_buffer_config fbc; // data for direct frame buffer access display_mode mode; // offical mode with multi-monitor bits set overlay_buffer_node *overlay_buffers; // list of allocated overlay buffers //int8 whished_overlay_head; // head where users whishes the overlay to be bool uses_overlay; // true if this virtual card owns overlay int state_buffer_idx; int state_buffer_size;} virtual_card;// status of overlaytypedef struct { vint32 inuse; // one, if someone allocated overlay head // (this doesn't necessarily mean that an overlay is shown) uint32 token; // arbitrarily chosen token to identify overlay owner // (increased by 1 whenever there is a new owner) uint32 auto_flip_reg; // content of auto_flip_reg} overlay_mgr_info;// info about indirect CP buffertypedef struct { int next; // next used/free buffer (-1 for EOL) int32 send_tag; // tag assigned when buffer was submitted} indirect_buffer;// info about command processor (CP) statetypedef struct { benaphore lock; // lock to be acquired when talking to CP or // when accesing this structure // ring buffer (in non-local memory) struct { uint32 mem_offset; // offset in non-local memory uint32 vm_base; // base of ring buffer as seen by graphics card uint32 tail, tail_mask; // next write position in dwords; mask for wrap-arounds uint32 size; // size in dwords //uint32 head_offset; // offset for automatically updates head in DMA buffer //uint32 start_offset; memory_type_e mem_type; //uint32 *start; // pointer to ring buffer //vuint32 *head; // pointer to automatically updated read position uint32 space; // known space in ring buffer uint32 mem_handle; // handle of memory of indirect buffers } ring; // feedback registers (in PCI memory) struct { //vuint32 *ptr; // pointer to scratch registers uint32 scratch_mem_offset; // offset of scratch registers in feedback memory uint32 head_mem_offset; // offset of head register in feedback memory uint32 scratch_vm_start; // virtual address of scratch as seen by GC uint32 head_vm_address; // virtual address of head as seen by GC memory_type_e mem_type; // memory type of feedback memory uint32 mem_handle; // handle of feedback memory } feedback; // indirect buffers (in non-local memory) // for indeces: -1 means "none" struct { int free_list; // index of first empty buffer int oldest, // oldest submitted buffer newest; // newest submitted buffer int active_state; // index of active state buffer uint64 cur_tag; // tag of last submitted indirect buffer memory_type_e mem_type; uint32 mem_offset; // offset of indirect buffers in non-local memory uint32 vm_start; // start of indirect buffers as seen by graphics card indirect_buffer buffers[NUM_INDIRECT_BUFFERS]; // info about buffers uint32 mem_handle; // handle of memory of indirect buffers } buffers;} CP_info;// info about different graphics-related memory// (see memory_type_e)typedef struct { area_id area; // area to memory uint32 size; // usable size in bytes uint32 virtual_addr_start; // virtual address (for graphics card!) uint32 virtual_size; // reserved virtual address space in bytes} memory_type_info;// data published by kernel and shared by all accelerant/virtual cardstypedef struct { // filled out by kernel CP_info cp; // info concerning command processor // set by accelerant struct { uint64 count; // count of submitted CP commands uint64 last_idle; // count when engine was idle last time uint64 written; // last count passed to CP benaphore lock; // engine lock } engine; uint16 vendor_id; // PCI vendor id uint16 device_id; // PCI device id uint8 revision; // PCI device revision //bool has_crtc2; // has second CRTC radeon_type asic; // ASIC version bool is_mobility; // mobility version tv_chip_type tv_chip; // type of TV-Out encoder bool new_pll; // r300 style PLL uint8 theatre_channel; // VIP channel of Rage Theatre (if applicable) general_pll_info pll; area_id regs_area; // area of memory mapped registers area_id ROM_area; // area of ROM //area_id fb_area; // area of frame buffer void *framebuffer_pci; // physical address of frame buffer (aka local memory) // this is a hack needed by BeOS crtc_info crtc[2]; // info about each crtc uint8 num_crtc; // number of physical heads fp_info flatpanels[2]; // info about connected flat panels (if any) memory_type_info memory[mt_last]; // info about memory types memory_type_e nonlocal_type; // default type of non-local memory uint8 *local_mem; // address of local memory; // this is a hack requested by BeOS area_id mode_list_area; // area containing display mode list uint mode_count; uint32 active_vc; // currently selected virtual card in terms of 2D acceleration uint32 dac_cntl2; // content of dac_cntl2 register overlay_info pending_overlay; // overlay to be shown overlay_info active_overlay; // overlay shown overlay_mgr_info overlay_mgr; // status of overlay // data needed for VBI emulation // (currently not fully implemented - if the user disabled graphics card // IRQ in the BIOS, it's his fault) int refresh_period; // duration of one frame in ms int blank_period; // vertical blank period of a frame in ms int enable_virtual_irq; // true, to enable virtual interrupts struct log_info_t *log; // fast logger data} shared_info;// retrieve the area_id of the kernel/accelerant shared infotypedef struct { uint32 magic; // magic number area_id shared_info_area; area_id virtual_card_area;} radeon_get_private_data;// get devie name (used to clone accelerant)typedef struct { uint32 magic; // magic number char *name; // pointer to buffer containing name (in)} radeon_device_name;// alloc (non-)local memorytypedef struct { uint32 magic; memory_type_e memory_type;// type of memory uint32 size; // size in bytes uint32 offset; // offset in memory uint32 handle; // handle (needed to free memory) bool global; // set this to true if memory should persist even // if client gets terminated} radeon_alloc_mem;// free (non-)local memorytypedef struct { uint32 magic; memory_type_e memory_type;// type of memory uint32 handle; // memory handle bool global; // must be same as on alloc_local_mem} radeon_free_mem;// wait for idletypedef struct { uint32 magic; bool keep_lock; // keep lock after engine is idle} radeon_wait_for_idle;// read VIP registertypedef struct { uint32 magic; uint channel; // channel, i.e. device uint address; // address uint32 data; // read data bool lock; // true, if CP lock must be acquired} radeon_vip_read;// write VIP registertypedef struct { uint32 magic; uint channel; // channel, i.e. device uint address; // address uint32 data; // data to write bool lock; // true, if CP lock must be acquired} radeon_vip_write;// find channel of device with given IDtypedef struct { uint32 magic; uint32 device_id; // id of device uint channel; // channel of device (-1 if not found)} radeon_find_vip_device;// wait for capture interrupt and get status abouttypedef struct { uint32 magic; bigtime_t timeout; // timeout to wait for irq bigtime_t timestamp; // timestamp when last capturing was finished uint32 int_status; // content of RADEON_CAP_INT_STATUS uint32 counter; // number of capture interrupts so far} radeon_wait_for_cap_irq;// copy data from frame buffer to some memory locationtypedef struct { uint32 magic; uint32 src; // offset of source data in frame buffer void *target; // target buffer size_t size; // number of bytes to copy bool lock_mem; // true, if target needs to be locked bool contiguous; // true, if target is physically contiguous} radeon_dma_copy;// parameter for ioctl without further argumentstypedef struct { uint32 magic;} radeon_no_arg;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -