xm_winsys_aub.h File Reference

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

Go to the source code of this file.

Functions

struct pipe_winsysxmesa_create_pipe_winsys_aub (void)
void xmesa_destroy_pipe_winsys_aub (struct pipe_winsys *winsys)
struct pipe_contextxmesa_create_i965simple (struct pipe_winsys *winsys)
 Create i965 hardware rendering context.
void xmesa_buffer_subdata_aub (struct pipe_winsys *winsys, struct pipe_buffer *buf, unsigned long offset, unsigned long size, const void *data, unsigned aub_type, unsigned aub_sub_type)
void xmesa_commands_aub (struct pipe_winsys *winsys, unsigned *cmds, unsigned nr_dwords)
void xmesa_display_aub (struct pipe_surface *surface)
struct pipe_winsysxmesa_get_pipe_winsys_aub (struct xmesa_visual *xm_vis)
 Return pointer to a pipe_winsys object.


Function Documentation

void xmesa_buffer_subdata_aub ( struct pipe_winsys winsys,
struct pipe_buffer buf,
unsigned long  offset,
unsigned long  size,
const void *  data,
unsigned  aub_type,
unsigned  aub_sub_type 
)

Definition at line 145 of file xm_winsys_aub.c.

References assert, aub_bo(), aub_pipe_winsys(), aub_pipe_winsys::aubfile, brw_aub_gtt_data(), aub_buffer::data, aub_buffer::offset, and aub_buffer::size.

00152 {
00153    struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys);
00154    struct aub_buffer *sbo = aub_bo(buf);
00155 
00156    assert(sbo->size > offset + size);
00157    memcpy(sbo->data + offset, data, size);
00158 
00159    brw_aub_gtt_data( iws->aubfile, 
00160                      sbo->offset + offset,
00161                      sbo->data + offset,
00162                      size,
00163                      aub_type,
00164                      aub_sub_type );
00165 }

void xmesa_commands_aub ( struct pipe_winsys winsys,
unsigned *  cmds,
unsigned  nr_dwords 
)

Definition at line 167 of file xm_winsys_aub.c.

References align(), assert, AUB_BUF_START, aub_pipe_winsys(), aub_pipe_winsys::aubfile, brw_aub_gtt_cmds(), aub_pipe_winsys::size, and aub_pipe_winsys::used.

00170 {
00171    struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys);
00172    unsigned size = nr_dwords * 4;
00173 
00174    assert(iws->used + size < iws->size);
00175 
00176    brw_aub_gtt_cmds( iws->aubfile, 
00177                      AUB_BUF_START + iws->used,
00178                      cmds,
00179                      nr_dwords * sizeof(int) );
00180 
00181    iws->used += align(size, 4096);
00182 }

struct pipe_context* xmesa_create_i965simple ( struct pipe_winsys winsys  )  [read]

Create i965 hardware rendering context.

Definition at line 561 of file xm_winsys_aub.c.

References aub_i965_batch_dword(), aub_i965_batch_end(), aub_i965_batch_flush(), aub_i965_batch_reloc(), aub_i965_batch_start(), aub_i965_buffer_subdata_typed(), aub_i965_get_buffer_offset(), brw_winsys::batch_dword, brw_winsys::batch_end, brw_winsys::batch_flush, brw_winsys::batch_reloc, aub_brw_winsys::batch_size, brw_winsys::batch_start, brw_create(), brw_create_screen(), brw_winsys::buffer_subdata_typed, CALLOC_STRUCT, brw_winsys::get_buffer_offset, IWS_BATCHBUFFER_SIZE, aub_brw_winsys::pipe_winsys, and aub_brw_winsys::winsys.

00562 {
00563    struct aub_brw_winsys *iws = CALLOC_STRUCT( aub_brw_winsys );
00564    struct pipe_screen *screen = brw_create_screen(winsys, 0/* XXX pci_id */);
00565    
00566    /* Fill in this struct with callbacks that i965simple will need to
00567     * communicate with the window system, buffer manager, etc. 
00568     */
00569    iws->winsys.batch_start = aub_i965_batch_start;
00570    iws->winsys.batch_dword = aub_i965_batch_dword;
00571    iws->winsys.batch_reloc = aub_i965_batch_reloc;
00572    iws->winsys.batch_end = aub_i965_batch_end;
00573    iws->winsys.batch_flush = aub_i965_batch_flush;
00574    iws->winsys.buffer_subdata_typed = aub_i965_buffer_subdata_typed;
00575    iws->winsys.get_buffer_offset = aub_i965_get_buffer_offset;
00576 
00577    iws->pipe_winsys = winsys;
00578 
00579    iws->batch_size = IWS_BATCHBUFFER_SIZE;
00580 
00581    /* Create the i965simple context:
00582     */
00583    return brw_create( screen,
00584                       &iws->winsys,
00585                       0 );
00586 }

struct pipe_winsys* xmesa_create_pipe_winsys_aub ( void   )  [read]

Definition at line 326 of file xm_winsys_aub.c.

References assert, AUB_BUF_SIZE, aub_buffer_create(), aub_buffer_destroy(), aub_buffer_map(), aub_buffer_unmap(), aub_flush_frontbuffer(), aub_get_name(), aub_i915_surface_alloc(), aub_i915_surface_alloc_storage(), aub_i915_surface_release(), aub_user_buffer_create(), aub_pipe_winsys::aubfile, brw_aubfile_create(), pipe_winsys::buffer_create, pipe_winsys::buffer_destroy, pipe_winsys::buffer_map, pipe_winsys::buffer_unmap, CALLOC_STRUCT, pipe_winsys::flush_frontbuffer, pipe_winsys::get_name, aub_pipe_winsys::pool, aub_pipe_winsys::size, pipe_winsys::surface_alloc, pipe_winsys::surface_alloc_storage, pipe_winsys::surface_release, pipe_winsys::user_buffer_create, and aub_pipe_winsys::winsys.

00327 {
00328    struct aub_pipe_winsys *iws = CALLOC_STRUCT( aub_pipe_winsys );
00329    
00330    /* Fill in this struct with callbacks that pipe will need to
00331     * communicate with the window system, buffer manager, etc. 
00332     *
00333     * Pipe would be happy with a malloc based memory manager, but
00334     * the SwapBuffers implementation in this winsys driver requires
00335     * that rendering be done to an appropriate _DriBufferObject.  
00336     */
00337    iws->winsys.buffer_create = aub_buffer_create;
00338    iws->winsys.user_buffer_create = aub_user_buffer_create;
00339    iws->winsys.buffer_map = aub_buffer_map;
00340    iws->winsys.buffer_unmap = aub_buffer_unmap;
00341    iws->winsys.buffer_destroy = aub_buffer_destroy;
00342    iws->winsys.flush_frontbuffer = aub_flush_frontbuffer;
00343    iws->winsys.get_name = aub_get_name;
00344 
00345    iws->winsys.surface_alloc = aub_i915_surface_alloc;
00346    iws->winsys.surface_alloc_storage = aub_i915_surface_alloc_storage;
00347    iws->winsys.surface_release = aub_i915_surface_release;
00348 
00349    iws->aubfile = brw_aubfile_create();
00350    iws->size = AUB_BUF_SIZE;
00351    iws->pool = malloc(AUB_BUF_SIZE);
00352 
00353    /* HACK: static copy of this pointer:
00354     */
00355    assert(global_winsys == NULL);
00356    global_winsys = iws;
00357 
00358    return &iws->winsys;
00359 }

void xmesa_destroy_pipe_winsys_aub ( struct pipe_winsys winsys  ) 

Definition at line 363 of file xm_winsys_aub.c.

References aub_pipe_winsys(), aub_pipe_winsys::aubfile, brw_aub_destroy(), and aub_pipe_winsys::pool.

00365 {
00366    struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys);
00367    brw_aub_destroy(iws->aubfile);
00368    free(iws->pool);
00369    free(iws);
00370 }

void xmesa_display_aub ( struct pipe_surface surface  ) 

Definition at line 187 of file xm_winsys_aub.c.

References aub_bo(), aub_pipe_winsys::aubfile, brw_aub_dump_bmp(), pipe_surface::buffer, and aub_buffer::offset.

00189 {
00190 //   struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys);
00191    brw_aub_dump_bmp( global_winsys->aubfile, 
00192                      surface,
00193                      aub_bo(surface->buffer)->offset );
00194 }

struct pipe_winsys* xmesa_get_pipe_winsys_aub ( struct xmesa_visual xm_vis  )  [read]

Return pointer to a pipe_winsys object.

For Xlib, this is a singleton object. Nothing special for the Xlib driver so no subclassing or anything.

Definition at line 632 of file xm_winsys.c.

00635 {
00636    static struct xmesa_pipe_winsys *ws = NULL;
00637 
00638    if (!ws) {
00639       ws = (struct xmesa_pipe_winsys *) xmesa_create_pipe_winsys_aub();
00640    }


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