From 7047f1755f88d6b1f424904e692edbd03a9d190b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 18 Jan 2009 15:36:47 +0100 Subject: egl: Add a egl state_tracker that use Gallium This works on top Gallium and KMS. The only thing that does not work currently is swap buffers for shown mesa screens. So the only fun thing this will produce is a white screen. The driver wishing to us the state_tracker needs to implement the intrace as define in drm_api.h located in gallium/include/state_tracker. And also have a working KMS implementation. --- src/gallium/include/state_tracker/drm_api.h | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/gallium/include/state_tracker/drm_api.h (limited to 'src/gallium/include') diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h new file mode 100644 index 0000000000..54480fa047 --- /dev/null +++ b/src/gallium/include/state_tracker/drm_api.h @@ -0,0 +1,33 @@ + +#ifndef _DRM_API_H_ +#define _DRM_API_H_ + +struct pipe_screen; +struct pipe_winsys; +struct pipe_context; + +struct drm_api +{ + /** + * Special buffer function + */ + /*@{*/ + struct pipe_screen* (*create_screen)(int drmFB, int pciID); + struct pipe_context* (*create_context)(struct pipe_screen *screen); + /*@}*/ + + /** + * Special buffer function + */ + /*@{*/ + struct pipe_buffer* (*buffer_from_handle)(struct pipe_winsys *winsys, const char *name, unsigned handle); + unsigned (*handle_from_buffer)(struct pipe_winsys *winsys, struct pipe_buffer *buffer); + /*@}*/ +}; + +/** + * A driver needs to export this symbol + */ +extern struct drm_api drm_api_hocks; + +#endif -- cgit v1.2.3 From 0521c2682a3249562ff6a3d6ab6c90d1d63b82a3 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Wed, 14 Jan 2009 00:21:24 -0500 Subject: gallium: Add PIPE_BUFFER_USAGE_DISCARD. When passed to map() signals that the buffer's previous contents are not required, allowing the driver to allocate a new buffer if the current buffer can not be mapped immediately. --- src/gallium/include/pipe/p_defines.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/include') diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 5c6a92b53b..4f0b301f31 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -204,6 +204,7 @@ enum pipe_texture_target { #define PIPE_BUFFER_USAGE_VERTEX (1 << 5) #define PIPE_BUFFER_USAGE_INDEX (1 << 6) #define PIPE_BUFFER_USAGE_CONSTANT (1 << 7) +#define PIPE_BUFFER_USAGE_DISCARD (1 << 8) /** Pipe driver custom usage flags should be greater or equal to this value */ #define PIPE_BUFFER_USAGE_CUSTOM (1 << 16) -- cgit v1.2.3