From c5ed7b6e76a71d34e4a42ebfca092bd99cb39438 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 4 Nov 2009 20:36:48 +0000 Subject: i965g: plumb in some surface state --- src/gallium/drivers/i965/brw_screen_surface.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/i965/brw_screen_surface.c') diff --git a/src/gallium/drivers/i965/brw_screen_surface.c b/src/gallium/drivers/i965/brw_screen_surface.c index 04a6fc7b66d..1c408e9f2e5 100644 --- a/src/gallium/drivers/i965/brw_screen_surface.c +++ b/src/gallium/drivers/i965/brw_screen_surface.c @@ -35,6 +35,7 @@ #include "pipe/p_screen.h" #include "brw_screen.h" #include "brw_defines.h" +#include "brw_winsys.h" enum { BRW_VIEW_LINEAR, @@ -145,6 +146,12 @@ static struct brw_surface *create_in_place_view( struct brw_screen *brw_screen, surface->base.face = id.bits.face; surface->base.level = id.bits.level; surface->id = id; + surface->cpp = tex->cpp; + surface->pitch = tex->pitch; + surface->tiling = tex->tiling; + + surface->bo = tex->bo; + brw_screen->sws->bo_reference(surface->bo); pipe_texture_reference( &surface->base.texture, &tex->base ); @@ -234,10 +241,16 @@ static struct pipe_surface *brw_get_tex_surface(struct pipe_screen *screen, } -static void brw_tex_surface_destroy( struct pipe_surface *surface ) +static void brw_tex_surface_destroy( struct pipe_surface *surf ) { + struct brw_surface *surface = brw_surface(surf); + struct brw_screen *screen = brw_screen(surf->texture->screen); + /* Unreference texture, shared buffer: */ + screen->sws->bo_unreference(surface->bo); + pipe_texture_reference( &surface->base.texture, NULL ); + FREE(surface); } -- cgit v1.2.3