aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r--src/gallium/include/pipe/internal/p_winsys_screen.h (renamed from src/gallium/include/pipe/p_winsys.h)15
-rw-r--r--src/gallium/include/pipe/p_inlines.h28
-rw-r--r--src/gallium/include/pipe/p_screen.h37
3 files changed, 50 insertions, 30 deletions
diff --git a/src/gallium/include/pipe/p_winsys.h b/src/gallium/include/pipe/internal/p_winsys_screen.h
index bda1907cc16..ee835578b23 100644
--- a/src/gallium/include/pipe/p_winsys.h
+++ b/src/gallium/include/pipe/internal/p_winsys_screen.h
@@ -36,7 +36,7 @@
#define P_WINSYS_H
-#include "p_format.h"
+#include "pipe/p_format.h"
#ifdef __cplusplus
@@ -90,7 +90,7 @@ struct pipe_winsys
* alignment indicates the client's alignment requirements, eg for
* SSE instructions.
*/
- struct pipe_buffer *(*_buffer_create)( struct pipe_winsys *ws,
+ struct pipe_buffer *(*buffer_create)( struct pipe_winsys *ws,
unsigned alignment,
unsigned usage,
unsigned size );
@@ -116,7 +116,7 @@ struct pipe_winsys
* Note that ptr may be accessed at any time upto the time when the
* buffer is destroyed, so the data must not be freed before then.
*/
- struct pipe_buffer *(*_user_buffer_create)(struct pipe_winsys *ws,
+ struct pipe_buffer *(*user_buffer_create)(struct pipe_winsys *ws,
void *ptr,
unsigned bytes);
@@ -131,7 +131,7 @@ struct pipe_winsys
* with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying
* buffer storage.
*/
- struct pipe_buffer *(*_surface_buffer_create)(struct pipe_winsys *ws,
+ struct pipe_buffer *(*surface_buffer_create)(struct pipe_winsys *ws,
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
@@ -142,14 +142,14 @@ struct pipe_winsys
* Map the entire data store of a buffer object into the client's address.
* flags is bitmask of PIPE_BUFFER_USAGE_CPU_READ/WRITE flags.
*/
- void *(*_buffer_map)( struct pipe_winsys *ws,
+ void *(*buffer_map)( struct pipe_winsys *ws,
struct pipe_buffer *buf,
unsigned usage );
- void (*_buffer_unmap)( struct pipe_winsys *ws,
+ void (*buffer_unmap)( struct pipe_winsys *ws,
struct pipe_buffer *buf );
- void (*_buffer_destroy)( struct pipe_winsys *ws,
+ void (*buffer_destroy)( struct pipe_winsys *ws,
struct pipe_buffer *buf );
@@ -178,7 +178,6 @@ struct pipe_winsys
};
-
#ifdef __cplusplus
}
#endif
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index da7334bb67a..1219c817b4c 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -31,7 +31,6 @@
#include "p_context.h"
#include "p_defines.h"
#include "p_screen.h"
-#include "p_winsys.h"
#ifdef __cplusplus
@@ -129,26 +128,20 @@ pipe_texture_release(struct pipe_texture **ptr)
/**
- * Convenience wrappers for winsys buffer functions.
+ * Convenience wrappers for screen buffer functions.
*/
static INLINE struct pipe_buffer *
pipe_buffer_create( struct pipe_screen *screen,
unsigned alignment, unsigned usage, unsigned size )
{
- if (screen->buffer_create)
- return screen->buffer_create(screen, alignment, usage, size);
- else
- return screen->winsys->_buffer_create(screen->winsys, alignment, usage, size);
+ return screen->buffer_create(screen, alignment, usage, size);
}
static INLINE struct pipe_buffer *
pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
{
- if (screen->user_buffer_create)
- return screen->user_buffer_create(screen, ptr, size);
- else
- return screen->winsys->_user_buffer_create(screen->winsys, ptr, size);
+ return screen->user_buffer_create(screen, ptr, size);
}
static INLINE void *
@@ -156,20 +149,14 @@ pipe_buffer_map(struct pipe_screen *screen,
struct pipe_buffer *buf,
unsigned usage)
{
- if (screen->buffer_map)
- return screen->buffer_map(screen, buf, usage);
- else
- return screen->winsys->_buffer_map(screen->winsys, buf, usage);
+ return screen->buffer_map(screen, buf, usage);
}
static INLINE void
pipe_buffer_unmap(struct pipe_screen *screen,
struct pipe_buffer *buf)
{
- if (screen->buffer_unmap)
- screen->buffer_unmap(screen, buf);
- else
- screen->winsys->_buffer_unmap(screen->winsys, buf);
+ screen->buffer_unmap(screen, buf);
}
/* XXX: thread safety issues!
@@ -187,10 +174,7 @@ pipe_buffer_reference(struct pipe_screen *screen,
if (*ptr) {
assert((*ptr)->refcount);
if(--(*ptr)->refcount == 0) {
- if (screen->buffer_destroy)
- screen->buffer_destroy( screen, *ptr );
- else
- screen->winsys->_buffer_destroy( screen->winsys, *ptr );
+ screen->buffer_destroy( screen, *ptr );
}
}
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index b072484a84c..715fa39cbec 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -48,6 +48,8 @@ extern "C" {
#endif
+/** Opaque type */
+struct pipe_fence_handle;
/**
* Gallium screen/adapter context. Basically everything
@@ -196,6 +198,41 @@ struct pipe_screen {
void (*buffer_destroy)( struct pipe_screen *screen,
struct pipe_buffer *buf );
+
+
+ /**
+ * Do any special operations to ensure frontbuffer contents are
+ * displayed, eg copy fake frontbuffer.
+ */
+ void (*flush_frontbuffer)( struct pipe_screen *screen,
+ struct pipe_surface *surf,
+ void *context_private );
+
+
+
+ /** Set ptr = fence, with reference counting */
+ void (*fence_reference)( struct pipe_screen *screen,
+ struct pipe_fence_handle **ptr,
+ struct pipe_fence_handle *fence );
+
+ /**
+ * Checks whether the fence has been signalled.
+ * \param flags driver-specific meaning
+ * \return zero on success.
+ */
+ int (*fence_signalled)( struct pipe_screen *screen,
+ struct pipe_fence_handle *fence,
+ unsigned flag );
+
+ /**
+ * Wait for the fence to finish.
+ * \param flags driver-specific meaning
+ * \return zero on success.
+ */
+ int (*fence_finish)( struct pipe_screen *screen,
+ struct pipe_fence_handle *fence,
+ unsigned flag );
+
};