brw_aub.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define AUB_BUF_START   (4096*4)
#define AUB_BUF_SIZE   (8*1024*1024)

Enumerations

enum  data_write_type {
  DW_NOTYPE, DW_BATCH_BUFFER, DW_BIN_BUFFER, DW_BIN_POINTER_LIST,
  DW_SLOW_STATE_BUFFER, DW_VERTEX_BUFFER, DW_2D_MAP, DW_CUBE_MAP,
  DW_INDIRECT_STATE_BUFFER, DW_VOLUME_MAP, DW_1D_MAP, DW_CONSTANT_BUFFER,
  DW_CONSTANT_URB_ENTRY, DW_INDEX_BUFFER, DW_GENERAL_STATE, DW_SURFACE_STATE,
  DW_MEDIA_OBJECT_INDIRECT_DATA, DW_MAX_TYPE
}
enum  data_write_general_state_type {
  DWGS_NOTYPE, DWGS_VERTEX_SHADER_STATE, DWGS_GEOMETRY_SHADER_STATE, DWGS_CLIPPER_STATE,
  DWGS_STRIPS_FANS_STATE, DWGS_WINDOWER_IZ_STATE, DWGS_COLOR_CALC_STATE, DWGS_CLIPPER_VIEWPORT_STATE,
  DWGS_STRIPS_FANS_VIEWPORT_STATE, DWGS_COLOR_CALC_VIEWPORT_STATE, DWGS_SAMPLER_STATE, DWGS_KERNEL_INSTRUCTIONS,
  DWGS_SCRATCH_SPACE, DWGS_SAMPLER_DEFAULT_COLOR, DWGS_INTERFACE_DESCRIPTOR, DWGS_VLD_STATE,
  DWGS_VFE_STATE, DWGS_MAX_TYPE
}
enum  data_write_surface_state_type { DWSS_NOTYPE, DWSS_BINDING_TABLE_STATE, DWSS_SURFACE_STATE, DWSS_MAX_TYPE }

Functions

struct brw_aubfilebrw_aubfile_create (void)
void brw_aub_destroy (struct brw_aubfile *aubfile)
void brw_aub_gtt_data (struct brw_aubfile *aubfile, unsigned offset, const void *data, unsigned sz, unsigned type, unsigned state_type)
void brw_aub_gtt_cmds (struct brw_aubfile *aubfile, unsigned offset, const void *data, unsigned sz)
void brw_aub_dump_bmp (struct brw_aubfile *aubfile, struct pipe_surface *surface, unsigned gtt_offset)


Define Documentation

#define AUB_BUF_SIZE   (8*1024*1024)

Definition at line 38 of file brw_aub.h.

#define AUB_BUF_START   (4096*4)

Definition at line 37 of file brw_aub.h.


Enumeration Type Documentation

enum data_write_general_state_type

Enumerator:
DWGS_NOTYPE 
DWGS_VERTEX_SHADER_STATE 
DWGS_GEOMETRY_SHADER_STATE 
DWGS_CLIPPER_STATE 
DWGS_STRIPS_FANS_STATE 
DWGS_WINDOWER_IZ_STATE 
DWGS_COLOR_CALC_STATE 
DWGS_CLIPPER_VIEWPORT_STATE 
DWGS_STRIPS_FANS_VIEWPORT_STATE 
DWGS_COLOR_CALC_VIEWPORT_STATE 
DWGS_SAMPLER_STATE 
DWGS_KERNEL_INSTRUCTIONS 
DWGS_SCRATCH_SPACE 
DWGS_SAMPLER_DEFAULT_COLOR 
DWGS_INTERFACE_DESCRIPTOR 
DWGS_VLD_STATE 
DWGS_VFE_STATE 
DWGS_MAX_TYPE 

Definition at line 85 of file brw_aub.h.

enum data_write_surface_state_type

Enumerator:
DWSS_NOTYPE 
DWSS_BINDING_TABLE_STATE 
DWSS_SURFACE_STATE 
DWSS_MAX_TYPE 

Definition at line 106 of file brw_aub.h.

00106                                    {
00107    DWSS_NOTYPE,
00108    DWSS_BINDING_TABLE_STATE,
00109    DWSS_SURFACE_STATE,
00110    DWSS_MAX_TYPE
00111 };

enum data_write_type

Enumerator:
DW_NOTYPE 
DW_BATCH_BUFFER 
DW_BIN_BUFFER 
DW_BIN_POINTER_LIST 
DW_SLOW_STATE_BUFFER 
DW_VERTEX_BUFFER 
DW_2D_MAP 
DW_CUBE_MAP 
DW_INDIRECT_STATE_BUFFER 
DW_VOLUME_MAP 
DW_1D_MAP 
DW_CONSTANT_BUFFER 
DW_CONSTANT_URB_ENTRY 
DW_INDEX_BUFFER 
DW_GENERAL_STATE 
DW_SURFACE_STATE 
DW_MEDIA_OBJECT_INDIRECT_DATA 
DW_MAX_TYPE 

Definition at line 64 of file brw_aub.h.


Function Documentation

void brw_aub_destroy ( struct brw_aubfile aubfile  ) 

Definition at line 393 of file brw_aub.c.

References brw_aubfile::file, and FREE.

00394 {
00395    fclose(aubfile->file);
00396    FREE(aubfile);
00397 }

void brw_aub_dump_bmp ( struct brw_aubfile aubfile,
struct pipe_surface surface,
unsigned  gtt_offset 
)

Definition at line 318 of file brw_aub.c.

References aub_dump_bmp::addr, assert, AUB_DUMP_BMP, pipe_surface::block, aub_dump_bmp::bpp, brw_aubfile::file, aub_dump_bmp::format, pipe_surface::height, pipe_format_block::height, aub_dump_bmp::instruction_type, aub_dump_bmp::pitch, pipe_format_block::size, pipe_surface::stride, aub_dump_bmp::unknown, pipe_surface::width, pipe_format_block::width, write_dump_bmp(), aub_dump_bmp::xmin, aub_dump_bmp::xsize, aub_dump_bmp::ymin, and aub_dump_bmp::ysize.

00321 {
00322    struct aub_dump_bmp db;
00323    unsigned format;
00324 
00325    assert(surface->block.width == 1);
00326    assert(surface->block.height == 1);
00327    
00328    if (surface->block.size == 4)
00329       format = 0x7;
00330    else
00331       format = 0x3;
00332 
00333    db.instruction_type = AUB_DUMP_BMP;
00334    db.xmin = 0;
00335    db.ymin = 0;
00336    db.format = format;
00337    db.bpp = surface->block.size * 8;
00338    db.pitch = surface->stride/surface->block.size;
00339    db.xsize = surface->width;
00340    db.ysize = surface->height;
00341    db.addr = gtt_offset;
00342    db.unknown = /* surface->tiled ? 0x4 : */ 0x0;
00343 
00344    write_dump_bmp(aubfile->file, &db);
00345 }

void brw_aub_gtt_cmds ( struct brw_aubfile aubfile,
unsigned  offset,
const void *  data,
unsigned  sz 
)

Definition at line 295 of file brw_aub.c.

References ADDR_GTT, aub_block_header::address, aub_block_header::address_space, AUB_BLOCK_HEADER, BH_COMMAND_WRITE, CW_PRIMARY_RING_A, brw_aubfile::file, aub_block_header::general_state_type, aub_block_header::instruction_type, aub_block_header::length, aub_block_header::operation, aub_block_header::pad0, aub_block_header::pad1, aub_block_header::surface_state_type, aub_block_header::type, and write_block_header().

00299 {
00300    struct aub_block_header bh;   
00301    unsigned type = CW_PRIMARY_RING_A;
00302    
00303 
00304    bh.instruction_type = AUB_BLOCK_HEADER;
00305    bh.operation = BH_COMMAND_WRITE;
00306    bh.type = type;
00307    bh.address_space = ADDR_GTT;
00308    bh.pad0 = 0;
00309    bh.general_state_type = 0;
00310    bh.surface_state_type = 0;
00311    bh.pad1 = 0;
00312    bh.address = offset;
00313    bh.length = sz;
00314 
00315    write_block_header(aubfile->file, &bh, data, sz);
00316 }

void brw_aub_gtt_data ( struct brw_aubfile aubfile,
unsigned  offset,
const void *  data,
unsigned  sz,
unsigned  type,
unsigned  state_type 
)

Definition at line 262 of file brw_aub.c.

References ADDR_GTT, aub_block_header::address, aub_block_header::address_space, AUB_BLOCK_HEADER, BH_DATA_WRITE, DW_GENERAL_STATE, brw_aubfile::file, aub_block_header::general_state_type, aub_block_header::instruction_type, aub_block_header::length, aub_block_header::operation, aub_block_header::pad0, aub_block_header::pad1, aub_block_header::surface_state_type, aub_block_header::type, and write_block_header().

00268 {
00269    struct aub_block_header bh;
00270 
00271    bh.instruction_type = AUB_BLOCK_HEADER;
00272    bh.operation = BH_DATA_WRITE;
00273    bh.type = type;
00274    bh.address_space = ADDR_GTT;
00275    bh.pad0 = 0;
00276 
00277    if (type == DW_GENERAL_STATE) {
00278       bh.general_state_type = state_type;
00279       bh.surface_state_type = 0;
00280    }
00281    else {
00282       bh.general_state_type = 0;
00283       bh.surface_state_type = state_type;
00284    }
00285 
00286    bh.pad1 = 0;
00287    bh.address = offset;
00288    bh.length = sz;
00289 
00290    write_block_header(aubfile->file, &bh, data, sz);
00291 }

struct brw_aubfile* brw_aubfile_create ( void   )  [read]

Definition at line 349 of file brw_aub.c.

References __progname, AUB_BUF_SIZE, AUB_BUF_START, CALLOC_STRUCT, debug_printf(), brw_aubfile::file, init_aub_gtt(), init_aubfile(), brw_aubfile::next_free_page, and NR_GTT_ENTRIES.

00350 {
00351    struct brw_aubfile *aubfile = CALLOC_STRUCT(brw_aubfile);
00352    char filename[80];
00353    int val;
00354    static int i = 0;
00355 
00356    i++;
00357 
00358    if (getenv("INTEL_AUBFILE")) {
00359       val = snprintf(filename, sizeof(filename), "%s%d.aub", getenv("INTEL_AUBFILE"), i%4);
00360       debug_printf("--> Aub file: %s\n", filename);
00361       aubfile->file = fopen(filename, "w");
00362    }
00363    else {
00364       val = snprintf(filename, sizeof(filename), "%s.aub", __progname);
00365       if (val < 0 || val > sizeof(filename)) 
00366          strcpy(filename, "default.aub");   
00367    
00368       debug_printf("--> Aub file: %s\n", filename);
00369       aubfile->file = fopen(filename, "w");
00370    }
00371 
00372    if (!aubfile->file) {
00373       debug_printf("couldn't open aubfile\n");
00374       exit(1);
00375    }
00376 
00377    init_aubfile(aubfile->file);
00378 
00379    /* The GTT is located starting address zero in main memory.  Pages
00380     * to populate the gtt start after this point.
00381     */
00382    aubfile->next_free_page = (NR_GTT_ENTRIES * 4 + 4095) & ~4095;
00383 
00384    /* More or less correspond with all the agp regions mapped by the
00385     * driver:
00386     */
00387    init_aub_gtt(aubfile, 0, 4096*4);
00388    init_aub_gtt(aubfile, AUB_BUF_START, AUB_BUF_SIZE);
00389 
00390    return aubfile;
00391 }


Generated on Tue Sep 29 06:25:49 2009 for Gallium3D by  doxygen 1.5.4