From b43c182f19c6291c88420fa12714f952c2b461fb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Mar 2010 15:23:16 +0000 Subject: Squashed commit of gallium-context-transfers: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 7a2ee04629681e59ea147b440856c4f9a33ae9f8 Author: Keith Whitwell Date: Thu Mar 11 14:19:17 2010 +0000 nv: convert to context transfers commit 188a3f5331c8e5966729fd59d02975afb7324adc Author: Keith Whitwell Date: Thu Mar 11 14:11:10 2010 +0000 nouveau: remove unused variable commit 5c8e880ab4dc020358c08728b8adb1637d2dc5bc Author: Keith Whitwell Date: Thu Mar 11 12:31:21 2010 +0000 mesa/st: fix compilation after merge commit c552595333f860c2a4807e195596acdf5d6a5ef8 Author: Keith Whitwell Date: Thu Mar 11 12:31:06 2010 +0000 util: fix compilation after merge commit e80836878a3617b0e350d2a8f92311832a1476cb Author: Keith Whitwell Date: Thu Mar 11 12:30:47 2010 +0000 r300g: fix compilation after merge commit 0e4883e9511b9db4e75a4dbc78d7bb970badc15d Author: Keith Whitwell Date: Thu Mar 11 12:18:45 2010 +0000 i965g: fix incorrect merge commit 17d74133d8168eebf93bf1390de79930fc8da231 Merge: cb81c79 aa311ae Author: Keith Whitwell Date: Thu Mar 11 12:08:32 2010 +0000 Merge commit 'origin/master' into gallium-context-transfers Conflicts: src/gallium/drivers/i965/brw_screen_texture.c src/gallium/drivers/r300/r300_screen.c src/gallium/drivers/softpipe/sp_texture.c src/gallium/drivers/svga/svga_screen_texture.c src/gallium/state_trackers/egl/x11/native_ximage.c commit cb81c79098bc3a92a4d2a3dcc0edc972dfb407be Author: Keith Whitwell Date: Tue Mar 2 16:04:01 2010 +0000 egl/x11: hack for context transfers There is a better approach to this in the winsys-handle branch, but for now avoid using transfers at all by always allocating our own backing store directly. commit f44a24e1d4ad7563f3eedd6b3a5688f53a36265c Author: Keith Whitwell Date: Tue Mar 2 16:03:16 2010 +0000 llvmpipe: context transfers commit 4d7475ef8104b3b478c7c6ce77cd3506c57e25d1 Author: Keith Whitwell Date: Tue Mar 2 16:02:50 2010 +0000 llvmpipe: disable testprogs build Not working. commit a9bf98c4d36bd92a76f81e83747eb9b8f0a0515f Merge: ee0f97e 0c616da Author: Keith Whitwell Date: Tue Mar 2 15:28:25 2010 +0000 Merge commit 'origin/master' into gallium-context-transfers Conflicts: src/mesa/state_tracker/st_cb_accum.c src/mesa/state_tracker/st_cb_bitmap.c commit ee0f97e8d9fd5ef57211a8e1268f505c9829e246 Merge: a7f078e 828f545 Author: Keith Whitwell Date: Fri Feb 19 13:00:29 2010 +0000 Merge commit 'origin/master' into gallium-context-transfers Conflicts: src/gallium/auxiliary/util/u_debug.h src/gallium/drivers/i915/i915_context.h src/gallium/drivers/llvmpipe/lp_flush.c src/gallium/drivers/nv30/nv30_screen.h src/gallium/drivers/nv40/nv40_context.h src/gallium/drivers/nv40/nv40_screen.h src/gallium/drivers/nv50/nv50_context.h src/gallium/drivers/r300/r300_screen.c src/gallium/drivers/r300/r300_winsys.h src/gallium/drivers/softpipe/sp_context.c src/gallium/drivers/trace/tr_context.c src/gallium/state_trackers/dri/dri_context.c src/gallium/state_trackers/egl/common/egl_g3d.c src/gallium/state_trackers/python/st_device.c src/gallium/winsys/drm/radeon/core/radeon_drm.c commit a7f078e16d851b53ef316066dcced46eb39ebe24 Author: Keith Whitwell Date: Fri Feb 5 14:16:11 2010 +0000 gallium: move texture transfers to pipe_context commit 7b2ffc2019d72e833afea7eebf3e80121187375d Merge: 51e190e c036d13 Author: Keith Whitwell Date: Fri Feb 5 09:55:02 2010 +0000 Merge commit 'origin/master' into gallium-screen-context Conflicts: src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c This branch has got a pretty tortured history now, I expect a squash merge will be appropriate when it is done. commit 51e190e95acf120f72768fafb29e9721e358df1b Author: Keith Whitwell Date: Thu Feb 4 17:58:02 2010 +0000 gallium: fix some build issues commit f524bdaa723fb181637ad30c6ad708aeedabe25b Merge: f906212 3aba0a2 Author: Keith Whitwell Date: Thu Feb 4 17:51:32 2010 +0000 Merge commit 'origin/master' into gallium-screen-context commit f9062126883199eabf045714c717cd35f4b7b313 Author: Keith Whitwell Date: Thu Feb 4 17:17:12 2010 +0000 gallium/docs: small description of screen::create_context commit efcb37bd3d5ed37f06c6105bd2d750b374ec0927 Author: Keith Whitwell Date: Thu Feb 4 16:42:42 2010 +0000 drm/radeon: more dead create_context wrapper removal commit 6badc0dd9e06cf2ec936940bcf12b9ef5324b301 Author: Keith Whitwell Date: Thu Feb 4 16:42:30 2010 +0000 drm/i965: more dead create_context wrapper removal commit cf04ebd5a54b18b2d894cfdab2b0f2fd55626ffc Author: Keith Whitwell Date: Thu Feb 4 16:42:05 2010 +0000 st/python: more dead create_context wrapper removal commit 444f114c3516abf71c430e6e9d0d2ae3b80679d3 Author: Keith Whitwell Date: Thu Feb 4 16:37:58 2010 +0000 idenity: wrapped context creation commit 5a6d09cb9e468d1ee6c8d54b887618819d8d94f2 Author: Keith Whitwell Date: Thu Feb 4 16:28:47 2010 +0000 ws/gdi: remove dead context_create wrapper commit 132b55f4bec39386ac625f09aaa11f609664024c Author: Keith Whitwell Date: Thu Feb 4 16:27:52 2010 +0000 ws/gdi: remove dead context_create wrapper commit 56d2d21a0cdcb197a364049d354c2f15a4fc026a Author: Keith Whitwell Date: Thu Feb 4 16:25:38 2010 +0000 st/xorg: use screen::context_create commit 838c5cfe56b2af6c644909bed3c5e7cdd64c336a Author: Keith Whitwell Date: Thu Feb 4 16:23:20 2010 +0000 glx/xlib: simplify creation of trace-wrapped contexts Trace screen knows how to properly wrap context creation in the wrapped screen, so nothing special to do here. commit c99404c03ebaec4175f08a2f363e43c9085f2635 Author: Keith Whitwell Date: Thu Feb 4 16:18:24 2010 +0000 st/python: no need to special case context creation for trace commit 193a527a682b6877bb1faecd8092df4dfd055a18 Author: Keith Whitwell Date: Thu Feb 4 16:15:30 2010 +0000 drm/radeon: remove dead create_context declaration commit bb984eecc25cf23bc77e1c818b81165ba1a07c9a Author: Keith Whitwell Date: Thu Feb 4 16:14:58 2010 +0000 nv/drm: remove dead create_context ref commit e809313a44287dc4e16c28e9e74ef3b2b5271aa1 Author: Keith Whitwell Date: Thu Feb 4 16:12:51 2010 +0000 st/egl: remove a layer of wrappers around screen::create_context commit 39caa6672a04122f185c22e17aab86d1c40938bf Author: Keith Whitwell Date: Thu Feb 4 16:05:28 2010 +0000 r300g: fill in screen::context_create commit 407f12556d16ba0656774d8a1d9ebda22f82f473 Author: Keith Whitwell Date: Thu Feb 4 16:04:04 2010 +0000 cell: adapt for screen::create_context, untested commit d02b0c6ce321a04c76fdabb09e0e4380ce1c1376 Author: Keith Whitwell Date: Thu Feb 4 15:50:24 2010 +0000 drm/nv: adapt for screen::create_context All contexts now created directly through the screen, so remove equivalent code here. Remove apparently un-needed array of contexts in the winsys. commit 53eec5b1349aa1b6892a75a7bff7e7530957aeae Author: Keith Whitwell Date: Thu Feb 4 15:50:08 2010 +0000 stw: adapt for screen::create_context, untested commit c6a64de3eb381bc9a88e9fbdecbf87d77925aaf5 Author: Keith Whitwell Date: Thu Feb 4 15:49:20 2010 +0000 trace: expose the wrapped context's priv data If we are going to keep this priv idea, really want an accessor function for it so that trace and other drivers can wrap that. commit 75d6104e11d86ec2b0749627ed58e35f856ee6eb Author: Keith Whitwell Date: Thu Feb 4 15:47:55 2010 +0000 nv30: adapt to screen::context_create commit 12f5deb6ed9723e9b5d34577052b8365813ca14e Author: Keith Whitwell Date: Thu Feb 4 15:44:47 2010 +0000 nv40: adapt to screen::context_create commit 14baccaa3b6bbb3b91056126f6521828e786dc62 Author: Keith Whitwell Date: Thu Feb 4 15:35:27 2010 +0000 nv50: adapt to screen::create_context Not build tested. Need to figure out how to build nouveau. commit a0e94505ccd2d7f3e604465a2ac302f1286b73b6 Author: Keith Whitwell Date: Thu Feb 4 15:22:27 2010 +0000 llvmpipe: update for screen::create_context, untested commit 0eae17107c950346030e4f7e0ec232f868d3893d Author: Keith Whitwell Date: Thu Feb 4 15:16:57 2010 +0000 xlib/llvmpipe: remove dead winsys context creation path commit 2f69f9ffaa7e2a01d2483277246ed13051ae4ca3 Author: Keith Whitwell Date: Thu Feb 4 14:58:27 2010 +0000 gallium: convert most code to use screen::create_context I wish I could build all of gallium at once to find breakages. commit d7b57f4061b82322cbcae176125913d9f0dea6c1 Author: Keith Whitwell Date: Thu Feb 4 12:46:21 2010 +0000 glx: permit building with older protocol headers I'd like to be able to build mesa on current distro releases without having to upgrade from the standard dri2proto and glproto headers. With this change I'm able to build on ancient releases such as Ubuntu 9-10... In general, it would be nice to be able to build-test mesa to check for unintended breakages without having to follow the external dependencies of every group working on the codebase. commit 57adedd6fb06c98572ed8d4aef19203df4c4eea2 Merge: da71847 e1906ae Author: Keith Whitwell Date: Thu Feb 4 11:38:15 2010 +0000 Merge commit 'origin/master' into gallium-screen-context Conflicts: src/gallium/drivers/softpipe/sp_video_context.h src/gallium/drivers/trace/tr_context.c src/gallium/state_trackers/wgl/shared/stw_context.c src/gallium/winsys/gdi/gdi_softpipe_winsys.c commit da71847ea6414d7e352c6094f8963bb4eda344dc Author: José Fonseca Date: Sat May 2 08:57:39 2009 +0100 wgl: Use pipe_screen::context_create. commit 2595a188f93fd903600ef5d8517737ee0592035d Author: José Fonseca Date: Sat May 2 08:56:47 2009 +0100 trace: Implement pipe_screen::context_create. commit f3640e4ae37a5260cbfba999d079f827de0a313a Author: José Fonseca Date: Sat May 2 08:56:17 2009 +0100 softpipe: Implement pipe_screen::context_create. commit 347266bddc8bd39c711bacb2193793759d0f3696 Author: José Fonseca Date: Sat May 2 08:55:31 2009 +0100 gallium: New pipe_screen::context_create callback. --- src/gallium/drivers/r300/r300_context.c | 3 +++ src/gallium/drivers/r300/r300_context.h | 1 + src/gallium/drivers/r300/r300_screen.c | 4 ++-- src/gallium/drivers/r300/r300_transfer.c | 39 ++++++++++++++++++-------------- src/gallium/drivers/r300/r300_transfer.h | 4 +++- 5 files changed, 31 insertions(+), 20 deletions(-) (limited to 'src/gallium/drivers/r300') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 923e1e541f..8606c0004e 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -34,6 +34,7 @@ #include "r300_screen.h" #include "r300_state_invariant.h" #include "r300_texture.h" +#include "r300_transfer.h" #include "radeon_winsys.h" @@ -209,6 +210,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300_init_query_functions(r300); + r300_init_transfer_functions(r300); + /* r300_init_surface_functions(r300); */ r300_init_state_functions(r300); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 985e339112..03b09603c7 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -404,6 +404,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, struct draw_stage* r300_draw_stage(struct r300_context* r300); void r300_init_state_functions(struct r300_context* r300); void r300_init_surface_functions(struct r300_context* r300); +void r300_init_tex_functions( struct pipe_context *pipe ); static INLINE boolean CTX_DBG_ON(struct r300_context * ctx, unsigned flags) { diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5880eecd5f..69c0ab496c 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -27,7 +27,6 @@ #include "r300_context.h" #include "r300_texture.h" -#include "r300_transfer.h" #include "radeon_winsys.h" #include "r300_winsys.h" @@ -252,6 +251,8 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, return retval == usage; } + + static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); @@ -290,7 +291,6 @@ struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) r300screen->screen.context_create = r300_create_context; r300_init_screen_texture_functions(&r300screen->screen); - r300_init_screen_transfer_functions(&r300screen->screen); u_simple_screen_init(&r300screen->screen); return &r300screen->screen; diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index ec89681a3c..7dd707ff8e 100644 --- a/src/gallium/drivers/r300/r300_transfer.c +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -118,15 +118,15 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx, } static struct pipe_transfer* -r300_get_tex_transfer(struct pipe_screen *screen, +r300_get_tex_transfer(struct pipe_context *ctx, struct pipe_texture *texture, unsigned face, unsigned level, unsigned zslice, enum pipe_transfer_usage usage, unsigned x, unsigned y, unsigned w, unsigned h) { struct r300_texture *tex = (struct r300_texture *)texture; + struct r300_screen *r300screen = r300_screen(ctx->screen); struct r300_transfer *trans; - struct r300_screen *r300screen = r300_screen(screen); struct pipe_texture template; trans = CALLOC_STRUCT(r300_transfer); @@ -136,7 +136,7 @@ r300_get_tex_transfer(struct pipe_screen *screen, trans->transfer.usage = usage; trans->transfer.width = w; trans->transfer.height = h; - trans->ctx = r300screen->ctx; + trans->ctx = ctx; trans->x = x; trans->y = y; trans->level = level; @@ -174,8 +174,10 @@ r300_get_tex_transfer(struct pipe_screen *screen, } /* Create the temporary texture. */ - trans->detiled_texture = - (struct r300_texture*)screen->texture_create(screen, &template); + trans->detiled_texture = (struct r300_texture*) + ctx->screen->texture_create(ctx->screen, + &template); + assert(!trans->detiled_texture->microtile && !trans->detiled_texture->macrotile); @@ -187,7 +189,7 @@ r300_get_tex_transfer(struct pipe_screen *screen, if (usage & PIPE_TRANSFER_READ) { /* We cannot map a tiled texture directly because the data is * in a different order, therefore we do detiling using a blit. */ - r300_copy_from_tiled_texture(r300screen->ctx, trans); + r300_copy_from_tiled_texture(ctx, trans); } } else { trans->transfer.x = x; @@ -219,7 +221,7 @@ static void r300_tex_transfer_destroy(struct pipe_transfer *trans) FREE(trans); } -static void* r300_transfer_map(struct pipe_screen *screen, +static void* r300_transfer_map(struct pipe_context *ctx, struct pipe_transfer *transfer) { struct r300_transfer *r300transfer = r300_transfer(transfer); @@ -230,12 +232,12 @@ static void* r300_transfer_map(struct pipe_screen *screen, if (r300transfer->detiled_texture) { /* The detiled texture is of the same size as the region being mapped * (no offset needed). */ - return pipe_buffer_map(screen, + return pipe_buffer_map(ctx->screen, r300transfer->detiled_texture->buffer, pipe_transfer_buffer_flags(transfer)); } else { /* Tiling is disabled. */ - map = pipe_buffer_map(screen, tex->buffer, + map = pipe_buffer_map(ctx->screen, tex->buffer, pipe_transfer_buffer_flags(transfer)); if (!map) { @@ -248,23 +250,26 @@ static void* r300_transfer_map(struct pipe_screen *screen, } } -static void r300_transfer_unmap(struct pipe_screen *screen, +static void r300_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *transfer) { struct r300_transfer *r300transfer = r300_transfer(transfer); struct r300_texture *tex = (struct r300_texture*)transfer->texture; if (r300transfer->detiled_texture) { - pipe_buffer_unmap(screen, r300transfer->detiled_texture->buffer); + pipe_buffer_unmap(ctx->screen, r300transfer->detiled_texture->buffer); } else { - pipe_buffer_unmap(screen, tex->buffer); + pipe_buffer_unmap(ctx->screen, tex->buffer); } } -void r300_init_screen_transfer_functions(struct pipe_screen *screen) + +void r300_init_transfer_functions( struct r300_context *r300ctx ) { - screen->get_tex_transfer = r300_get_tex_transfer; - screen->tex_transfer_destroy = r300_tex_transfer_destroy; - screen->transfer_map = r300_transfer_map; - screen->transfer_unmap = r300_transfer_unmap; + struct pipe_context *ctx = &r300ctx->context; + + ctx->get_tex_transfer = r300_get_tex_transfer; + ctx->tex_transfer_destroy = r300_tex_transfer_destroy; + ctx->transfer_map = r300_transfer_map; + ctx->transfer_unmap = r300_transfer_unmap; } diff --git a/src/gallium/drivers/r300/r300_transfer.h b/src/gallium/drivers/r300/r300_transfer.h index 60d1d3dc85..79baf6d048 100644 --- a/src/gallium/drivers/r300/r300_transfer.h +++ b/src/gallium/drivers/r300/r300_transfer.h @@ -26,6 +26,8 @@ #include "pipe/p_screen.h" -void r300_init_screen_transfer_functions(struct pipe_screen *screen); +struct r300_context; + +void r300_init_transfer_functions(struct r300_context *r300ctx); #endif -- cgit v1.2.3 From d35ecca5ee231c072687578642e0c22c6c0590b1 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Mar 2010 16:10:25 +0000 Subject: gallium: remove pipe_context member from pipe_transfer There was very little use for this beyond permitting the pipe_context::tex_transfer_destroy() function to omit the pipe_context argument. This change adds the pipe_context argument into tex_transfer_destroy() so that it looks like other pipe_context functions, and removes the pipe_context pointer from pipe_transfer. --- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 2 +- src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 2 +- src/gallium/auxiliary/util/u_debug.c | 11 +++++----- src/gallium/auxiliary/util/u_debug.h | 3 ++- src/gallium/auxiliary/util/u_gen_mipmap.c | 12 +++++------ src/gallium/auxiliary/util/u_inlines.h | 14 ++++++------- src/gallium/auxiliary/util/u_rect.c | 6 +++--- src/gallium/auxiliary/util/u_tile.c | 26 +++++++++++++----------- src/gallium/auxiliary/util/u_tile.h | 18 ++++++++++------ src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 2 +- src/gallium/drivers/i915/i915_texture.c | 4 ++-- src/gallium/drivers/i965/brw_screen.h | 1 + src/gallium/drivers/i965/brw_screen_texture.c | 4 ++-- src/gallium/drivers/identity/id_context.c | 6 ++++-- src/gallium/drivers/identity/id_objects.c | 12 +++++++---- src/gallium/drivers/identity/id_objects.h | 4 +++- src/gallium/drivers/llvmpipe/lp_scene.c | 4 ++-- src/gallium/drivers/llvmpipe/lp_texture.c | 3 ++- src/gallium/drivers/nv30/nv30_transfer.c | 5 +++-- src/gallium/drivers/nv40/nv40_transfer.c | 4 ++-- src/gallium/drivers/nv50/nv50_transfer.c | 4 ++-- src/gallium/drivers/r300/r300_screen.c | 2 -- src/gallium/drivers/r300/r300_transfer.c | 3 ++- src/gallium/drivers/softpipe/sp_tex_tile_cache.c | 11 +++++----- src/gallium/drivers/softpipe/sp_texture.c | 4 ++-- src/gallium/drivers/softpipe/sp_tile_cache.c | 19 +++++++++-------- src/gallium/drivers/svga/svga_screen_texture.c | 5 +++-- src/gallium/drivers/trace/tr_context.c | 9 ++++---- src/gallium/drivers/trace/tr_rbug.c | 2 +- src/gallium/drivers/trace/tr_texture.c | 16 ++++++++------- src/gallium/drivers/trace/tr_texture.h | 4 +++- src/gallium/include/pipe/p_context.h | 3 ++- src/gallium/include/pipe/p_state.h | 2 -- src/gallium/state_trackers/vega/api_filters.c | 2 +- src/gallium/state_trackers/vega/api_images.c | 4 ++-- src/gallium/state_trackers/vega/image.c | 8 ++++---- src/gallium/state_trackers/vega/paint.c | 2 +- src/mesa/state_tracker/st_atom_pixeltransfer.c | 2 +- src/mesa/state_tracker/st_cb_accum.c | 14 ++++++------- src/mesa/state_tracker/st_cb_bitmap.c | 8 ++++---- src/mesa/state_tracker/st_cb_drawpixels.c | 18 ++++++++-------- src/mesa/state_tracker/st_cb_readpixels.c | 22 ++++++++++---------- src/mesa/state_tracker/st_cb_texture.c | 12 +++++------ src/mesa/state_tracker/st_gen_mipmap.c | 4 ++-- src/mesa/state_tracker/st_texture.c | 4 ++-- 45 files changed, 177 insertions(+), 150 deletions(-) (limited to 'src/gallium/drivers/r300') diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 2cb76b25ae..1c07ab1365 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -449,7 +449,7 @@ aaline_create_texture(struct aaline_stage *aaline) /* unmap */ pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } return TRUE; } diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 479777e807..38c22bf4e9 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -411,7 +411,7 @@ pstip_update_texture(struct pstip_stage *pstip) /* unmap */ pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index de775a2dbc..e997cfa8a3 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -459,7 +459,7 @@ void debug_dump_surface(struct pipe_context *pipe, pipe->transfer_unmap(pipe, transfer); error: - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } @@ -530,14 +530,15 @@ debug_dump_surface_bmp(struct pipe_context *pipe, PIPE_TRANSFER_READ, 0, 0, surface->width, surface->height); - debug_dump_transfer_bmp(filename, transfer); + debug_dump_transfer_bmp(pipe, filename, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); #endif } void -debug_dump_transfer_bmp(const char *filename, +debug_dump_transfer_bmp(struct pipe_context *pipe, + const char *filename, struct pipe_transfer *transfer) { #ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT @@ -550,7 +551,7 @@ debug_dump_transfer_bmp(const char *filename, if(!rgba) goto error1; - pipe_get_tile_rgba(transfer, 0, 0, + pipe_get_tile_rgba(pipe, transfer, 0, 0, transfer->width, transfer->height, rgba); diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index a383837743..98addeb372 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -331,7 +331,8 @@ void debug_dump_texture(struct pipe_context *pipe, void debug_dump_surface_bmp(struct pipe_context *pipe, const char *filename, struct pipe_surface *surface); -void debug_dump_transfer_bmp(const char *filename, +void debug_dump_transfer_bmp(struct pipe_context *pipe, + const char *filename, struct pipe_transfer *transfer); void debug_dump_float_rgba_bmp(const char *filename, unsigned width, unsigned height, diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 46fbde3f4a..5c51b53d7b 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1146,8 +1146,8 @@ make_1d_mipmap(struct gen_mipmap_state *ctx, pipe->transfer_unmap(pipe, srcTrans); pipe->transfer_unmap(pipe, dstTrans); - pipe->tex_transfer_destroy(srcTrans); - pipe->tex_transfer_destroy(dstTrans); + pipe->tex_transfer_destroy(pipe, srcTrans); + pipe->tex_transfer_destroy(pipe, dstTrans); } } @@ -1190,8 +1190,8 @@ make_2d_mipmap(struct gen_mipmap_state *ctx, pipe->transfer_unmap(pipe, srcTrans); pipe->transfer_unmap(pipe, dstTrans); - pipe->tex_transfer_destroy(srcTrans); - pipe->tex_transfer_destroy(dstTrans); + pipe->tex_transfer_destroy(pipe, srcTrans); + pipe->tex_transfer_destroy(pipe, dstTrans); } } @@ -1235,8 +1235,8 @@ make_3d_mipmap(struct gen_mipmap_state *ctx, pipe->transfer_unmap(pipe, srcTrans); pipe->transfer_unmap(pipe, dstTrans); - pipe->tex_transfer_destroy(srcTrans); - pipe->tex_transfer_destroy(dstTrans); + pipe->tex_transfer_destroy(pipe, srcTrans); + pipe->tex_transfer_destroy(pipe, dstTrans); } #else (void) reduce_3d; diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index ada31b8182..e7255e3baa 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -264,24 +264,24 @@ pipe_buffer_read(struct pipe_screen *screen, } static INLINE void * -pipe_transfer_map( struct pipe_transfer *transf ) +pipe_transfer_map( struct pipe_context *context, + struct pipe_transfer *transf ) { - struct pipe_context *context = transf->pipe; return context->transfer_map(context, transf); } static INLINE void -pipe_transfer_unmap( struct pipe_transfer *transf ) +pipe_transfer_unmap( struct pipe_context *context, + struct pipe_transfer *transf ) { - struct pipe_context *context = transf->pipe; context->transfer_unmap(context, transf); } static INLINE void -pipe_transfer_destroy( struct pipe_transfer *transf ) +pipe_transfer_destroy( struct pipe_context *context, + struct pipe_transfer *transfer ) { - struct pipe_context *context = transf->pipe; - context->tex_transfer_destroy(transf); + context->tex_transfer_destroy(context, transfer); } static INLINE unsigned diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c index 0b8405d01f..e73797f1b7 100644 --- a/src/gallium/auxiliary/util/u_rect.c +++ b/src/gallium/auxiliary/util/u_rect.c @@ -223,8 +223,8 @@ util_surface_copy(struct pipe_context *pipe, pipe->transfer_unmap(pipe, src_trans); pipe->transfer_unmap(pipe, dst_trans); - pipe->tex_transfer_destroy(src_trans); - pipe->tex_transfer_destroy(dst_trans); + pipe->tex_transfer_destroy(pipe, src_trans); + pipe->tex_transfer_destroy(pipe, dst_trans); } @@ -301,5 +301,5 @@ util_surface_fill(struct pipe_context *pipe, } pipe->transfer_unmap(pipe, dst_trans); - pipe->tex_transfer_destroy(dst_trans); + pipe->tex_transfer_destroy(pipe, dst_trans); } diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 70a6d97385..e445895efc 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -45,11 +45,11 @@ * Move raw block of pixels from transfer object to user memory. */ void -pipe_get_tile_raw(struct pipe_transfer *pt, +pipe_get_tile_raw(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, void *dst, int dst_stride) { - struct pipe_context *pipe = pt->pipe; const void *src; if (dst_stride == 0) @@ -73,11 +73,11 @@ pipe_get_tile_raw(struct pipe_transfer *pt, * Move raw block of pixels from user memory to transfer object. */ void -pipe_put_tile_raw(struct pipe_transfer *pt, +pipe_put_tile_raw(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const void *src, int src_stride) { - struct pipe_context *pipe = pt->pipe; void *dst; enum pipe_format format = pt->texture->format; @@ -1246,7 +1246,8 @@ pipe_tile_raw_to_rgba(enum pipe_format format, void -pipe_get_tile_rgba(struct pipe_transfer *pt, +pipe_get_tile_rgba(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, float *p) { @@ -1265,7 +1266,7 @@ pipe_get_tile_rgba(struct pipe_transfer *pt, if(format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) assert((x & 1) == 0); - pipe_get_tile_raw(pt, x, y, w, h, packed, 0); + pipe_get_tile_raw(pipe, pt, x, y, w, h, packed, 0); pipe_tile_raw_to_rgba(format, packed, w, h, p, dst_stride); @@ -1274,7 +1275,8 @@ pipe_get_tile_rgba(struct pipe_transfer *pt, void -pipe_put_tile_rgba(struct pipe_transfer *pt, +pipe_put_tile_rgba(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const float *p) { @@ -1363,7 +1365,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, 0, 0, w, h); } - pipe_put_tile_raw(pt, x, y, w, h, packed, 0); + pipe_put_tile_raw(pipe, pt, x, y, w, h, packed, 0); FREE(packed); } @@ -1373,11 +1375,11 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, * Get a block of Z values, converted to 32-bit range. */ void -pipe_get_tile_z(struct pipe_transfer *pt, +pipe_get_tile_z(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, uint *z) { - struct pipe_context *pipe = pt->pipe; const uint dstStride = w; ubyte *map; uint *pDest = z; @@ -1458,11 +1460,11 @@ pipe_get_tile_z(struct pipe_transfer *pt, void -pipe_put_tile_z(struct pipe_transfer *pt, +pipe_put_tile_z(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const uint *zSrc) { - struct pipe_context *pipe = pt->pipe; const uint srcStride = w; const uint *ptrc = zSrc; ubyte *map; diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h index 1453af38b8..8329087cfa 100644 --- a/src/gallium/auxiliary/util/u_tile.h +++ b/src/gallium/auxiliary/util/u_tile.h @@ -56,34 +56,40 @@ extern "C" { #endif void -pipe_get_tile_raw(struct pipe_transfer *pt, +pipe_get_tile_raw(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, void *p, int dst_stride); void -pipe_put_tile_raw(struct pipe_transfer *pt, +pipe_put_tile_raw(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const void *p, int src_stride); void -pipe_get_tile_rgba(struct pipe_transfer *pt, +pipe_get_tile_rgba(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, float *p); void -pipe_put_tile_rgba(struct pipe_transfer *pt, +pipe_put_tile_rgba(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const float *p); void -pipe_get_tile_z(struct pipe_transfer *pt, +pipe_get_tile_z(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, uint *z); void -pipe_put_tile_z(struct pipe_transfer *pt, +pipe_put_tile_z(struct pipe_context *pipe, + struct pipe_transfer *pt, uint x, uint y, uint w, uint h, const uint *z); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index dcc0014479..beb4722901 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -700,7 +700,7 @@ xfer_buffers_unmap(struct vl_mpeg12_mc_renderer *r) for (i = 0; i < 3; ++i) { r->pipe->transfer_unmap(r->pipe, r->tex_transfer[i]); - r->pipe->tex_transfer_destroy(r->tex_transfer[i]); + r->pipe->tex_transfer_destroy(r->pipe, r->tex_transfer[i]); } } diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 3435f7797f..b252fb5330 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -825,7 +825,6 @@ i915_get_tex_transfer(struct pipe_context *pipe, trans = CALLOC_STRUCT(i915_transfer); if (trans) { pipe_texture_reference(&trans->base.texture, texture); - trans->base.pipe = pipe; trans->base.x = x; trans->base.y = y; trans->base.width = w; @@ -869,7 +868,8 @@ i915_transfer_unmap(struct pipe_context *pipe, } static void -i915_tex_transfer_destroy(struct pipe_transfer *trans) +i915_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *trans) { pipe_texture_reference(&trans->texture, NULL); FREE(trans); diff --git a/src/gallium/drivers/i965/brw_screen.h b/src/gallium/drivers/i965/brw_screen.h index 23e052d0b9..e3a7c64d48 100644 --- a/src/gallium/drivers/i965/brw_screen.h +++ b/src/gallium/drivers/i965/brw_screen.h @@ -202,4 +202,5 @@ boolean brw_is_buffer_referenced_by_bo( struct brw_screen *brw_screen, struct brw_winsys_buffer *bo ); + #endif /* BRW_SCREEN_H */ diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index 52bf9b3c1c..cadcb7cee2 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -504,7 +504,6 @@ brw_get_tex_transfer(struct pipe_context *pipe, trans = CALLOC_STRUCT(brw_transfer); if (trans) { pipe_texture_reference(&trans->base.texture, texture); - trans->base.pipe = pipe; trans->base.x = x; trans->base.y = y; trans->base.width = w; @@ -554,7 +553,8 @@ brw_transfer_unmap(struct pipe_context *pipe, } static void -brw_tex_transfer_destroy(struct pipe_transfer *trans) +brw_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *trans) { pipe_texture_reference(&trans->texture, NULL); FREE(trans); diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 5e371c47c8..26770d6b1e 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -748,9 +748,11 @@ identity_context_get_tex_transfer(struct pipe_context *_context, } static void -identity_context_tex_transfer_destroy(struct pipe_transfer *_transfer) +identity_context_tex_transfer_destroy(struct pipe_context *_pipe, + struct pipe_transfer *_transfer) { - identity_transfer_destroy(identity_transfer(_transfer)); + identity_transfer_destroy(identity_context(_pipe), + identity_transfer(_transfer)); } static void * diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c index 91831404b8..d37fb0042e 100644 --- a/src/gallium/drivers/identity/id_objects.c +++ b/src/gallium/drivers/identity/id_objects.c @@ -30,6 +30,7 @@ #include "id_screen.h" #include "id_objects.h" +#include "id_context.h" struct pipe_buffer * identity_buffer_create(struct identity_screen *id_screen, @@ -160,22 +161,25 @@ identity_transfer_create(struct identity_context *id_context, memcpy(&id_transfer->base, transfer, sizeof(struct pipe_transfer)); id_transfer->base.texture = NULL; - pipe_texture_reference(&id_transfer->base.texture, &id_texture->base); id_transfer->transfer = transfer; + + pipe_texture_reference(&id_transfer->base.texture, &id_texture->base); assert(id_transfer->base.texture == &id_texture->base); return &id_transfer->base; error: - transfer->pipe->tex_transfer_destroy(transfer); + id_context->pipe->tex_transfer_destroy(id_context->pipe, transfer); return NULL; } void -identity_transfer_destroy(struct identity_transfer *id_transfer) +identity_transfer_destroy(struct identity_context *id_context, + struct identity_transfer *id_transfer) { pipe_texture_reference(&id_transfer->base.texture, NULL); - id_transfer->transfer->pipe->tex_transfer_destroy(id_transfer->transfer); + id_context->pipe->tex_transfer_destroy(id_context->pipe, + id_transfer->transfer); FREE(id_transfer); } diff --git a/src/gallium/drivers/identity/id_objects.h b/src/gallium/drivers/identity/id_objects.h index 3c4e6d3f8c..7333ecfb7f 100644 --- a/src/gallium/drivers/identity/id_objects.h +++ b/src/gallium/drivers/identity/id_objects.h @@ -65,6 +65,7 @@ struct identity_transfer { struct pipe_transfer base; + struct pipe_context *pipe; struct pipe_transfer *transfer; }; @@ -183,7 +184,8 @@ identity_transfer_create(struct identity_context *id_context, struct pipe_transfer *transfer); void -identity_transfer_destroy(struct identity_transfer *id_transfer); +identity_transfer_destroy(struct identity_context *id_context, + struct identity_transfer *id_transfer); struct pipe_video_surface * identity_video_surface_create(struct identity_screen *id_screen, diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index bfe53d4106..505cb21503 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -477,7 +477,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene ) pipe->transfer_unmap(pipe, scene->cbuf_transfer[i]); if (scene->cbuf_transfer[i]) - pipe->tex_transfer_destroy(scene->cbuf_transfer[i]); + pipe->tex_transfer_destroy(pipe, scene->cbuf_transfer[i]); scene->cbuf_transfer[i] = NULL; scene->cbuf_map[i] = NULL; @@ -487,7 +487,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene ) pipe->transfer_unmap(pipe, scene->zsbuf_transfer); if (scene->zsbuf_transfer) - pipe->tex_transfer_destroy(scene->zsbuf_transfer); + pipe->tex_transfer_destroy(pipe, scene->zsbuf_transfer); scene->zsbuf_transfer = NULL; scene->zsbuf_map = NULL; diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 65f7994e0e..f2c6dbd088 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -294,7 +294,8 @@ llvmpipe_get_tex_transfer(struct pipe_context *pipe, static void -llvmpipe_tex_transfer_destroy(struct pipe_transfer *transfer) +llvmpipe_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *transfer) { /* Effectively do the texture_update work here - if texture images * needed post-processing to put them into hardware layout, this is diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c index 1318c60ae4..cfc109bb74 100644 --- a/src/gallium/drivers/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nv30/nv30_transfer.c @@ -118,12 +118,13 @@ nv30_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt, } static void -nv30_transfer_del(struct pipe_transfer *ptx) +nv30_transfer_del(struct pipe_context *pcontext, + struct pipe_transfer *ptx) { struct nv30_transfer *tx = (struct nv30_transfer *)ptx; if (!tx->direct && (ptx->usage & PIPE_TRANSFER_WRITE)) { - struct pipe_screen *pscreen = ptx->texture->screen; + struct pipe_screen *pscreen = pcontext->screen; struct nv30_screen *nvscreen = nv30_screen(pscreen); struct pipe_surface *dst; diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c index 2ca9b94388..c552a68113 100644 --- a/src/gallium/drivers/nv40/nv40_transfer.c +++ b/src/gallium/drivers/nv40/nv40_transfer.c @@ -118,12 +118,12 @@ nv40_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt, } static void -nv40_transfer_del(struct pipe_transfer *ptx) +nv40_transfer_del(struct pipe_context *pcontext, struct pipe_transfer *ptx) { struct nv40_transfer *tx = (struct nv40_transfer *)ptx; if (!tx->direct && (ptx->usage & PIPE_TRANSFER_WRITE)) { - struct pipe_screen *pscreen = ptx->texture->screen; + struct pipe_screen *pscreen = pcontext->screen; struct nv40_screen *nvscreen = nv40_screen(pscreen); struct pipe_surface *dst; diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index b7f2ac1b1c..9eb223eca6 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -187,7 +187,7 @@ nv50_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt, } static void -nv50_transfer_del(struct pipe_transfer *ptx) +nv50_transfer_del(struct pipe_context *pcontext, struct pipe_transfer *ptx) { struct nv50_transfer *tx = (struct nv50_transfer *)ptx; struct nv50_miptree *mt = nv50_miptree(ptx->texture); @@ -197,7 +197,7 @@ nv50_transfer_del(struct pipe_transfer *ptx) unsigned ny = util_format_get_nblocksy(pt->format, tx->base.height); if (ptx->usage & PIPE_TRANSFER_WRITE) { - struct pipe_screen *pscreen = pt->screen; + struct pipe_screen *pscreen = pcontext->screen; nv50_transfer_rect_m2mf(pscreen, tx->bo, 0, tx->base.stride, tx->bo->tile_mode, diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 69c0ab496c..64d1909a38 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -251,8 +251,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, return retval == usage; } - - static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index 7dd707ff8e..495e3dee76 100644 --- a/src/gallium/drivers/r300/r300_transfer.c +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -205,7 +205,8 @@ r300_get_tex_transfer(struct pipe_context *ctx, return &trans->transfer; } -static void r300_tex_transfer_destroy(struct pipe_transfer *trans) +static void r300_tex_transfer_destroy(struct pipe_context *ctx, + struct pipe_transfer *trans) { struct r300_transfer *r300transfer = r300_transfer(trans); diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c index a9f5b51a41..e3a5e37ce4 100644 --- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c @@ -69,10 +69,10 @@ sp_destroy_tex_tile_cache(struct softpipe_tex_tile_cache *tc) /*assert(tc->entries[pos].x < 0);*/ } if (tc->transfer) { - tc->pipe->tex_transfer_destroy(tc->transfer); + tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer); } if (tc->tex_trans) { - tc->pipe->tex_transfer_destroy(tc->tex_trans); + tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans); } FREE( tc ); @@ -135,7 +135,7 @@ sp_tex_tile_cache_set_texture(struct softpipe_tex_tile_cache *tc, tc->tex_trans_map = NULL; } - tc->pipe->tex_transfer_destroy(tc->tex_trans); + tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans); tc->tex_trans = NULL; } @@ -230,7 +230,7 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, tc->tex_trans_map = NULL; } - tc->pipe->tex_transfer_destroy(tc->tex_trans); + tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans); tc->tex_trans = NULL; } @@ -251,7 +251,8 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, } /* get tile from the transfer (view into texture) */ - pipe_get_tile_rgba(tc->tex_trans, + pipe_get_tile_rgba(tc->pipe, + tc->tex_trans, addr.bits.x * TILE_SIZE, addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index adae48c474..da8529c154 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -277,7 +277,6 @@ softpipe_get_tex_transfer(struct pipe_context *pipe, struct pipe_transfer *pt = &spt->base; int nblocksy = util_format_get_nblocksy(texture->format, u_minify(texture->height0, level)); pipe_texture_reference(&pt->texture, texture); - pt->pipe = pipe; pt->x = x; pt->y = y; pt->width = w; @@ -311,7 +310,8 @@ softpipe_get_tex_transfer(struct pipe_context *pipe, * softpipe_get_tex_transfer(). */ static void -softpipe_tex_transfer_destroy(struct pipe_transfer *transfer) +softpipe_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *transfer) { /* Effectively do the texture_update work here - if texture images * needed post-processing to put them into hardware layout, this is diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index d779816790..1c3c2667d7 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -121,7 +121,7 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc) /*assert(tc->entries[pos].x < 0);*/ } if (tc->transfer) { - tc->pipe->tex_transfer_destroy(tc->transfer); + tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer); } FREE( tc ); @@ -146,7 +146,7 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc, tc->transfer_map = NULL; } - pipe->tex_transfer_destroy(tc->transfer); + pipe->tex_transfer_destroy(pipe, tc->transfer); tc->transfer = NULL; } @@ -291,7 +291,8 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc) union tile_address addr = tile_address(x, y); if (is_clear_flag_set(tc->clear_flags, addr)) { - pipe_put_tile_raw(pt, + pipe_put_tile_raw(tc->pipe, + pt, x, y, TILE_SIZE, TILE_SIZE, tc->tile.data.color32, 0/*STRIDE*/); @@ -325,14 +326,14 @@ sp_flush_tile_cache(struct softpipe_tile_cache *tc) struct softpipe_cached_tile *tile = tc->entries + pos; if (!tile->addr.bits.invalid) { if (tc->depth_stencil) { - pipe_put_tile_raw(pt, + pipe_put_tile_raw(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, tile->data.depth32, 0/*STRIDE*/); } else { - pipe_put_tile_rgba(pt, + pipe_put_tile_rgba(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, @@ -375,14 +376,14 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc, if (tile->addr.bits.invalid == 0) { /* put dirty tile back in framebuffer */ if (tc->depth_stencil) { - pipe_put_tile_raw(pt, + pipe_put_tile_raw(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, tile->data.depth32, 0/*STRIDE*/); } else { - pipe_put_tile_rgba(pt, + pipe_put_tile_rgba(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, @@ -405,14 +406,14 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc, else { /* get new tile data from transfer */ if (tc->depth_stencil) { - pipe_get_tile_raw(pt, + pipe_get_tile_raw(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, tile->data.depth32, 0/*STRIDE*/); } else { - pipe_get_tile_rgba(pt, + pipe_get_tile_rgba(tc->pipe, pt, tile->addr.bits.x * TILE_SIZE, tile->addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 065b8748a3..107e4a3962 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -899,10 +899,11 @@ svga_transfer_unmap(struct pipe_context *pipe, static void -svga_tex_transfer_destroy(struct pipe_transfer *transfer) +svga_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *transfer) { struct svga_texture *tex = svga_texture(transfer->texture); - struct svga_screen *ss = svga_screen(transfer->texture->screen); + struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st = svga_transfer(transfer); diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 4a0e9ac17d..b7e6bbac68 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -1336,11 +1336,12 @@ trace_context_get_tex_transfer(struct pipe_context *_context, static void -trace_context_tex_transfer_destroy(struct pipe_transfer *_transfer) +trace_context_tex_transfer_destroy(struct pipe_context *_context, + struct pipe_transfer *_transfer) { - struct trace_context *tr_ctx = trace_context(_transfer->pipe); + struct trace_context *tr_context = trace_context(_context); struct trace_transfer *tr_trans = trace_transfer(_transfer); - struct pipe_context *context = tr_ctx->pipe; + struct pipe_context *context = tr_context->pipe; struct pipe_transfer *transfer = tr_trans->transfer; trace_dump_call_begin("pipe_context", "tex_transfer_destroy"); @@ -1350,7 +1351,7 @@ trace_context_tex_transfer_destroy(struct pipe_transfer *_transfer) trace_dump_call_end(); - trace_transfer_destroy(tr_trans); + trace_transfer_destroy(tr_context, tr_trans); } diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c index b36865400d..f4f17566fd 100644 --- a/src/gallium/drivers/trace/tr_rbug.c +++ b/src/gallium/drivers/trace/tr_rbug.c @@ -257,7 +257,7 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header, NULL); context->transfer_unmap(context, t); - context->tex_transfer_destroy(t); + context->tex_transfer_destroy(context, t); pipe_mutex_unlock(tr_scr->list_mutex); diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c index b70ccb9ce8..d818e21bb8 100644 --- a/src/gallium/drivers/trace/tr_texture.c +++ b/src/gallium/drivers/trace/tr_texture.c @@ -143,10 +143,10 @@ trace_transfer_create(struct trace_context *tr_ctx, memcpy(&tr_trans->base, transfer, sizeof(struct pipe_transfer)); - tr_trans->base.pipe = &tr_ctx->base; tr_trans->base.texture = NULL; - pipe_texture_reference(&tr_trans->base.texture, &tr_tex->base); tr_trans->transfer = transfer; + + pipe_texture_reference(&tr_trans->base.texture, &tr_tex->base); assert(tr_trans->base.texture == &tr_tex->base); trace_screen_add_to_list(tr_scr, transfers, tr_trans); @@ -154,21 +154,23 @@ trace_transfer_create(struct trace_context *tr_ctx, return &tr_trans->base; error: - tr_ctx->pipe->tex_transfer_destroy(transfer); + tr_ctx->pipe->tex_transfer_destroy(tr_ctx->pipe, transfer); return NULL; } void -trace_transfer_destroy(struct trace_transfer *tr_trans) +trace_transfer_destroy(struct trace_context *tr_context, + struct trace_transfer *tr_trans) { - struct trace_screen *tr_scr = trace_screen(tr_trans->base.texture->screen); - struct pipe_context *context = tr_trans->transfer->pipe; + struct trace_screen *tr_scr = trace_screen(tr_context->base.screen); + struct pipe_context *context = tr_context->pipe; + struct pipe_transfer *transfer = tr_trans->transfer; trace_screen_remove_from_list(tr_scr, transfers, tr_trans); pipe_texture_reference(&tr_trans->base.texture, NULL); - context->tex_transfer_destroy(tr_trans->transfer); + context->tex_transfer_destroy(context, transfer); FREE(tr_trans); } diff --git a/src/gallium/drivers/trace/tr_texture.h b/src/gallium/drivers/trace/tr_texture.h index ab284eeef3..4dc95308a7 100644 --- a/src/gallium/drivers/trace/tr_texture.h +++ b/src/gallium/drivers/trace/tr_texture.h @@ -61,6 +61,7 @@ struct trace_transfer struct pipe_transfer base; struct pipe_transfer *transfer; + struct pipe_context *pipe; struct tr_list list; @@ -118,7 +119,8 @@ trace_transfer_create(struct trace_context *tr_ctx, struct pipe_transfer *transfer); void -trace_transfer_destroy(struct trace_transfer *tr_trans); +trace_transfer_destroy(struct trace_context *tr_ctx, + struct trace_transfer *tr_trans); #endif /* TR_TEXTURE_H_ */ diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 494b53e912..a7f12fb81e 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -323,7 +323,8 @@ struct pipe_context { unsigned x, unsigned y, unsigned w, unsigned h); - void (*tex_transfer_destroy)(struct pipe_transfer *); + void (*tex_transfer_destroy)(struct pipe_context *, + struct pipe_transfer *); void *(*transfer_map)( struct pipe_context *, struct pipe_transfer *transfer ); diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 2af933207d..3a97d888ce 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -304,8 +304,6 @@ struct pipe_surface */ struct pipe_transfer { - struct pipe_context *pipe; - unsigned x; /**< x offset from start of texture image */ unsigned y; /**< y offset from start of texture image */ unsigned width; /**< logical width in pixels */ diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c index 6e79dd370f..18e2cc1f25 100644 --- a/src/gallium/state_trackers/vega/api_filters.c +++ b/src/gallium/state_trackers/vega/api_filters.c @@ -85,7 +85,7 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx, void *map = pipe->transfer_map(pipe, transfer); memcpy(map, color_data, sizeof(VGint)*color_data_len); pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } return tex; diff --git a/src/gallium/state_trackers/vega/api_images.c b/src/gallium/state_trackers/vega/api_images.c index 432ba68139..fec473d9d2 100644 --- a/src/gallium/state_trackers/vega/api_images.c +++ b/src/gallium/state_trackers/vega/api_images.c @@ -450,14 +450,14 @@ void vgReadPixels(void * data, VGint dataStride, #if 0 debug_printf("%d-%d == %d\n", sy, height, y); #endif - pipe_get_tile_rgba(transfer, sx, y, width, 1, df); + pipe_get_tile_rgba(pipe, transfer, sx, y, width, 1, df); y += yStep; _vega_pack_rgba_span_float(ctx, width, temp, dataFormat, dst + yoffset + xoffset); dst += dataStride; } - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } } diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index 604a86aeb8..a71579cd26 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -418,11 +418,11 @@ void image_sub_data(struct vg_image *image, src += (dataStride * yoffset); for (i = 0; i < height; i++) { _vega_unpack_float_span_rgba(ctx, width, xoffset, src, dataFormat, temp); - pipe_put_tile_rgba(transfer, x+image->x, y+image->y, width, 1, df); + pipe_put_tile_rgba(pipe, transfer, x+image->x, y+image->y, width, 1, df); y += yStep; src += dataStride; } - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } } @@ -454,13 +454,13 @@ void image_get_sub_data(struct vg_image * image, #if 0 debug_printf("%d-%d == %d\n", sy, height, y); #endif - pipe_get_tile_rgba(transfer, sx+image->x, y, width, 1, df); + pipe_get_tile_rgba(pipe, transfer, sx+image->x, y, width, 1, df); y += yStep; _vega_pack_rgba_span_float(ctx, width, temp, dataFormat, dst); dst += dataStride; } - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } } diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index 47a7710d3e..dc56b8c5f3 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -167,7 +167,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p) void *map = pipe->transfer_map(pipe, transfer); memcpy(map, p->gradient.color_data, sizeof(VGint)*1024); pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } return tex; diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index b066f5c94b..b446b2079c 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -172,7 +172,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) } pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); } diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 69a96e5d10..01aba3e3dd 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -144,7 +144,7 @@ accum_accum(struct st_context *st, GLfloat value, buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); + pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf); switch (acc_strb->format) { case PIPE_FORMAT_R16G16B16A16_SNORM: @@ -165,7 +165,7 @@ accum_accum(struct st_context *st, GLfloat value, } free(buf); - pipe->tex_transfer_destroy(color_trans); + pipe->tex_transfer_destroy(pipe, color_trans); } @@ -192,7 +192,7 @@ accum_load(struct st_context *st, GLfloat value, buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); + pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf); switch (acc_strb->format) { case PIPE_FORMAT_R16G16B16A16_SNORM: @@ -213,7 +213,7 @@ accum_load(struct st_context *st, GLfloat value, } free(buf); - pipe->tex_transfer_destroy(color_trans); + pipe->tex_transfer_destroy(pipe, color_trans); } @@ -248,7 +248,7 @@ accum_return(GLcontext *ctx, GLfloat value, width, height); if (usage & PIPE_TRANSFER_READ) - pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); + pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf); switch (acc_strb->format) { case PIPE_FORMAT_R16G16B16A16_SNORM: @@ -277,10 +277,10 @@ accum_return(GLcontext *ctx, GLfloat value, _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()"); } - pipe_put_tile_rgba(color_trans, 0, 0, width, height, buf); + pipe_put_tile_rgba(pipe, color_trans, 0, 0, width, height, buf); free(buf); - pipe->tex_transfer_destroy(color_trans); + pipe->tex_transfer_destroy(pipe, color_trans); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 723c5f180b..dfd8925edf 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -295,7 +295,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height, /* Release transfer */ pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); return pt; } @@ -530,7 +530,7 @@ reset_cache(struct st_context *st) cache->ymax = -1000000; if (cache->trans) { - pipe->tex_transfer_destroy(cache->trans); + pipe->tex_transfer_destroy(pipe, cache->trans); cache->trans = NULL; } @@ -616,7 +616,7 @@ st_flush_bitmap_cache(struct st_context *st) pipe->transfer_unmap(pipe, cache->trans); cache->buffer = NULL; - pipe->tex_transfer_destroy(cache->trans); + pipe->tex_transfer_destroy(pipe, cache->trans); cache->trans = NULL; } @@ -836,7 +836,7 @@ st_destroy_bitmap(struct st_context *st) if (cache) { if (cache->trans) { pipe->transfer_unmap(pipe, cache->trans); - pipe->tex_transfer_destroy(cache->trans); + pipe->tex_transfer_destroy(pipe, cache->trans); } pipe_texture_reference(&st->bitmap.cache->texture, NULL); free(st->bitmap.cache); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 3fa6d12f1c..c44d0fc3e8 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -411,7 +411,7 @@ make_texture(struct st_context *st, /* unmap */ pipe->transfer_unmap(pipe, transfer); - pipe->tex_transfer_destroy(transfer); + pipe->tex_transfer_destroy(pipe, transfer); assert(success); @@ -791,7 +791,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, /* unmap the stencil buffer */ pipe->transfer_unmap(pipe, pt); - pipe->tex_transfer_destroy(pt); + pipe->tex_transfer_destroy(pipe, pt); } @@ -944,7 +944,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* unmap the stencil buffer */ pipe->transfer_unmap(pipe, ptDraw); - pipe->tex_transfer_destroy(ptDraw); + pipe->tex_transfer_destroy(pipe, ptDraw); } @@ -1113,21 +1113,21 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* alternate path using get/put_tile() */ GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf); - pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf); + pipe_get_tile_rgba(pipe, ptRead, 0, 0, width, height, buf); + pipe_put_tile_rgba(pipe, ptTex, 0, 0, width, height, buf); free(buf); } else { /* GL_DEPTH */ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); - pipe_get_tile_z(ptRead, 0, 0, width, height, buf); - pipe_put_tile_z(ptTex, 0, 0, width, height, buf); + pipe_get_tile_z(pipe, ptRead, 0, 0, width, height, buf); + pipe_put_tile_z(pipe, ptTex, 0, 0, width, height, buf); free(buf); } - pipe->tex_transfer_destroy(ptRead); - pipe->tex_transfer_destroy(ptTex); + pipe->tex_transfer_destroy(pipe, ptRead); + pipe->tex_transfer_destroy(pipe, ptTex); } /* draw textured quad */ diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 98ccda821c..080a5f9bfb 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -162,7 +162,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, /* unmap the stencil buffer */ pipe->transfer_unmap(pipe, pt); - pipe->tex_transfer_destroy(pt); + pipe->tex_transfer_destroy(pipe, pt); } @@ -254,7 +254,7 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb, map = pipe->transfer_map(pipe, trans); if (!map) { - pipe->tex_transfer_destroy(trans); + pipe->tex_transfer_destroy(pipe, trans); return GL_FALSE; } @@ -317,7 +317,7 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb, } pipe->transfer_unmap(pipe, trans); - pipe->tex_transfer_destroy(trans); + pipe->tex_transfer_destroy(pipe, trans); } return GL_TRUE; @@ -441,7 +441,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / ((1 << 24) - 1); - pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0); y += yStep; for (j = 0; j < width; j++) { zfloat[j] = (float) (scale * (ztemp[j] & 0xffffff)); @@ -456,7 +456,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, assert(format == GL_DEPTH_STENCIL_EXT); for (i = 0; i < height; i++) { GLuint *zshort = (GLuint *)dst; - pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0); y += yStep; /* Reverse into 24/8 */ for (j = 0; j < width; j++) { @@ -473,7 +473,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / ((1 << 24) - 1); - pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0); y += yStep; for (j = 0; j < width; j++) { zfloat[j] = (float) (scale * ((ztemp[j] >> 8) & 0xffffff)); @@ -487,7 +487,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, /* XXX: unreachable code -- should be before st_read_stencil_pixels */ assert(format == GL_DEPTH_STENCIL_EXT); for (i = 0; i < height; i++) { - pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0); y += yStep; dst += dstStride; } @@ -498,7 +498,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLushort ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / 0xffff; - pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0); y += yStep; for (j = 0; j < width; j++) { zfloat[j] = (float) (scale * ztemp[j]); @@ -513,7 +513,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / 0xffffffff; - pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0); + pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0); y += yStep; for (j = 0; j < width; j++) { zfloat[j] = (float) (scale * ztemp[j]); @@ -527,7 +527,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, /* RGBA format */ /* Do a row at a time to flip image data vertically */ for (i = 0; i < height; i++) { - pipe_get_tile_rgba(trans, 0, y, width, 1, df); + pipe_get_tile_rgba(pipe, trans, 0, y, width, 1, df); y += yStep; df += dfStride; if (!dfStride) { @@ -539,7 +539,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } - pipe->tex_transfer_destroy(trans); + pipe->tex_transfer_destroy(pipe, trans); _mesa_unmap_pbo_dest(ctx, &clippedPacking); } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 1b20b615d0..626e6ad660 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -435,7 +435,7 @@ compress_with_blit(GLcontext * ctx, unpack); /* source data packing */ pipe->transfer_unmap(pipe, tex_xfer); - pipe->tex_transfer_destroy(tex_xfer); + pipe->tex_transfer_destroy(pipe, tex_xfer); /* copy / compress image */ util_blit_pixels_tex(ctx->st->blit, @@ -873,7 +873,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, debug_printf("%s: fallback format translation\n", __FUNCTION__); /* get float[4] rgba row from surface */ - pipe_get_tile_rgba(tex_xfer, 0, row, width, 1, rgba); + pipe_get_tile_rgba(pipe, tex_xfer, 0, row, width, 1, rgba); _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format, type, dest, &ctx->Pack, transferOps); @@ -1310,11 +1310,11 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, /* To avoid a large temp memory allocation, do copy row by row */ for (row = 0; row < height; row++, srcY += yStep) { uint data[MAX_WIDTH]; - pipe_get_tile_z(src_trans, 0, srcY, width, 1, data); + pipe_get_tile_z(pipe, src_trans, 0, srcY, width, 1, data); if (scaleOrBias) { _mesa_scale_and_bias_depth_uint(ctx, width, data); } - pipe_put_tile_z(stImage->transfer, 0, row, width, 1, data); + pipe_put_tile_z(pipe, stImage->transfer, 0, row, width, 1, data); } } else { @@ -1336,7 +1336,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, /* XXX this usually involves a lot of int/float conversion. * try to avoid that someday. */ - pipe_get_tile_rgba(src_trans, 0, 0, width, height, tempSrc); + pipe_get_tile_rgba(pipe, src_trans, 0, 0, width, height, tempSrc); /* Store into texture memory. * Note that this does some special things such as pixel transfer @@ -1364,7 +1364,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, } st_texture_image_unmap(ctx->st, stImage); - pipe->tex_transfer_destroy(src_trans); + pipe->tex_transfer_destroy(pipe, src_trans); } diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index a73b8ed8fe..b2521433c8 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -163,8 +163,8 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, pipe->transfer_unmap(pipe, srcTrans); pipe->transfer_unmap(pipe, dstTrans); - pipe->tex_transfer_destroy(srcTrans); - pipe->tex_transfer_destroy(dstTrans); + pipe->tex_transfer_destroy(pipe, srcTrans); + pipe->tex_transfer_destroy(pipe, dstTrans); } } diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index f1eef768eb..10a38befb4 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -217,7 +217,7 @@ st_texture_image_unmap(struct st_context *st, pipe->transfer_unmap(pipe, stImage->transfer); - pipe->tex_transfer_destroy(stImage->transfer); + pipe->tex_transfer_destroy(pipe, stImage->transfer); } @@ -284,7 +284,7 @@ st_texture_image_data(struct st_context *st, u_minify(dst->width0, level), u_minify(dst->height0, level)); /* width, height */ - pipe->tex_transfer_destroy(dst_transfer); + pipe->tex_transfer_destroy(pipe, dst_transfer); srcUB += src_image_stride; } -- cgit v1.2.3 From e42b2f768509b6984c7186805c6a8afdaebf3a06 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 12 Mar 2010 02:47:44 -0800 Subject: r300g: Properly clamp index limits. Make the kernel even less likely to barf on us. --- src/gallium/drivers/r300/r300_render.c | 2 +- src/gallium/drivers/r300/r300_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/r300') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 9c001ae186..ef1b7510e1 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -280,7 +280,7 @@ static void r300_emit_draw_elements(struct r300_context *r300, DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n", count, minIndex, maxIndex); - maxIndex = MIN2(maxIndex, r300->vertex_buffer_max_index); + maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, (1 << 24) - 1); if (alt_num_verts) { BEGIN_CS(15); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index bd4c2766cb..ced6c810ec 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1031,7 +1031,7 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); - unsigned i, max_index = ~0; + unsigned i, max_index = (1 << 24) - 1; memcpy(r300->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); -- cgit v1.2.3 From fab1f07d6ad01463897ae792f4b33738afb07369 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Fri, 13 Jun 2008 09:50:43 -0500 Subject: Grammar and spelling fixes Signed-off-by: Jeff Smith Signed-off-by: Brian Paul --- docs/README.3DFX | 2 +- docs/egl.html | 2 +- progs/objviewer/glm.c | 2 +- progs/objviewer/glm.h | 2 +- progs/tests/vao-01.c | 2 +- progs/tests/vao-02.c | 2 +- src/gallium/auxiliary/os/os_time.h | 2 +- src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 2 +- src/gallium/drivers/cell/ppu/cell_spu.c | 2 +- src/gallium/drivers/nv40/nv40_vertprog.c | 2 +- src/gallium/drivers/r300/r300_reg.h | 4 ++-- src/gallium/state_trackers/wgl/stw_framebuffer.h | 2 +- src/glu/sgi/libnurbs/nurbtess/partitionY.h | 2 +- src/glu/sgi/libtess/normal.c | 2 +- src/mesa/drivers/dri/common/dri_util.c | 2 +- src/mesa/drivers/dri/r128/r128_tex.c | 2 +- src/mesa/drivers/dri/r200/r200_reg.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 4 ++-- src/mesa/drivers/dri/radeon/radeon_state.c | 2 +- src/mesa/drivers/x11/xmesa.h | 2 +- src/mesa/drivers/x11/xmesaP.h | 2 +- src/mesa/main/dd.h | 2 +- src/mesa/main/texcompress_fxt1.c | 2 +- src/mesa/math/m_debug_util.h | 2 +- src/mesa/math/m_matrix.c | 2 +- src/mesa/shader/prog_instruction.h | 4 ++-- src/mesa/shader/program_parser.h | 2 +- src/mesa/shader/slang/library/slang_common_builtin.gc | 2 +- src/mesa/swrast/s_depth.c | 2 +- src/mesa/vbo/vbo_save_loopback.c | 2 +- 30 files changed, 33 insertions(+), 33 deletions(-) (limited to 'src/gallium/drivers/r300') diff --git a/docs/README.3DFX b/docs/README.3DFX index 037e8fa7cc..7feda6f33f 100644 --- a/docs/README.3DFX +++ b/docs/README.3DFX @@ -644,7 +644,7 @@ Hints and Special Features: - The Voodoo driver supports the GL_EXT_paletted_texture. it works only with GL_COLOR_INDEX8_EXT, GL_RGBA palettes and the alpha value - is ignored because this is a limitation of the the current Glide + is ignored because this is a limitation of the current Glide version and of the Voodoo hardware. See Mesa-3.1/3Dfx/demos/paltex.c for a demo of this extension. diff --git a/docs/egl.html b/docs/egl.html index 82cc06600b..55907f6cfa 100644 --- a/docs/egl.html +++ b/docs/egl.html @@ -28,7 +28,7 @@ cards.

  1. -

    Run configure with the desired state trackers and and enable +

    Run configure with the desired state trackers and enable the Gallium driver for your hardware. For example

    diff --git a/progs/objviewer/glm.c b/progs/objviewer/glm.c
    index 7c964e489d..77e62bfab1 100644
    --- a/progs/objviewer/glm.c
    +++ b/progs/objviewer/glm.c
    @@ -1041,7 +1041,7 @@ glmFacetNormals(GLMmodel* model)
     
     /* glmVertexNormals: Generates smooth vertex normals for a model.
      * First builds a list of all the triangles each vertex is in.  Then
    - * loops through each vertex in the the list averaging all the facet
    + * loops through each vertex in the list averaging all the facet
      * normals of the triangles each vertex is in.  Finally, sets the
      * normal index in the triangle for the vertex to the generated smooth
      * normal.  If the dot product of a facet normal and the facet normal
    diff --git a/progs/objviewer/glm.h b/progs/objviewer/glm.h
    index 8740b3684d..1a5646fa4c 100644
    --- a/progs/objviewer/glm.h
    +++ b/progs/objviewer/glm.h
    @@ -153,7 +153,7 @@ glmFacetNormals(GLMmodel* model);
     
     /* glmVertexNormals: Generates smooth vertex normals for a model.
      * First builds a list of all the triangles each vertex is in.  Then
    - * loops through each vertex in the the list averaging all the facet
    + * loops through each vertex in the list averaging all the facet
      * normals of the triangles each vertex is in.  Finally, sets the
      * normal index in the triangle for the vertex to the generated smooth
      * normal.  If the dot product of a facet normal and the facet normal
    diff --git a/progs/tests/vao-01.c b/progs/tests/vao-01.c
    index e4a89cb19d..ee528d2243 100644
    --- a/progs/tests/vao-01.c
    +++ b/progs/tests/vao-01.c
    @@ -30,7 +30,7 @@
      * it (via \c glPopClientAttrib).  After popping, the state of the VAO is
      * examined.
      * 
    - * According the the APPLE_vertex_array_object spec, the contents of the VAO
    + * According to the APPLE_vertex_array_object spec, the contents of the VAO
      * should be restored to the values that they had when pushed.
      * 
      * \author Ian Romanick 
    diff --git a/progs/tests/vao-02.c b/progs/tests/vao-02.c
    index 9f7f5c2779..c23b4ab05a 100644
    --- a/progs/tests/vao-02.c
    +++ b/progs/tests/vao-02.c
    @@ -30,7 +30,7 @@
      * it (via \c glPopClientAttrib).  After popping, the state of the VAO is
      * examined.
      * 
    - * According the the APPLE_vertex_array_object spec, the contents of the VAO
    + * According to the APPLE_vertex_array_object spec, the contents of the VAO
      * should be restored to the values that they had when pushed.
      * 
      * \author Ian Romanick 
    diff --git a/src/gallium/auxiliary/os/os_time.h b/src/gallium/auxiliary/os/os_time.h
    index 5b55c1b374..7e0f67a76b 100644
    --- a/src/gallium/auxiliary/os/os_time.h
    +++ b/src/gallium/auxiliary/os/os_time.h
    @@ -71,7 +71,7 @@ os_time_sleep(int64_t usecs);
     /*
      * Helper function for detecting time outs, taking in account overflow.
      *
    - * Returns true the the current time has elapsed beyond the specified interval.
    + * Returns true if the current time has elapsed beyond the specified interval.
      */
     static INLINE boolean
     os_time_timeout(int64_t start,
    diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
    index 576d514741..c54576b3c3 100644
    --- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
    +++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
    @@ -1352,7 +1352,7 @@ gen_stencil_values(struct spe_function *f,
         */
        ASSERT(fbS_reg != newS_reg);
     
    -   /* The code also assumes the the stencil_max_value is of the form 
    +   /* The code also assumes that the stencil_max_value is of the form
         * 2^n-1 and can therefore be used as a mask for the valid bits in 
         * addition to a maximum.  Make sure this is the case as well.
         * The clever math below exploits the fact that incrementing a 
    diff --git a/src/gallium/drivers/cell/ppu/cell_spu.c b/src/gallium/drivers/cell/ppu/cell_spu.c
    index 28e5e6d706..39284f3a5d 100644
    --- a/src/gallium/drivers/cell/ppu/cell_spu.c
    +++ b/src/gallium/drivers/cell/ppu/cell_spu.c
    @@ -135,7 +135,7 @@ cell_thread_function(void *arg)
     
     /**
      * Create the SPU threads.  This is done once during driver initialization.
    - * This involves setting the the "init" message which is sent to each SPU.
    + * This involves setting the "init" message which is sent to each SPU.
      * The init message specifies an SPU id, total number of SPUs, location
      * and number of batch buffers, etc.
      */
    diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c
    index b289eef0fc..c93c5d127c 100644
    --- a/src/gallium/drivers/nv40/nv40_vertprog.c
    +++ b/src/gallium/drivers/nv40/nv40_vertprog.c
    @@ -742,7 +742,7 @@ nv40_vertprog_translate(struct nv40_context *nv40,
     	}
     
     	/* Redirect post-transform vertex position to a temp if user clip
    -	 * planes are enabled.  We need to append code the the vtxprog
    +	 * planes are enabled.  We need to append code to the vtxprog
     	 * to handle clip planes later.
     	 */
     	if (vp->ucp.nr)  {
    diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
    index a249e8b36b..c67cc86871 100644
    --- a/src/gallium/drivers/r300/r300_reg.h
    +++ b/src/gallium/drivers/r300/r300_reg.h
    @@ -540,7 +540,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
     #       define R300_PVS_FIRST_INST(x)            ((x) << 0)
     #       define R300_PVS_XYZW_VALID_INST(x)       ((x) << 10)
     #       define R300_PVS_LAST_INST(x)             ((x) << 20)
    -/* Addresses are relative the the vertex program parameters area. */
    +/* Addresses are relative to the vertex program parameters area. */
     #define R300_VAP_PVS_CONST_CNTL             0x22D4
     #       define R300_PVS_CONST_BASE_OFFSET_SHIFT  0
     #       define R300_PVS_MAX_CONST_ADDR_SHIFT     16
    @@ -1857,7 +1857,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
      * The destination register index is in FPI1 (color) and FPI3 (alpha)
      * together with enable bits.
      * There are separate enable bits for writing into temporary registers
    - * (DSTC_REG_* /DSTA_REG) and and program output registers (DSTC_OUTPUT_*
    + * (DSTC_REG_* /DSTA_REG) and program output registers (DSTC_OUTPUT_*
      * /DSTA_OUTPUT). You can write to both at once, or not write at all (the
      * same index must be used for both).
      *
    diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.h b/src/gallium/state_trackers/wgl/stw_framebuffer.h
    index 08cc4973bc..e61e9bf9c2 100644
    --- a/src/gallium/state_trackers/wgl/stw_framebuffer.h
    +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.h
    @@ -45,7 +45,7 @@ struct stw_framebuffer
        /**
         * This mutex has two purposes:
         * - protect the access to the mutable data members below
    -    * - prevent the the framebuffer from being deleted while being accessed.
    +    * - prevent the framebuffer from being deleted while being accessed.
         * 
         * It is OK to lock this mutex while holding the stw_device::fb_mutex lock, 
         * but the opposite must never happen.
    diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.h b/src/glu/sgi/libnurbs/nurbtess/partitionY.h
    index 8dda409de1..5570c183d7 100644
    --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.h
    +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.h
    @@ -39,7 +39,7 @@
      *or both at or below v. In addition, at least one of the ajacent verteces is
      *strictly below or above v. 
      * A vertex is a relex vertex if the internals angle is strictly greater than 
    - *180. In other words, if the the signed area is negative:
    + *180. In other words, if the signed area is negative:
      *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the 
      *order is such that left hand side is inside the polygon. Then (x2,y2) is
      *reflex if: 
    diff --git a/src/glu/sgi/libtess/normal.c b/src/glu/sgi/libtess/normal.c
    index 0a2494be34..7ab83167bb 100644
    --- a/src/glu/sgi/libtess/normal.c
    +++ b/src/glu/sgi/libtess/normal.c
    @@ -142,7 +142,7 @@ static void CheckOrientation( GLUtesselator *tess )
       GLUhalfEdge *e;
     
       /* When we compute the normal automatically, we choose the orientation
    -   * so that the the sum of the signed areas of all contours is non-negative.
    +   * so that the sum of the signed areas of all contours is non-negative.
        */
       area = 0;
       for( f = fHead->next; f != fHead; f = f->next ) {
    diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
    index 890ae51339..75c98825b7 100644
    --- a/src/mesa/drivers/dri/common/dri_util.c
    +++ b/src/mesa/drivers/dri/common/dri_util.c
    @@ -698,7 +698,7 @@ setupLoaderExtensions(__DRIscreen *psp,
      * \param drm_version Version of the kernel DRM.
      * \param frame_buffer Data describing the location and layout of the
      *                     framebuffer.
    - * \param pSAREA       Pointer the the SAREA.
    + * \param pSAREA       Pointer to the SAREA.
      * \param fd           Device handle for the DRM.
      * \param extensions   ??
      * \param driver_modes  Returns modes suppoted by the driver
    diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c
    index 24fbf8f519..4ec4be9a47 100644
    --- a/src/mesa/drivers/dri/r128/r128_tex.c
    +++ b/src/mesa/drivers/dri/r128/r128_tex.c
    @@ -468,7 +468,7 @@ static void r128TexEnv( GLcontext *ctx, GLenum target,
     	  * certain point.  It is better than completely ignoring the LOD
     	  * bias.  Unfortunately there isn't much range in the bias, the
     	  * spec mentions strides that vary between 0.5 and 2.0 but these
    -	  * numbers don't seem to relate the the GL LOD bias value at all.
    +	  * numbers don't seem to relate to the GL LOD bias value at all.
     	  */
     	 if ( param[0] >= 1.0 ) {
     	    bias = -128;
    diff --git a/src/mesa/drivers/dri/r200/r200_reg.h b/src/mesa/drivers/dri/r200/r200_reg.h
    index 59115212ce..b3a4940a7a 100644
    --- a/src/mesa/drivers/dri/r200/r200_reg.h
    +++ b/src/mesa/drivers/dri/r200/r200_reg.h
    @@ -690,7 +690,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     #       define R200_PVS_CNTL_1_PROGRAM_START_SHIFT   0
     #       define R200_PVS_CNTL_1_POS_END_SHIFT         10
     #       define R200_PVS_CNTL_1_PROGRAM_END_SHIFT     20
    -/* Addresses are relative the the vertex program parameters area. */
    +/* Addresses are relative to the vertex program parameters area. */
     #define R200_VAP_PVS_CNTL_2                 0x22d4
     #       define R200_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0
     #       define R200_PVS_CNTL_2_PARAM_COUNT_SHIFT  16
    diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
    index d18ebab8ff..ac93563ed9 100644
    --- a/src/mesa/drivers/dri/r300/r300_reg.h
    +++ b/src/mesa/drivers/dri/r300/r300_reg.h
    @@ -482,7 +482,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
     #       define R300_PVS_FIRST_INST_SHIFT         0
     #       define R300_PVS_XYZW_VALID_INST_SHIFT    10
     #       define R300_PVS_LAST_INST_SHIFT          20
    -/* Addresses are relative the the vertex program parameters area. */
    +/* Addresses are relative to the vertex program parameters area. */
     #define R300_VAP_PVS_CONST_CNTL             0x22D4
     #       define R300_PVS_CONST_BASE_OFFSET_SHIFT  0
     #       define R300_PVS_MAX_CONST_ADDR_SHIFT     16
    @@ -1760,7 +1760,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
      * The destination register index is in FPI1 (color) and FPI3 (alpha)
      * together with enable bits.
      * There are separate enable bits for writing into temporary registers
    - * (DSTC_REG_* /DSTA_REG) and and program output registers (DSTC_OUTPUT_*
    + * (DSTC_REG_* /DSTA_REG) and program output registers (DSTC_OUTPUT_*
      * /DSTA_OUTPUT). You can write to both at once, or not write at all (the
      * same index must be used for both).
      *
    diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
    index 0ce97e8697..583751d64d 100644
    --- a/src/mesa/drivers/dri/radeon/radeon_state.c
    +++ b/src/mesa/drivers/dri/radeon/radeon_state.c
    @@ -1900,7 +1900,7 @@ void radeonUploadTexMatrix( r100ContextPtr rmesa,
        So: if we need the q coord in the end (solely determined by the texture
        target, i.e. 2d / 1d / texrect targets) we swap the third and 4th row.
        Additionally, if we don't have texgen but 4 tex coords submitted, we swap
    -   column 3 and 4 (for the 2d / 1d / texrect targets) since the the q coord
    +   column 3 and 4 (for the 2d / 1d / texrect targets) since the q coord
        will get submitted in the "wrong", i.e. 3rd, slot.
        If an app submits 3 coords for 2d targets, we assume it is saving on vertex
        size and using the texture matrix to swap the r and q coords around (ut2k3
    diff --git a/src/mesa/drivers/x11/xmesa.h b/src/mesa/drivers/x11/xmesa.h
    index 98139af833..f63626a970 100644
    --- a/src/mesa/drivers/x11/xmesa.h
    +++ b/src/mesa/drivers/x11/xmesa.h
    @@ -287,7 +287,7 @@ extern void XMesaCopySubBuffer( XMesaBuffer b,
     
     
     /*
    - * Return a pointer to the the Pixmap or XImage being used as the back
    + * Return a pointer to the Pixmap or XImage being used as the back
      * color buffer of an XMesaBuffer.  This function is a way to get "under
      * the hood" of X/Mesa so one can manipulate the back buffer directly.
      * Input:  b - the XMesaBuffer
    diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
    index 3ffd7661e3..e0a6908228 100644
    --- a/src/mesa/drivers/x11/xmesaP.h
    +++ b/src/mesa/drivers/x11/xmesaP.h
    @@ -431,7 +431,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX];
      * If pixelformat==PF_HPCR:
      *
      *      HP Color Recovery dithering               (ad@lms.be 30/08/95)
    - *      HP has on it's 8-bit 700-series computers, a feature called
    + *      HP has on its 8-bit 700-series computers, a feature called
      *      'Color Recovery'.  This allows near 24-bit output (so they say).
      *      It is enabled by selecting the 8-bit  TrueColor  visual AND
      *      corresponding  colormap (see tkInitWindow) AND doing some special
    diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
    index 197de09b22..7c02faaa53 100644
    --- a/src/mesa/main/dd.h
    +++ b/src/mesa/main/dd.h
    @@ -1072,7 +1072,7 @@ struct dd_function_table {
      * These are the initial values to be installed into dispatch by
      * mesa.  If the T&L driver wants to modify the dispatch table
      * while installed, it must do so itself.  It would be possible for
    - * the vertexformat to install it's own initial values for these
    + * the vertexformat to install its own initial values for these
      * functions, but this way there is an obvious list of what is
      * expected of the driver.
      *
    diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
    index 149853f7ac..04acf05e52 100644
    --- a/src/mesa/main/texcompress_fxt1.c
    +++ b/src/mesa/main/texcompress_fxt1.c
    @@ -476,7 +476,7 @@ fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv,
         *     for each sample color
         *         sort to nearest vector.
         *
    -    *     replace each vector with the centroid of it's matching colors.
    +    *     replace each vector with the centroid of its matching colors.
         *
         *     repeat until RMS doesn't improve.
         *
    diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h
    index 2e67db8e55..ed11c849ec 100644
    --- a/src/mesa/math/m_debug_util.h
    +++ b/src/mesa/math/m_debug_util.h
    @@ -61,7 +61,7 @@ extern long counter_overhead;
      */
     extern char *mesa_profile;
     
    -/* Modify the the number of tests if you like.
    +/* Modify the number of tests if you like.
      * We take the minimum of all results, because every error should be
      * positive (time used by other processes, task switches etc).
      * It is assumed that all calculations are done in the cache.
    diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
    index ef8a40fbec..4b33d0bbb3 100644
    --- a/src/mesa/math/m_matrix.c
    +++ b/src/mesa/math/m_matrix.c
    @@ -889,7 +889,7 @@ _math_matrix_rotate( GLmatrix *mat,
            *  Y-axis to bring the axis vector parallel with the X-axis.  The
            *  rotation about the X-axis is then performed.  Ry and Rz are
            *  simply the respective inverse transforms to bring the arbitrary
    -       *  axis back to it's original orientation.  The first transforms
    +       *  axis back to its original orientation.  The first transforms
            *  Rz' and Ry' are considered inverses, since the data from the
            *  arbitrary axis gives you info on how to get to it, not how
            *  to get away from it, and an inverse must be applied.
    diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h
    index 224350caac..28c797a4ba 100644
    --- a/src/mesa/shader/prog_instruction.h
    +++ b/src/mesa/shader/prog_instruction.h
    @@ -97,8 +97,8 @@
     #define COND_EQ  2  /**< equal to zero */
     #define COND_LT  3  /**< less than zero */
     #define COND_UN  4  /**< unordered (NaN) */
    -#define COND_GE  5  /**< greater then or equal to zero */
    -#define COND_LE  6  /**< less then or equal to zero */
    +#define COND_GE  5  /**< greater than or equal to zero */
    +#define COND_LE  6  /**< less than or equal to zero */
     #define COND_NE  7  /**< not equal to zero */
     #define COND_TR  8  /**< always true */
     #define COND_FL  9  /**< always false */
    diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h
    index 730466c30f..be952d4b9c 100644
    --- a/src/mesa/shader/program_parser.h
    +++ b/src/mesa/shader/program_parser.h
    @@ -62,7 +62,7 @@ struct asm_symbol {
         */
        unsigned param_binding_swizzle;
     
    -   /* This is how many entries in the the program_parameter_list we take up
    +   /* This is how many entries in the program_parameter_list we take up
         * with our state tokens or constants. Note that this is _not_ the same as
         * the number of param registers we eventually use.
         */
    diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
    index 8b7771c284..a25ca55bc4 100644
    --- a/src/mesa/shader/slang/library/slang_common_builtin.gc
    +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
    @@ -695,7 +695,7 @@ vec3 normalize(const vec3 v)
     {
     //   const float s = inversesqrt(dot(v, v));
     //   __retVal = v * s;
    -// XXX note, we _could_ use __retVal.w instead of tmp and and save a
    +// XXX note, we _could_ use __retVal.w instead of tmp and save a
     // register, but that's actually a compilation error because v is a vec3
     // and the .w suffix is illegal.  Oh well.
        float tmp;
    diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
    index 3e36cf9a7e..ed637cac12 100644
    --- a/src/mesa/swrast/s_depth.c
    +++ b/src/mesa/swrast/s_depth.c
    @@ -526,7 +526,7 @@ _swrast_depth_clamp_span( GLcontext *ctx, SWspan *span )
     
        /* Convert floating point values in [0,1] to device Z coordinates in
         * [0, DepthMax].
    -    * ex: If the the Z buffer has 24 bits, DepthMax = 0xffffff.
    +    * ex: If the Z buffer has 24 bits, DepthMax = 0xffffff.
         * 
         * XXX this all falls apart if we have 31 or more bits of Z because
         * the triangle rasterization code produces unsigned Z values.  Negative
    diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c
    index f253c854d2..3f581ea02d 100644
    --- a/src/mesa/vbo/vbo_save_loopback.c
    +++ b/src/mesa/vbo/vbo_save_loopback.c
    @@ -78,7 +78,7 @@ struct loopback_attr {
     };
     
     /* Don't emit ends and begins on wrapped primitives.  Don't replay
    - * wrapped vertices.  If we get here, it's probably because the the
    + * wrapped vertices.  If we get here, it's probably because the
      * precalculated wrapping is wrong.
      */
     static void loopback_prim( GLcontext *ctx,
    -- 
    cgit v1.2.3
    
    
    From 2764a5191ffcaf93a77beff464ac8eca15163fcc Mon Sep 17 00:00:00 2001
    From: Corbin Simpson 
    Date: Fri, 12 Mar 2010 18:13:18 -0800
    Subject: r300g: Forcibly sanitize max index.
    
    Not perfect, but the kernel should shut up now.
    ---
     src/gallium/drivers/r300/r300_render.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    (limited to 'src/gallium/drivers/r300')
    
    diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
    index ef1b7510e1..ccf39876a5 100644
    --- a/src/gallium/drivers/r300/r300_render.c
    +++ b/src/gallium/drivers/r300/r300_render.c
    @@ -274,14 +274,14 @@ static void r300_emit_draw_elements(struct r300_context *r300,
     #endif
         CS_LOCALS(r300);
     
    -    assert((start * indexSize)  % 4 == 0);
    +    assert((start * indexSize) % 4 == 0);
         assert(count < (1 << 24));
     
    +    maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, count - minIndex);
    +
         DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n",
             count, minIndex, maxIndex);
     
    -    maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, (1 << 24) - 1);
    -
         if (alt_num_verts) {
             BEGIN_CS(15);
             OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count);
    -- 
    cgit v1.2.3