diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-02-14 13:59:56 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-02-14 13:59:56 +0000 |
commit | b4589471c32468c34243974a2643694ef987ccc0 (patch) | |
tree | 4dbd68c1b588a3217e4dd49e031c414c6b7882a3 | |
parent | 76f8074b54ebd4ae68e2ed31c6ade301603cbda5 (diff) |
trace: add missing files
-rw-r--r-- | src/gallium/drivers/trace/Makefile | 2 | ||||
-rw-r--r-- | src/gallium/drivers/trace/SConscript | 2 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_xm.c | 118 | ||||
-rw-r--r-- | src/gallium/drivers/trace/tr_xm.h | 35 | ||||
-rw-r--r-- | src/gallium/winsys/xlib/xlib.c | 2 |
5 files changed, 156 insertions, 3 deletions
diff --git a/src/gallium/drivers/trace/Makefile b/src/gallium/drivers/trace/Makefile index ab421f0079..aa0b2cc448 100644 --- a/src/gallium/drivers/trace/Makefile +++ b/src/gallium/drivers/trace/Makefile @@ -12,7 +12,7 @@ C_SOURCES = \ tr_state.c \ tr_rbug.c \ tr_drm.c \ - tr_x11.c \ + tr_xm.c \ tr_texture.c include ../../Makefile.template diff --git a/src/gallium/drivers/trace/SConscript b/src/gallium/drivers/trace/SConscript index f208ae63da..9608227da7 100644 --- a/src/gallium/drivers/trace/SConscript +++ b/src/gallium/drivers/trace/SConscript @@ -8,7 +8,7 @@ trace = env.ConvenienceLibrary( 'tr_buffer.c', 'tr_context.c', 'tr_drm.c', - 'tr_x11.c', + 'tr_xm.c', 'tr_dump.c', 'tr_dump_state.c', 'tr_screen.c', diff --git a/src/gallium/drivers/trace/tr_xm.c b/src/gallium/drivers/trace/tr_xm.c new file mode 100644 index 0000000000..6fdb3c68d7 --- /dev/null +++ b/src/gallium/drivers/trace/tr_xm.c @@ -0,0 +1,118 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include "state_tracker/xm_winsys.h" + +#include "util/u_memory.h" +#include "trace/tr_xm.h" +#include "trace/tr_screen.h" +#include "trace/tr_context.h" +#include "trace/tr_buffer.h" +#include "trace/tr_texture.h" + +struct trace_xm_driver +{ + struct xm_driver base; + + struct xm_driver *driver; +}; + +static INLINE struct trace_xm_driver * +trace_xm_driver(struct xm_driver *_driver) +{ + return (struct trace_xm_driver *)_driver; +} + +static struct pipe_screen * +trace_xm_create_screen(struct xm_driver *_driver) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct xm_driver *driver = tr_driver->driver; + struct pipe_screen *screen; + + /* TODO trace call */ + + screen = driver->create_screen(driver); + + return trace_screen_create(screen); +} + + +static void +trace_xm_display_surface(struct xm_driver *_driver, + struct xmesa_buffer *buffer, + struct pipe_surface *_surface) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct trace_surface *tr_surface = trace_surface(_surface); + struct xm_driver *driver = tr_driver->driver; + struct pipe_surface *surface = tr_surface->surface; + + /* TODO trace call */ + + driver->display_surface(driver, buffer, surface); +} + + +static void +trace_xm_destroy(struct xm_driver *_driver) +{ + struct trace_xm_driver *tr_driver = trace_xm_driver(_driver); + struct xm_driver *driver = tr_driver->driver; + + if (driver->destroy) + driver->destroy(driver); + + free(tr_driver); +} + +struct xm_driver * +trace_xm_create(struct xm_driver *driver) +{ + struct trace_xm_driver *tr_driver; + + if (!driver) + goto error; + + if (!trace_enabled()) + goto error; + + tr_driver = CALLOC_STRUCT(trace_xm_driver); + + if (!tr_driver) + goto error; + + tr_driver->base.create_screen = trace_xm_create_screen; + tr_driver->base.display_surface = trace_xm_display_surface; + tr_driver->base.destroy = trace_xm_destroy; + tr_driver->driver = driver; + + return &tr_driver->base; + +error: + return driver; +} diff --git a/src/gallium/drivers/trace/tr_xm.h b/src/gallium/drivers/trace/tr_xm.h new file mode 100644 index 0000000000..0404917d64 --- /dev/null +++ b/src/gallium/drivers/trace/tr_xm.h @@ -0,0 +1,35 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef TR_XM_H +#define TR_XM_H + +struct xm_driver; + +struct xm_driver* trace_xm_create(struct xm_driver *api); + +#endif /* TR_XM_H */ diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c index db42212258..e1cd0a2e09 100644 --- a/src/gallium/winsys/xlib/xlib.c +++ b/src/gallium/winsys/xlib/xlib.c @@ -32,7 +32,7 @@ */ #include "xlib.h" -#include "trace/tr_x11.h" +#include "trace/tr_xm.h" #include <stdlib.h> #include <assert.h> |