X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fcell%2Fppu%2Fcell_context.c;h=afcea616d5934c8743c578742184865566d11aa5;hb=a56da1005d30da60701e33b75d5f4f37096df060;hp=22d552d8e3d8fd98bfa7f14a739429b964d490b0;hpb=608e14c5b265d331f89959b8e477796ac21c297c;p=mesa.git diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c index 22d552d8e3d..afcea616d59 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.c +++ b/src/gallium/drivers/cell/ppu/cell_context.c @@ -36,7 +36,6 @@ #include "pipe/p_defines.h" #include "pipe/p_format.h" #include "util/u_memory.h" -#include "pipe/p_winsys.h" #include "pipe/p_screen.h" #include "draw/draw_context.h" @@ -99,10 +98,32 @@ static const struct debug_named_value cell_debug_flags[] = { {NULL, 0} }; +static unsigned int +cell_is_texture_referenced( struct pipe_context *pipe, + struct pipe_texture *texture, + unsigned face, unsigned level) +{ + /** + * FIXME: Optimize. + */ + + return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; +} + +static unsigned int +cell_is_buffer_referenced( struct pipe_context *pipe, + struct pipe_buffer *buf) +{ + /** + * FIXME: Optimize. + */ + + return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; +} struct pipe_context * cell_create_context(struct pipe_screen *screen, - struct cell_winsys *cws) + void *priv ) { struct cell_context *cell; uint i; @@ -114,14 +135,18 @@ cell_create_context(struct pipe_screen *screen, memset(cell, 0, sizeof(*cell)); - cell->winsys = cws; - cell->pipe.winsys = screen->winsys; + cell->winsys = NULL; /* XXX: fixme - get this from screen? */ + cell->pipe.winsys = NULL; cell->pipe.screen = screen; + cell->pipe.priv = priv; cell->pipe.destroy = cell_destroy_context; - cell->pipe.clear = cell_clear_surface; + cell->pipe.clear = cell_clear; cell->pipe.flush = cell_flush; + cell->pipe.is_texture_referenced = cell_is_texture_referenced; + cell->pipe.is_buffer_referenced = cell_is_buffer_referenced; + #if 0 cell->pipe.begin_query = cell_begin_query; cell->pipe.end_query = cell_end_query; @@ -162,7 +187,7 @@ cell_create_context(struct pipe_screen *screen, */ /* This call only works with SDK 3.0. Anyone still using 2.1??? */ cell->num_cells = spe_cpu_info_get(SPE_COUNT_PHYSICAL_CPU_NODES, -1); - cell->num_spus = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, 0); + cell->num_spus = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, -1); if (cell->debug_flags) { printf("Cell: found %d Cell(s) with %u SPUs\n", cell->num_cells, cell->num_spus);