summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-11-28 19:04:54 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-11-29 16:41:39 +0100
commit11a80160fd60d1eb1541b49128c659526a5d8ac8 (patch)
tree410bbe6407d37e9ca3af884f89e03104926624ad /src/mesa/drivers
parent7043db677f457ae9a46f2585a5ef52bf69a4e8ea (diff)
Move dimensions from struct pipe_region to struct pipe_surface.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c6
-rw-r--r--src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c30
2 files changed, 19 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
index 9fcb2dac27..f96209d1b0 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
@@ -89,15 +89,15 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv,
const int pitch = intelScreen->front.pitch / intelScreen->front.cpp;
const int cpp = intelScreen->front.cpp;
const struct pipe_region *srcRegion = surf->region;
- const int srcpitch = srcRegion->pitch;
+ const int srcpitch = surf->pitch;
int BR13, CMD;
int i;
ASSERT(srcRegion);
- ASSERT(srcRegion->cpp == cpp);
+ ASSERT(surf->cpp == cpp);
DBG(SWAP, "screen pitch %d src surface pitch %d\n",
- pitch, srcRegion->pitch);
+ pitch, surf->pitch);
if (cpp == 2) {
BR13 = (pitch * cpp) | (0xCC << 16) | (1 << 24);
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
index ae02f98a78..7b3aa99482 100644
--- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
+++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
@@ -173,14 +173,10 @@ intel_flush_frontbuffer( struct pipe_winsys *winsys,
}
-static struct pipe_region *
-intel_i915_region_alloc(struct pipe_winsys *winsys,
- unsigned cpp, unsigned width,
- unsigned height, unsigned flags)
+static unsigned
+intel_i915_surface_pitch(struct pipe_winsys *winsys,
+ unsigned cpp, unsigned width, unsigned flags)
{
- 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.
*
@@ -188,24 +184,29 @@ intel_i915_region_alloc(struct pipe_winsys *winsys,
* 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;
+ return ((cpp * width + 63) & ~63) / cpp;
else
- pitch = ((cpp * width + 63) & ~63) / cpp;
+ return ((cpp * width + 63) & ~63) / cpp;
+}
+
+
+static struct pipe_region *
+intel_i915_region_alloc(struct pipe_winsys *winsys,
+ unsigned size, unsigned flags)
+{
+ struct pipe_region *region = calloc(sizeof(*region), 1);
+ const unsigned alignment = 64;
- region->cpp = cpp;
- region->pitch = pitch;
- region->height = height; /* needed? */
region->refcount = 1;
region->buffer = winsys->buffer_create( winsys, alignment );
winsys->buffer_data( winsys,
region->buffer,
- pitch * cpp * height,
+ size,
NULL,
PIPE_BUFFER_USAGE_PIXEL );
@@ -301,6 +302,7 @@ intel_create_pipe_winsys( int fd )
iws->winsys.get_name = intel_get_name;
iws->winsys.region_alloc = intel_i915_region_alloc;
iws->winsys.region_release = intel_i915_region_release;
+ iws->winsys.surface_pitch = intel_i915_surface_pitch;
iws->winsys.surface_alloc = intel_i915_surface_alloc;
iws->winsys.surface_release = intel_i915_surface_release;