summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-25 19:27:29 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-25 20:35:23 -0600
commitf684120417c6b3ca9e7486ffeb24fe88e428834d (patch)
treec4e9a773294e968866e601a45032f6312dab7b79 /src/mesa/pipe/i915simple
parent616112ea2e0eefea356be228bff8754ee955d8b3 (diff)
Move region_alloc() and region_release() to pipe_winsys.
This allows regions to be allocated w/out a rendering context.
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r--src/mesa/pipe/i915simple/i915_regions.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/mesa/pipe/i915simple/i915_regions.c b/src/mesa/pipe/i915simple/i915_regions.c
index 577a6adfd8..0410446326 100644
--- a/src/mesa/pipe/i915simple/i915_regions.c
+++ b/src/mesa/pipe/i915simple/i915_regions.c
@@ -69,65 +69,6 @@ i915_region_unmap(struct pipe_context *pipe, struct pipe_region *region)
}
}
-static struct pipe_region *
-i915_region_alloc(struct pipe_context *pipe,
- unsigned cpp, unsigned width, unsigned height, unsigned flags)
-{
- struct i915_context *i915 = i915_context( pipe );
- struct pipe_region *region = calloc(sizeof(*region), 1);
- const unsigned alignment = 64;
-
- /* Choose a pitch to match hardware requirements - requires 64 byte
- * alignment of render targets.
- *
- * XXX: is this ok for textures??
- * clearly want to be able to render to textures under some
- * circumstances, but maybe not always a requirement.
- */
- unsigned pitch;
-
- /* XXX is the pitch different for textures vs. drawables? */
- if (flags & PIPE_SURFACE_FLAG_TEXTURE) /* or PIPE_SURFACE_FLAG_RENDER? */
- pitch = ((cpp * width + 63) & ~63) / cpp;
- else
- pitch = ((cpp * width + 63) & ~63) / cpp;
-
- region->cpp = cpp;
- region->pitch = pitch;
- region->height = height; /* needed? */
- region->refcount = 1;
-
- region->buffer = i915->pipe.winsys->buffer_create( i915->pipe.winsys, alignment );
-
- i915->pipe.winsys->buffer_data( i915->pipe.winsys,
- region->buffer,
- pitch * cpp * height,
- NULL );
-
- return region;
-}
-
-static void
-i915_region_release(struct pipe_context *pipe, struct pipe_region **region)
-{
- struct i915_context *i915 = i915_context( pipe );
-
- if (!*region)
- return;
-
- assert((*region)->refcount > 0);
- (*region)->refcount--;
-
- if ((*region)->refcount == 0) {
- assert((*region)->map_refcount == 0);
-
- i915->pipe.winsys->buffer_reference( i915->pipe.winsys,
- &((*region)->buffer), NULL );
- free(*region);
- }
- *region = NULL;
-}
-
/*
* XXX Move this into core Mesa?
@@ -302,8 +243,6 @@ i915_init_region_functions(struct i915_context *i915)
{
i915->pipe.region_map = i915_region_map;
i915->pipe.region_unmap = i915_region_unmap;
- i915->pipe.region_alloc = i915_region_alloc;
- i915->pipe.region_release = i915_region_release;
i915->pipe.region_data = i915_region_data;
i915->pipe.region_copy = i915_region_copy;
i915->pipe.region_fill = i915_region_fill;