summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-08-15 11:24:06 +0100
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-08-15 11:24:06 +0100
commit4b1b5ca9bd4d861ac8654c510f12b52a1a646ec4 (patch)
tree2a720ec52ed6c14c7d805d2d0da75469dba40d4f /src/gallium
parent9d58b2a432d44fc2861f2df1a611188f92dc288f (diff)
xlib: Kill xmesa_surface.
A winsys cannot expect that the surfaces passed display_surface are the surfaces it created, as surface are now in generate texture views created by pipe_screen. Indeed, the fact it was working so far was mere luck. This fixes a weird tiled output when using the trace pipe driver. Winsys' surfaces should die.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c62
1 files changed, 19 insertions, 43 deletions
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 3ab4c67cae..4b4dc56e84 100644
--- a/src/gallium/winsys/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -82,18 +82,6 @@ struct xm_buffer
/**
- * Subclass of pipe_surface for Xlib winsys
- */
-struct xmesa_surface
-{
- struct pipe_surface surface;
-
- int tileSize;
- boolean no_swap;
-};
-
-
-/**
* Subclass of pipe_winsys for Xlib winsys
*/
struct xmesa_pipe_winsys
@@ -106,14 +94,6 @@ struct xmesa_pipe_winsys
/** Cast wrapper */
-static INLINE struct xmesa_surface *
-xmesa_surface(struct pipe_surface *ps)
-{
- return (struct xmesa_surface *) ps;
-}
-
-
-/** Cast wrapper */
static INLINE struct xm_buffer *
xm_buffer( struct pipe_buffer *buf )
{
@@ -358,13 +338,24 @@ xmesa_display_surface(XMesaBuffer b, const struct pipe_surface *surf)
{
XImage *ximage;
struct xm_buffer *xm_buf = xm_buffer(surf->buffer);
- const struct xmesa_surface *xm_surf
- = xmesa_surface((struct pipe_surface *) surf);
+ static boolean no_swap = 0;
+ static boolean firsttime = 1;
+ static int tileSize = 0;
- if (xm_surf->no_swap)
+ if (firsttime) {
+ no_swap = getenv("SP_NO_RAST") != NULL;
+#ifdef GALLIUM_CELL
+ if (!getenv("GALLIUM_NOCELL")) {
+ tileSize = 32; /** probably temporary */
+ }
+#endif
+ firsttime = 0;
+ }
+
+ if (no_swap)
return;
- if (xm_surf->tileSize) {
+ if (tileSize) {
xmesa_display_surface_tiled(b, surf);
return;
}
@@ -531,29 +522,14 @@ xm_surface_alloc_storage(struct pipe_winsys *winsys,
static struct pipe_surface *
xm_surface_alloc(struct pipe_winsys *ws)
{
- struct xmesa_surface *xms = CALLOC_STRUCT(xmesa_surface);
- static boolean no_swap = 0;
- static boolean firsttime = 1;
-
- if (firsttime) {
- no_swap = getenv("SP_NO_RAST") != NULL;
- firsttime = 0;
- }
+ struct pipe_surface *surface = CALLOC_STRUCT(pipe_surface);
assert(ws);
- xms->surface.refcount = 1;
- xms->surface.winsys = ws;
+ surface->refcount = 1;
+ surface->winsys = ws;
-#ifdef GALLIUM_CELL
- if (!getenv("GALLIUM_NOCELL")) {
- xms->tileSize = 32; /** probably temporary */
- }
-#endif
-
- xms->no_swap = no_swap;
-
- return &xms->surface;
+ return surface;
}