summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-02-02 23:47:16 -0500
committerZack Rusin <zackr@vmware.com>2009-02-02 23:47:16 -0500
commit5069bfed29bcee2c89c36c74c6d65d388eb7792e (patch)
tree2aef5035140ca24eef97b5d328e0c29d0460f3a8 /src/gallium/winsys
parentdf73c964d85d2f44d8c62558b5752b2f4443763f (diff)
gallium: remove pipe_buffer from surfaces
this change disassociates, at least from the driver perspective, the surface from buffer. surfaces are technically now views on the textures so make it so by hiding the buffer in the internals of textures.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/egl_xlib/egl_xlib.c5
-rw-r--r--src/gallium/winsys/xlib/Makefile4
-rw-r--r--src/gallium/winsys/xlib/xlib_brw_screen.c13
-rw-r--r--src/gallium/winsys/xlib/xlib_cell.c4
-rw-r--r--src/gallium/winsys/xlib/xlib_softpipe.c8
5 files changed, 23 insertions, 11 deletions
diff --git a/src/gallium/winsys/egl_xlib/egl_xlib.c b/src/gallium/winsys/egl_xlib/egl_xlib.c
index 4876339107..c6b0e3d8c5 100644
--- a/src/gallium/winsys/egl_xlib/egl_xlib.c
+++ b/src/gallium/winsys/egl_xlib/egl_xlib.c
@@ -41,6 +41,7 @@
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_memory.h"
#include "softpipe/sp_winsys.h"
+#include "softpipe/sp_texture.h"
#include "eglconfig.h"
#include "eglconfigutil.h"
@@ -292,7 +293,7 @@ display_surface(struct pipe_winsys *pws,
assert(ximage->format);
assert(ximage->bitmap_unit);
- data = pws->buffer_map(pws, psurf->buffer, 0);
+ data = pws->buffer_map(pws, softpipe_texture(psurf->texture)->buffer, 0);
/* update XImage's fields */
ximage->data = data;
@@ -308,7 +309,7 @@ display_surface(struct pipe_winsys *pws,
ximage->data = NULL;
XDestroyImage(ximage);
- pws->buffer_unmap(pws, psurf->buffer);
+ pws->buffer_unmap(pws, softpipe_texture(psurf->texture)->buffer);
}
diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index 5b71e6dc38..8c2892d49b 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -22,11 +22,11 @@ INCLUDE_DIRS = \
-I$(TOP)/src/gallium/state_trackers/glx/xlib \
-I$(TOP)/src/gallium/auxiliary
-DEFINES = \
+DEFINES += \
-DGALLIUM_SOFTPIPE \
- -DGALLIUM_CELL \
-DGALLIUM_TRACE \
-DGALLIUM_BRW
+#-DGALLIUM_CELL will be defined by the config */
XLIB_WINSYS_SOURCES = \
xlib.c \
diff --git a/src/gallium/winsys/xlib/xlib_brw_screen.c b/src/gallium/winsys/xlib/xlib_brw_screen.c
index 5344c502ef..51740a9af6 100644
--- a/src/gallium/winsys/xlib/xlib_brw_screen.c
+++ b/src/gallium/winsys/xlib/xlib_brw_screen.c
@@ -42,12 +42,19 @@
#include "util/u_memory.h"
#include "i965simple/brw_winsys.h"
#include "i965simple/brw_screen.h"
+#include "i965simple/brw_context.h"
+
#include "xlib_brw_aub.h"
#include "xlib_brw.h"
#include "xlib.h"
-
+static struct pipe_buffer *
+buffer_from_surface(struct pipe_surface *surface)
+{
+ struct brw_texture *texture = (struct brw_texture *)surface;
+ return texture->buffer;
+}
struct aub_buffer {
char *data;
@@ -226,7 +233,7 @@ aub_flush_frontbuffer( struct pipe_winsys *winsys,
// struct aub_pipe_winsys *iws = aub_pipe_winsys(winsys);
brw_aub_dump_bmp( global_winsys->aubfile,
surface,
- aub_bo(surface->buffer)->offset );
+ aub_bo(buffer_from_surface(surface))->offset );
}
@@ -449,7 +456,7 @@ xlib_brw_display_surface(struct xmesa_buffer *b,
{
brw_aub_dump_bmp( global_winsys->aubfile,
surf,
- aub_bo(surf->buffer)->offset );
+ aub_bo(buffer_from_surface(surf))->offset );
}
diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c
index bf69593c5c..c87564f4dc 100644
--- a/src/gallium/winsys/xlib/xlib_cell.c
+++ b/src/gallium/winsys/xlib/xlib_cell.c
@@ -51,6 +51,7 @@
#include "cell/ppu/cell_context.h"
#include "cell/ppu/cell_screen.h"
#include "cell/ppu/cell_winsys.h"
+#include "cell/ppu/cell_texture.h"
/**
@@ -164,7 +165,8 @@ static void
xlib_cell_display_surface(struct xmesa_buffer *b, struct pipe_surface *surf)
{
XImage *ximage;
- struct xm_buffer *xm_buf = xm_buffer(surf->buffer);
+ struct xm_buffer *xm_buf = xm_buffer(
+ cell_texture(surf->texture)->buffer);
const uint tilesPerRow = (surf->width + TILE_SIZE - 1) / TILE_SIZE;
uint x, y;
diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c
index 01d24584e2..586e1dfca5 100644
--- a/src/gallium/winsys/xlib/xlib_softpipe.c
+++ b/src/gallium/winsys/xlib/xlib_softpipe.c
@@ -45,6 +45,7 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "softpipe/sp_winsys.h"
+#include "softpipe/sp_texture.h"
#include "xlib.h"
@@ -58,7 +59,7 @@ struct xm_buffer
boolean userBuffer; /** Is this a user-space buffer? */
void *data;
void *mapped;
-
+
XImage *tempImage;
int shm;
XShmSegmentInfo shminfo;
@@ -225,11 +226,12 @@ xm_buffer_destroy(struct pipe_winsys *pws,
* by the XMesaBuffer.
*/
static void
-xlib_softpipe_display_surface(struct xmesa_buffer *b,
+xlib_softpipe_display_surface(struct xmesa_buffer *b,
struct pipe_surface *surf)
{
XImage *ximage;
- struct xm_buffer *xm_buf = xm_buffer(surf->buffer);
+ struct xm_buffer *xm_buf = xm_buffer(
+ softpipe_texture(surf->texture)->buffer);
static boolean no_swap = 0;
static boolean firsttime = 1;