summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/internal/p_winsys_screen.h1
-rw-r--r--src/gallium/include/pipe/p_compiler.h4
-rw-r--r--src/gallium/include/pipe/p_config.h3
-rw-r--r--src/gallium/include/pipe/p_context.h17
-rw-r--r--src/gallium/include/pipe/p_defines.h8
-rw-r--r--src/gallium/include/pipe/p_inlines.h35
-rw-r--r--src/gallium/include/pipe/p_screen.h1
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h175
-rw-r--r--src/gallium/include/pipe/p_state.h24
-rw-r--r--src/gallium/include/pipe/p_thread.h10
-rw-r--r--src/gallium/include/state_tracker/drm_api.h29
11 files changed, 111 insertions, 196 deletions
diff --git a/src/gallium/include/pipe/internal/p_winsys_screen.h b/src/gallium/include/pipe/internal/p_winsys_screen.h
index f4a29e63c7..a1542dada7 100644
--- a/src/gallium/include/pipe/internal/p_winsys_screen.h
+++ b/src/gallium/include/pipe/internal/p_winsys_screen.h
@@ -140,6 +140,7 @@ struct pipe_winsys
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
+ unsigned tex_usage,
unsigned *stride);
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index e6a67f8c2f..c13cffceb0 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -93,9 +93,11 @@ typedef int _Bool;
#endif
+#ifndef __HAIKU__
typedef unsigned int uint;
-typedef unsigned char ubyte;
typedef unsigned short ushort;
+#endif
+typedef unsigned char ubyte;
#if 0
#define boolean bool
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index 4152d6ac36..de99957d9d 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -140,6 +140,9 @@
#define PIPE_OS_WINDOWS
#endif
+#if defined(__HAIKU__)
+#define PIPE_OS_HAIKU
+#endif
/*
* Subsystem.
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 57e966ac3b..39620a7198 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -98,7 +98,7 @@ struct pipe_context {
*/
/*@{*/
struct pipe_query *(*create_query)( struct pipe_context *pipe,
- unsigned query_type );
+ unsigned query_type );
void (*destroy_query)(struct pipe_context *pipe,
struct pipe_query *q);
@@ -215,10 +215,12 @@ struct pipe_context {
/**
* Clear the specified set of currently bound buffers to specified values.
+ * The entire buffers are cleared (no scissor, no colormask, etc).
*
- * buffers is a bitfield of PIPE_CLEAR_* values.
- *
- * rgba is a pointer to an array of one float for each of r, g, b, a.
+ * \param buffers bitfield of PIPE_CLEAR_* values.
+ * \param rgba pointer to an array of one float for each of r, g, b, a.
+ * \param depth depth clear value in [0,1].
+ * \param stencil stencil clear value
*/
void (*clear)(struct pipe_context *pipe,
unsigned buffers,
@@ -226,7 +228,9 @@ struct pipe_context {
double depth,
unsigned stencil);
- /** Flush rendering (flags = bitmask of PIPE_FLUSH_x tokens) */
+ /** Flush rendering
+ * \param flags bitmask of PIPE_FLUSH_x tokens)
+ */
void (*flush)( struct pipe_context *pipe,
unsigned flags,
struct pipe_fence_handle **fence );
@@ -242,10 +246,10 @@ struct pipe_context {
* \param texture texture to check.
* \param face cubemap face. Use 0 for non-cubemap texture.
*/
-
unsigned int (*is_texture_referenced) (struct pipe_context *pipe,
struct pipe_texture *texture,
unsigned face, unsigned level);
+
/**
* Check whether a buffer is referenced by an unflushed hw command.
* The state-tracker uses this function to optimize away unnecessary
@@ -255,7 +259,6 @@ struct pipe_context {
* checked.
* \param buf Buffer to check.
*/
-
unsigned int (*is_buffer_referenced) (struct pipe_context *pipe,
struct pipe_buffer *buf);
};
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index bc4bc70759..f252d6df00 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -191,9 +191,9 @@ enum pipe_texture_target {
* Transfer object usage flags
*/
enum pipe_transfer_usage {
- PIPE_TRANSFER_READ,
- PIPE_TRANSFER_WRITE,
- PIPE_TRANSFER_READ_WRITE /**< Read/modify/write */
+ PIPE_TRANSFER_READ = (1 << 0),
+ PIPE_TRANSFER_WRITE = (1 << 1),
+ PIPE_TRANSFER_READ_WRITE = PIPE_TRANSFER_READ | PIPE_TRANSFER_WRITE /**< Read/modify/write */
};
@@ -281,7 +281,7 @@ enum pipe_transfer_usage {
#define PIPE_CAP_NPOT_TEXTURES 2
#define PIPE_CAP_TWO_SIDED_STENCIL 3
#define PIPE_CAP_GLSL 4 /* XXX need something better */
-#define PIPE_CAP_S3TC 5
+#define PIPE_CAP_S3TC 5 /* XXX: deprecated; cap determined via supported sampler formats */
#define PIPE_CAP_ANISOTROPIC_FILTER 6
#define PIPE_CAP_POINT_SPRITE 7
#define PIPE_CAP_MAX_RENDER_TARGETS 8
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index cf176c9209..30a4aaf409 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -63,6 +63,13 @@ pipe_buffer_map(struct pipe_screen *screen,
if(screen->buffer_map_range) {
unsigned offset = 0;
unsigned length = buf->size;
+
+ /* XXX: Actually we should be using/detecting DISCARD
+ * instead of assuming that WRITE implies discard */
+ if((usage & PIPE_BUFFER_USAGE_CPU_WRITE) &&
+ !(usage & PIPE_BUFFER_USAGE_DISCARD))
+ usage |= PIPE_BUFFER_USAGE_CPU_READ;
+
return screen->buffer_map_range(screen, buf, offset, length, usage);
}
else
@@ -111,7 +118,7 @@ pipe_buffer_write(struct pipe_screen *screen,
unsigned offset, unsigned size,
const void *data)
{
- uint8_t *map;
+ void *map;
assert(offset < buf->size);
assert(offset + size <= buf->size);
@@ -122,7 +129,7 @@ pipe_buffer_write(struct pipe_screen *screen,
PIPE_BUFFER_USAGE_FLUSH_EXPLICIT);
assert(map);
if(map) {
- memcpy(map + offset, data, size);
+ memcpy((uint8_t *)map + offset, data, size);
pipe_buffer_flush_mapped_range(screen, buf, offset, size);
pipe_buffer_unmap(screen, buf);
}
@@ -134,7 +141,7 @@ pipe_buffer_read(struct pipe_screen *screen,
unsigned offset, unsigned size,
void *data)
{
- uint8_t *map;
+ void *map;
assert(offset < buf->size);
assert(offset + size <= buf->size);
@@ -143,11 +150,31 @@ pipe_buffer_read(struct pipe_screen *screen,
map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_READ);
assert(map);
if(map) {
- memcpy(data, map + offset, size);
+ memcpy(data, (const uint8_t *)map + offset, size);
pipe_buffer_unmap(screen, buf);
}
}
+static INLINE void *
+pipe_transfer_map( struct pipe_transfer *transf )
+{
+ struct pipe_screen *screen = transf->texture->screen;
+ return screen->transfer_map(screen, transf);
+}
+
+static INLINE void
+pipe_transfer_unmap( struct pipe_transfer *transf )
+{
+ struct pipe_screen *screen = transf->texture->screen;
+ screen->transfer_unmap(screen, transf);
+}
+
+static INLINE void
+pipe_transfer_destroy( struct pipe_transfer *transf )
+{
+ struct pipe_screen *screen = transf->texture->screen;
+ screen->tex_transfer_destroy(transf);
+}
#ifdef __cplusplus
}
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 6cbdd75943..3f30c52a16 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -194,6 +194,7 @@ struct pipe_screen {
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
+ unsigned tex_usage,
unsigned *stride);
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 3dfc914269..5fa6c9af30 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -78,6 +78,7 @@ enum tgsi_file_type {
TGSI_FILE_SAMPLER =5,
TGSI_FILE_ADDRESS =6,
TGSI_FILE_IMMEDIATE =7,
+ TGSI_FILE_LOOP =8,
TGSI_FILE_COUNT /**< how many TGSI_FILE_ types */
};
@@ -157,8 +158,11 @@ union tgsi_immediate_data
float Float;
};
-/*
- * GL_NV_vertex_program
+/* TGSI opcodes.
+ *
+ * For more information on semantics of opcodes and
+ * which APIs are known to use which opcodes, see
+ * auxiliary/tgsi/tgsi-instruction-set.txt
*/
#define TGSI_OPCODE_ARL 0
#define TGSI_OPCODE_MOV 1
@@ -177,62 +181,32 @@ union tgsi_immediate_data
#define TGSI_OPCODE_SLT 14
#define TGSI_OPCODE_SGE 15
#define TGSI_OPCODE_MAD 16
-
-/*
- * GL_ATI_fragment_shader
- */
#define TGSI_OPCODE_SUB 17
-/*#define TGSI_OPCODE_DOT3 TGSI_OPCODE_DP3*/
-/*#define TGSI_OPCODE_DOT4 TGSI_OPCODE_DP4*/
#define TGSI_OPCODE_LRP 18
#define TGSI_OPCODE_CND 19
-#define TGSI_OPCODE_CND0 20
+ /* gap */
#define TGSI_OPCODE_DP2A 21
-
-/*
- * GL_EXT_vertex_shader
- */
-#define TGSI_OPCODE_INDEX 22 /* considered for removal */
-#define TGSI_OPCODE_NEGATE 23 /* considered for removal */
-/*#define TGSI_OPCODE_MADD TGSI_OPCODE_MAD*/
+ /* gap */
#define TGSI_OPCODE_FRC 24
-/*#define TGSI_OPCODE_SETGE TGSI_OPCODE_SGE*/
-/*#define TGSI_OPCODE_SETLT TGSI_OPCODE_SLT*/
#define TGSI_OPCODE_CLAMP 25
#define TGSI_OPCODE_FLR 26
#define TGSI_OPCODE_ROUND 27
#define TGSI_OPCODE_EX2 28
#define TGSI_OPCODE_LG2 29
#define TGSI_OPCODE_POW 30
-/*#define TGSI_OPCODE_RECIP TGSI_OPCODE_RCP*/
-/*#define TGSI_OPCODE_RECIPSQRT TGSI_OPCODE_RSQ*/
#define TGSI_OPCODE_XPD 31
-#define TGSI_OPCODE_MULTIPLYMATRIX 32 /* considered for removal */
-
-/*
- * GL_NV_vertex_program1_1
- */
+ /* gap */
#define TGSI_OPCODE_ABS 33
#define TGSI_OPCODE_RCC 34
#define TGSI_OPCODE_DPH 35
-
-/*
- * GL_NV_fragment_program
- */
#define TGSI_OPCODE_COS 36
#define TGSI_OPCODE_DDX 37
#define TGSI_OPCODE_DDY 38
-/*#define TGSI_OPCODE_EX2 TGSI_OPCODE_EXPBASE2*/
-/*#define TGSI_OPCODE_FLR TGSI_OPCODE_FLOOR*/
-/*#define TGSI_OPCODE_FRC TGSI_OPCODE_FRAC*/
#define TGSI_OPCODE_KILP 39 /* predicated kill */
-/*#define TGSI_OPCODE_LG2 TGSI_OPCODE_LOGBASE2*/
-/*#define TGSI_OPCODE_LRP TGSI_OPCODE_LERP*/
#define TGSI_OPCODE_PK2H 40
#define TGSI_OPCODE_PK2US 41
#define TGSI_OPCODE_PK4B 42
#define TGSI_OPCODE_PK4UB 43
-/*#define TGSI_OPCODE_POW TGSI_OPCODE_POWER*/
#define TGSI_OPCODE_RFL 44
#define TGSI_OPCODE_SEQ 45
#define TGSI_OPCODE_SFL 46
@@ -249,66 +223,29 @@ union tgsi_immediate_data
#define TGSI_OPCODE_UP4B 57
#define TGSI_OPCODE_UP4UB 58
#define TGSI_OPCODE_X2D 59
-
-/*
- * GL_NV_vertex_program2
- */
#define TGSI_OPCODE_ARA 60
#define TGSI_OPCODE_ARR 61
#define TGSI_OPCODE_BRA 62
#define TGSI_OPCODE_CAL 63
#define TGSI_OPCODE_RET 64
-#define TGSI_OPCODE_SSG 65
-
-/*
- * GL_ARB_vertex_program
- */
-#define TGSI_OPCODE_SWZ 118
-/*#define TGSI_OPCODE_XPD TGSI_OPCODE_CROSSPRODUCT*/
-
-/*
- * GL_ARB_fragment_program
- */
+#define TGSI_OPCODE_SSG 65 /* SGN */
#define TGSI_OPCODE_CMP 66
-#define TGSI_OPCODE_KIL 116 /* conditional kill */
#define TGSI_OPCODE_SCS 67
#define TGSI_OPCODE_TXB 68
-
-/*
- * GL_NV_fragment_program_option
- */
-/* No new opcode */
-
-/*
- * GL_NV_fragment_program2
- */
#define TGSI_OPCODE_NRM 69
#define TGSI_OPCODE_DIV 70
#define TGSI_OPCODE_DP2 71
-/*#define TGSI_OPCODE_DP2A TGSI_OPCODE_DOT2ADD*/
#define TGSI_OPCODE_TXL 72
#define TGSI_OPCODE_BRK 73
#define TGSI_OPCODE_IF 74
-#define TGSI_OPCODE_LOOP 75
+#define TGSI_OPCODE_BGNFOR 75
#define TGSI_OPCODE_REP 76
#define TGSI_OPCODE_ELSE 77
#define TGSI_OPCODE_ENDIF 78
-#define TGSI_OPCODE_ENDLOOP 79
+#define TGSI_OPCODE_ENDFOR 79
#define TGSI_OPCODE_ENDREP 80
-
-/*
- * GL_NV_vertex_program2_option
- */
-
-/*
- * GL_NV_vertex_program3
- */
#define TGSI_OPCODE_PUSHA 81
#define TGSI_OPCODE_POPA 82
-
-/*
- * GL_NV_gpu_program4
- */
#define TGSI_OPCODE_CEIL 83
#define TGSI_OPCODE_I2F 84
#define TGSI_OPCODE_NOT 85
@@ -323,103 +260,25 @@ union tgsi_immediate_data
#define TGSI_OPCODE_TXF 94
#define TGSI_OPCODE_TXQ 95
#define TGSI_OPCODE_CONT 96
-
-/*
- * GL_NV_vertex_program4
- */
-/* Same as GL_NV_gpu_program4 */
-
-/*
- * GL_NV_fragment_program4
- */
-/* Same as GL_NV_gpu_program4 */
-
-/*
- * GL_NV_geometry_program4
- */
-/* Same as GL_NV_gpu_program4 */
#define TGSI_OPCODE_EMIT 97
#define TGSI_OPCODE_ENDPRIM 98
-
-/*
- * GLSL
- */
-#define TGSI_OPCODE_BGNLOOP2 99
+#define TGSI_OPCODE_BGNLOOP 99
#define TGSI_OPCODE_BGNSUB 100
-#define TGSI_OPCODE_ENDLOOP2 101
+#define TGSI_OPCODE_ENDLOOP 101
#define TGSI_OPCODE_ENDSUB 102
-/*#define TGSI_OPCODE_INT TGSI_OPCODE_TRUNC*/
#define TGSI_OPCODE_NOISE1 103
#define TGSI_OPCODE_NOISE2 104
#define TGSI_OPCODE_NOISE3 105
#define TGSI_OPCODE_NOISE4 106
#define TGSI_OPCODE_NOP 107
-
-/*
- * ps_1_1
- */
-/*#define TGSI_OPCODE_TEXKILL TGSI_OPCODE_KIL*/
-
-/*
- * ps_1_2
- */
-/* CMP - use TGSI_OPCODE_CND0 */
-
-/*
- * ps_1_3
- */
-/* CMP - use TGSI_OPCODE_CND0 */
-
-/*
- * ps_1_4
- */
-/*#define TGSI_OPCODE_TEXLD TGSI_OPCODE_TEX*/
-
-/*
- * ps_2_0
- */
-/*#define TGSI_OPCODE_M4X4 TGSI_OPCODE_MULTIPLYMATRIX*/
-#define TGSI_OPCODE_M4X3 108
-#define TGSI_OPCODE_M3X4 109
-#define TGSI_OPCODE_M3X3 110
-#define TGSI_OPCODE_M3X2 111
-/*#define TGSI_OPCODE_CRS TGSI_OPCODE_XPD*/
+ /* gap */
#define TGSI_OPCODE_NRM4 112
-/*#define TGSI_OPCODE_SINCOS TGSI_OPCODE_SCS*/
-/*#define TGSI_OPCODE_TEXLDB TGSI_OPCODE_TXB*/
-/*#define TGSI_OPCODE_DP2ADD TGSI_OPCODE_DP2A*/
-
-/*
- * ps_2_x
- */
-/*#define TGSI_OPCODE_CALL TGSI_OPCODE_CAL*/
#define TGSI_OPCODE_CALLNZ 113
#define TGSI_OPCODE_IFC 114
-/*#define TGSI_OPCODE_BREAK TGSI_OPCODE_BRK*/
#define TGSI_OPCODE_BREAKC 115
-/*#define TGSI_OPCODE_DSX TGSI_OPCODE_DDX*/
-/*#define TGSI_OPCODE_DSY TGSI_OPCODE_DDY*/
-/*#define TGSI_OPCODE_TEXLDD TGSI_OPCODE_TXD*/
-
-/*
- * vs_1_1
- */
-/*#define TGSI_OPCODE_EXPP TGSI_OPCODE_EXP*/
-/*#define TGSI_OPCODE_LOGP TGSI_OPCODE_LG2*/
-
-/*
- * vs_2_0
- */
-/*#define TGSI_OPCODE_SGN TGSI_OPCODE_SSG*/
-/*#define TGSI_OPCODE_MOVA TGSI_OPCODE_ARR*/
-/* EXPP - use TGSI_OPCODE_EX2 */
-
-/*
- * vs_2_x
- */
-
+#define TGSI_OPCODE_KIL 116 /* conditional kill */
#define TGSI_OPCODE_END 117 /* aka HALT */
-
+#define TGSI_OPCODE_SWZ 118
#define TGSI_OPCODE_LAST 119
#define TGSI_SAT_NONE 0 /* do not saturate */
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 626bedb35a..b59d6b7ae3 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -114,11 +114,29 @@ struct pipe_rasterizer_state
* the vertex shader, clipping and viewport processing. Note that
* a vertex shader is still needed though, to indicate the mapping
* from vertex elements to fragment shader input semantics.
+ *
+ * XXX: considered for removal.
*/
unsigned bypass_vs_clip_and_viewport:1;
- unsigned flatshade_first:1; /**< take color attribute from the first vertex of a primitive */
- unsigned gl_rasterization_rules:1; /**< enable tweaks for GL rasterization? */
+ /**
+ * Use the first vertex of a primitive as the provoking vertex for
+ * flat shading.
+ */
+ unsigned flatshade_first:1;
+
+ /**
+ * When true, triangle rasterization uses (0.5, 0.5) pixel centers
+ * for determining pixel ownership.
+ *
+ * When false, triangle rasterization uses (0,0) pixel centers for
+ * determining pixel ownership.
+ *
+ * Triangle rasterization always uses a 'top,left' rule for pixel
+ * ownership, this just alters which point we consider the pixel
+ * center for that test.
+ */
+ unsigned gl_rasterization_rules:1;
float line_width;
float point_size; /**< used when no per-vertex size */
@@ -307,7 +325,7 @@ struct pipe_transfer
unsigned nblocksx; /**< allocated width in blocks */
unsigned nblocksy; /**< allocated height in blocks */
unsigned stride; /**< stride in bytes between rows of blocks */
- unsigned usage; /**< PIPE_TRANSFER_* */
+ enum pipe_transfer_usage usage; /**< PIPE_TRANSFER_* */
struct pipe_texture *texture; /**< texture to transfer to/from */
unsigned face;
diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index 96e8e08744..25e4148232 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -39,7 +39,7 @@
#include "util/u_debug.h" /* for assert */
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
#include <pthread.h> /* POSIX threads headers */
#include <stdio.h> /* for perror() */
@@ -213,7 +213,7 @@ typedef unsigned pipe_condvar;
*/
typedef struct {
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
pthread_key_t key;
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
DWORD key;
@@ -228,7 +228,7 @@ typedef struct {
static INLINE void
pipe_tsd_init(pipe_tsd *tsd)
{
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror("pthread_key_create(): failed to allocate key for thread specific data");
exit(-1);
@@ -245,7 +245,7 @@ pipe_tsd_get(pipe_tsd *tsd)
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
return pthread_getspecific(tsd->key);
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
assert(0);
@@ -262,7 +262,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) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
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 7a38b508fb..4d1259e1ee 100644
--- a/src/gallium/include/state_tracker/drm_api.h
+++ b/src/gallium/include/state_tracker/drm_api.h
@@ -42,21 +42,22 @@ struct drm_api
* Special buffer functions
*/
/*@{*/
- boolean (*buffer_from_texture)(struct drm_api *api,
- struct pipe_texture *texture,
- struct pipe_buffer **buffer,
- unsigned *stride);
- struct pipe_buffer* (*buffer_from_handle)(struct drm_api *api,
- struct pipe_screen *screen,
- const char *name,
- unsigned handle);
- boolean (*handle_from_buffer)(struct drm_api *api,
- struct pipe_screen *screen,
- struct pipe_buffer *buffer,
- unsigned *handle);
- boolean (*global_handle_from_buffer)(struct drm_api *api,
+ struct pipe_texture*
+ (*texture_from_shared_handle)(struct drm_api *api,
+ struct pipe_screen *screen,
+ struct pipe_texture *templ,
+ const char *name,
+ unsigned stride,
+ unsigned handle);
+ boolean (*shared_handle_from_texture)(struct drm_api *api,
+ struct pipe_screen *screen,
+ struct pipe_texture *texture,
+ unsigned *stride,
+ unsigned *handle);
+ boolean (*local_handle_from_texture)(struct drm_api *api,
struct pipe_screen *screen,
- struct pipe_buffer *buffer,
+ struct pipe_texture *texture,
+ unsigned *stride,
unsigned *handle);
/*@}*/