diff options
author | Brian Paul <[email protected]> | 2010-03-09 08:12:47 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-09 08:14:06 -0700 |
commit | 27a7f9454f190ebb51834e9d2d74c55766cbb29f (patch) | |
tree | b50a3032229e9ee569444e3ad1807305ac4b73f3 | |
parent | ff407a117c7bd4e9f370f8ec204d3f7b4e7f91a2 (diff) |
cell: fix up assorted compilation problems
The driver is pretty much totally broken though.
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_buffer.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_context.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_fence.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_pipe_state.c | 22 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_screen.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_state_shader.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_texture.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_texture.h | 1 | ||||
-rw-r--r-- | src/gallium/include/state_tracker/sw_winsys.h | 3 | ||||
-rw-r--r-- | src/gallium/winsys/xlib/xlib_cell.c | 23 |
11 files changed, 59 insertions, 35 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_buffer.c b/src/gallium/drivers/cell/ppu/cell_buffer.c index 770f7328a71..f56a28d62e2 100644 --- a/src/gallium/drivers/cell/ppu/cell_buffer.c +++ b/src/gallium/drivers/cell/ppu/cell_buffer.c @@ -30,8 +30,8 @@ #include "util/u_memory.h" #include "util/u_math.h" -#include "sp_screen.h" -#include "sp_buffer.h" +#include "cell_screen.h" +#include "cell_buffer.h" static void * diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h index a77cc5b9067..233b91dec6b 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.h +++ b/src/gallium/drivers/cell/ppu/cell_context.h @@ -34,7 +34,7 @@ #include "pipe/p_defines.h" #include "draw/draw_vertex.h" #include "draw/draw_vbuf.h" -#include "cell_winsys.h" +/*#include "cell_winsys.h"*/ #include "cell/common.h" #include "rtasm/rtasm_ppc_spe.h" #include "tgsi/tgsi_scan.h" diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index bd15034a5d1..15d4e8338f4 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -63,21 +63,21 @@ cell_draw_range_elements(struct pipe_context *pipe, unsigned max_index, unsigned mode, unsigned start, unsigned count) { - struct cell_context *sp = cell_context(pipe); - struct draw_context *draw = sp->draw; + struct cell_context *cell = cell_context(pipe); + struct draw_context *draw = cell->draw; unsigned i; - if (sp->dirty) - cell_update_derived( sp ); + if (cell->dirty) + cell_update_derived( cell ); #if 0 - cell_map_surfaces(sp); + cell_map_surfaces(cell); #endif /* * Map vertex buffers */ - for (i = 0; i < sp->num_vertex_buffers; i++) { + for (i = 0; i < cell->num_vertex_buffers; i++) { void *buf = cell_buffer(cell->vertex_buffer[i].buffer)->data; draw_set_mapped_vertex_buffer(draw, i, buf); } @@ -98,7 +98,7 @@ cell_draw_range_elements(struct pipe_context *pipe, /* * unmap vertex/index buffers - will cause draw module to flush */ - for (i = 0; i < sp->num_vertex_buffers; i++) { + for (i = 0; i < cell->num_vertex_buffers; i++) { draw_set_mapped_vertex_buffer(draw, i, NULL); } if (indexBuffer) { diff --git a/src/gallium/drivers/cell/ppu/cell_fence.c b/src/gallium/drivers/cell/ppu/cell_fence.c index e10071529a8..035ef41b898 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.c +++ b/src/gallium/drivers/cell/ppu/cell_fence.c @@ -92,7 +92,6 @@ cell_add_buffer_to_list(struct cell_context *cell, struct cell_buffer_list *list, struct pipe_buffer *buffer) { - struct pipe_screen *ps = cell->pipe.screen; struct cell_buffer_node *node = CALLOC_STRUCT(cell_buffer_node); /* create new list node which references the buffer, insert at head */ if (node) { @@ -157,8 +156,13 @@ cell_add_fenced_textures(struct cell_context *cell) printf("Adding texture %p buffer %p to list\n", ct, ct->tiled_buffer[level]); #endif - if (ct->buffer) +#if 00 + /* XXX this needs to be fixed/restored! + * Maybe keep pointers to textures, not buffers. + */ + if (ct->base.buffer) cell_add_buffer_to_list(cell, list, ct->buffer); +#endif } } } diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c index 3d8b4409c75..dce10ae7f86 100644 --- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c +++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c @@ -292,17 +292,23 @@ cell_set_sampler_textures(struct pipe_context *pipe, static void cell_map_surfaces(struct cell_context *cell) { +#if 0 struct pipe_screen *screen = cell->pipe.screen; +#endif uint i; for (i = 0; i < 1; i++) { struct pipe_surface *ps = cell->framebuffer.cbufs[i]; if (ps) { struct cell_texture *ct = cell_texture(ps->texture); +#if 0 cell->cbuf_map[i] = screen->buffer_map(screen, ct->buffer, (PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE)); +#else + cell->cbuf_map[i] = ct->data; +#endif } } @@ -310,10 +316,14 @@ cell_map_surfaces(struct cell_context *cell) struct pipe_surface *ps = cell->framebuffer.zsbuf; if (ps) { struct cell_texture *ct = cell_texture(ps->texture); +#if 0 cell->zsbuf_map = screen->buffer_map(screen, ct->buffer, (PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE)); +#else + cell->zsbuf_map = ct->data; +#endif } } } @@ -325,17 +335,17 @@ cell_map_surfaces(struct cell_context *cell) static void cell_unmap_surfaces(struct cell_context *cell) { - struct pipe_screen *screen = cell->pipe.screen; + /*struct pipe_screen *screen = cell->pipe.screen;*/ uint i; for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { struct pipe_surface *ps = cell->framebuffer.cbufs[i]; if (ps && cell->cbuf_map[i]) { - struct cell_texture *ct = cell_texture(ps->texture); + /*struct cell_texture *ct = cell_texture(ps->texture);*/ assert(ps->texture); - assert(ct->buffer); + /*assert(ct->buffer);*/ - screen->buffer_unmap(screen, ct->buffer); + /*screen->buffer_unmap(screen, ct->buffer);*/ cell->cbuf_map[i] = NULL; } } @@ -343,8 +353,8 @@ cell_unmap_surfaces(struct cell_context *cell) { struct pipe_surface *ps = cell->framebuffer.zsbuf; if (ps && cell->zsbuf_map) { - struct cell_texture *ct = cell_texture(ps->texture); - screen->buffer_unmap(screen, ct->buffer); + /*struct cell_texture *ct = cell_texture(ps->texture);*/ + /*screen->buffer_unmap(screen, ct->buffer);*/ cell->zsbuf_map = NULL; } } diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 00035be53a1..fc04767a1ee 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -174,7 +174,7 @@ cell_destroy_screen( struct pipe_screen *screen ) struct pipe_screen * cell_create_screen(struct sw_winsys *winsys) { - struct cell_screen *screen = CALLOC_STRUCT(pipe_screen); + struct cell_screen *screen = CALLOC_STRUCT(cell_screen); if (!screen) return NULL; @@ -194,5 +194,5 @@ cell_create_screen(struct sw_winsys *winsys) cell_init_screen_texture_funcs(&screen->base); cell_init_screen_buffer_funcs(&screen->base); - return screen; + return &screen->base; } diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 63424028547..9e29ddc2d45 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -183,7 +183,7 @@ cell_delete_vs_state(struct pipe_context *pipe, void *vs) static void cell_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, - struct pipe_buffer *buf) + struct pipe_buffer *constants) { struct cell_context *cell = cell_context(pipe); unsigned size = constants ? constants->size : 0; @@ -198,7 +198,7 @@ cell_set_constant_buffer(struct pipe_context *pipe, draw_flush(cell->draw); /* note: reference counting */ - pipe_buffer_reference(&cell->constants[shader], buf); + pipe_buffer_reference(&cell->constants[shader], constants); if(shader == PIPE_SHADER_VERTEX) { draw_set_mapped_constant_buffer(cell->draw, PIPE_SHADER_VERTEX, 0, diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 002dd3a9b55..c8a1acd86a9 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -40,6 +40,7 @@ #include "util/u_memory.h" #include "cell_context.h" +#include "cell_screen.h" #include "cell_state.h" #include "cell_texture.h" @@ -142,7 +143,7 @@ cell_texture_create(struct pipe_screen *screen, fail: if (ct->dt) { - struct sw_winsys winsys = cell_screen(screen)->winsys; + struct sw_winsys *winsys = cell_screen(screen)->winsys; winsys->displaytarget_destroy(winsys, ct->dt); } @@ -531,7 +532,9 @@ cell_flush_frontbuffer(struct pipe_screen *_screen, /* Need to untwiddle from our internal representation here: */ { - unsigned *map = winsys->displaytarget_map(winsys, ct->dt); + unsigned *map = winsys->displaytarget_map(winsys, ct->dt, + (PIPE_BUFFER_USAGE_CPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE)); unsigned *src = (unsigned *)(ct->data + ct->level_offset[surface->level]); untwiddle_image_uint(surface->width, @@ -541,7 +544,7 @@ cell_flush_frontbuffer(struct pipe_screen *_screen, ct->dt_stride, src); - winsys->displaytarget_unmap(winsys, c->dt); + winsys->displaytarget_unmap(winsys, ct->dt); } winsys->displaytarget_display(winsys, ct->dt, context_private); diff --git a/src/gallium/drivers/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h index b89db1a5a8c..2be05793122 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.h +++ b/src/gallium/drivers/cell/ppu/cell_texture.h @@ -28,6 +28,7 @@ #ifndef CELL_TEXTURE_H #define CELL_TEXTURE_H +#include "cell/common.h" struct cell_context; struct pipe_texture; diff --git a/src/gallium/include/state_tracker/sw_winsys.h b/src/gallium/include/state_tracker/sw_winsys.h index 719c3f3eee1..0de98bbc1c9 100644 --- a/src/gallium/include/state_tracker/sw_winsys.h +++ b/src/gallium/include/state_tracker/sw_winsys.h @@ -88,6 +88,9 @@ struct sw_winsys unsigned alignment, unsigned *stride ); + /** + * \param flags bitmask of PIPE_BUFFER_USAGE_x flags + */ void * (*displaytarget_map)( struct sw_winsys *ws, struct sw_displaytarget *dt, diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 2ad1aab4397..d943953bd1a 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -33,11 +33,8 @@ */ - - #include "xlib.h" - #if defined(GALLIUM_CELL) #include "cell/ppu/cell_texture.h" @@ -46,9 +43,18 @@ #include "util/u_debug.h" - - - +/** + * Display/copy the image in the surface into the X window specified + * by the XMesaBuffer. + */ +static void +xm_cell_displaytarget_display(struct sw_winsys *ws, + struct sw_displaytarget *dt, + void *context_private) +{ + struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private; + xlib_sw_display(xlib_drawable, dt); +} static struct pipe_screen * @@ -64,7 +70,7 @@ xlib_create_cell_screen( Display *dpy ) /* Plug in a little cell-specific code: */ - ws->base.displaytarget_display = xm_cell_displaytarget_display; + winsys->displaytarget_display = xm_cell_displaytarget_display; screen = cell_create_screen(winsys); if (screen == NULL) @@ -80,13 +86,10 @@ fail: } - - struct xm_driver xlib_cell_driver = { .create_pipe_screen = xlib_create_cell_screen, }; - #endif /* GALLIUM_CELL */ |