summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-03-02 13:27:46 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-03-02 13:27:46 +0000
commit97a1fd158c9acfaa3a8deda7eb5bf0b253e85c15 (patch)
tree37e6c11507c1ef044aa8f0ee009136bb1d8b5bbc /src/gallium/include
parent60e5fe65067da76dea816535bec1e9073adc0ba7 (diff)
parentb70f344e223fc10df8df08a6d82a813505225712 (diff)
Merge commit 'origin/master' into gallium-map-range
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_config.h8
-rw-r--r--src/gallium/include/pipe/p_thread.h10
-rw-r--r--src/gallium/include/state_tracker/drm_api.h22
3 files changed, 29 insertions, 11 deletions
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index 05cbd2fc4d..7f7657031d 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -111,6 +111,10 @@
#define PIPE_OS_LINUX
#endif
+#if defined(__FreeBSD__)
+#define PIPE_OS_BSD
+#endif
+
#if defined(_WIN32) || defined(WIN32)
#define PIPE_OS_WINDOWS
#endif
@@ -122,9 +126,9 @@
* NOTE: There is no way to auto-detect most of these.
*/
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
#define PIPE_SUBSYSTEM_DRI
-#endif /* PIPE_OS_LINUX */
+#endif /* PIPE_OS_LINUX || PIPE_OS_BSD */
#if defined(PIPE_OS_WINDOWS)
#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index 8af3cd958b..e59b999b9a 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -38,7 +38,7 @@
#include "pipe/p_compiler.h"
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
#include <pthread.h> /* POSIX threads headers */
#include <stdio.h> /* for perror() */
@@ -210,7 +210,7 @@ typedef unsigned pipe_condvar;
*/
typedef struct {
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
pthread_key_t key;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD key;
@@ -225,7 +225,7 @@ typedef struct {
static INLINE void
pipe_tsd_init(pipe_tsd *tsd)
{
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror("pthread_key_create(): failed to allocate key for thread specific data");
exit(-1);
@@ -242,7 +242,7 @@ pipe_tsd_get(pipe_tsd *tsd)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
return pthread_getspecific(tsd->key);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert(0);
@@ -259,7 +259,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
if (pthread_setspecific(tsd->key, value) != 0) {
perror("pthread_set_specific() failed");
exit(-1);
diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h
index 54480fa047..91a727be66 100644
--- a/src/gallium/include/state_tracker/drm_api.h
+++ b/src/gallium/include/state_tracker/drm_api.h
@@ -2,14 +2,18 @@
#ifndef _DRM_API_H_
#define _DRM_API_H_
+#include "pipe/p_compiler.h"
+
struct pipe_screen;
struct pipe_winsys;
+struct pipe_buffer;
struct pipe_context;
+struct pipe_texture;
struct drm_api
{
/**
- * Special buffer function
+ * Special buffer functions
*/
/*@{*/
struct pipe_screen* (*create_screen)(int drmFB, int pciID);
@@ -17,11 +21,21 @@ struct drm_api
/*@}*/
/**
- * Special buffer function
+ * Special buffer functions
*/
/*@{*/
- 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);
+ boolean (*buffer_from_texture)(struct pipe_texture *texture,
+ struct pipe_buffer **buffer,
+ unsigned *stride);
+ struct pipe_buffer* (*buffer_from_handle)(struct pipe_screen *screen,
+ const char *name,
+ unsigned handle);
+ boolean (*handle_from_buffer)(struct pipe_screen *screen,
+ struct pipe_buffer *buffer,
+ unsigned *handle);
+ boolean (*global_handle_from_buffer)(struct pipe_screen *screen,
+ struct pipe_buffer *buffer,
+ unsigned *handle);
/*@}*/
};