diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-12 20:12:51 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-12 20:23:02 +0000 |
commit | 49374f2155f0c8c80b1c54e968d510d55df49221 (patch) | |
tree | 3e8c3490cd7a3d033e554d067c6c1bec75b89c68 | |
parent | ee0ed88a09bc2f8ebe49b1d7f7e209a73e02fee0 (diff) |
sna/gen4: Tweak compilation flags to avoid mixed settings across functions
Confusing gcc with different flags for supposedly inlined functions is
not a good idea.
References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/compiler.h | 2 | ||||
-rw-r--r-- | src/sna/gen4_vertex.c | 25 | ||||
-rw-r--r-- | src/sna/sna_render_inline.h | 14 |
3 files changed, 13 insertions, 28 deletions
diff --git a/src/sna/compiler.h b/src/sna/compiler.h index 985844df..b5c9ac27 100644 --- a/src/sna/compiler.h +++ b/src/sna/compiler.h @@ -43,7 +43,7 @@ #define likely(expr) (expr) #define unlikely(expr) (expr) #define noinline -#define force_inline +#define force_inline inline #define fastcall #define must_check #define constant diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index 35f772e9..d8425859 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -232,7 +232,7 @@ void gen4_vertex_close(struct sna *sna) #define OUT_VERTEX(x,y) vertex_emit_2s(sna, x,y) /* XXX assert(!too_large(x, y)); */ #define OUT_VERTEX_F(v) vertex_emit(sna, v) -inline static float +force_inline static float compute_linear(const struct sna_composite_channel *channel, int16_t x, int16_t y) { @@ -241,7 +241,7 @@ compute_linear(const struct sna_composite_channel *channel, channel->u.linear.offset); } -inline static void +sse2 inline static void emit_texcoord(struct sna *sna, const struct sna_composite_channel *channel, int16_t x, int16_t y) @@ -274,7 +274,7 @@ emit_texcoord(struct sna *sna, } } -sse2 inline static void +sse2 force_inline static void emit_vertex(struct sna *sna, const struct sna_composite_op *op, int16_t srcX, int16_t srcY, @@ -304,7 +304,7 @@ emit_primitive(struct sna *sna, r->dst.x, r->dst.y); } -sse2 inline static void +sse2 force_inline static void emit_vertex_mask(struct sna *sna, const struct sna_composite_op *op, int16_t srcX, int16_t srcY, @@ -969,21 +969,6 @@ emit_primitive_affine_source_identity(struct sna *sna, v[14] = msk_y * op->mask.scale[1]; } -inline static void -emit_composite_texcoord_affine(struct sna *sna, - const struct sna_composite_channel *channel, - int16_t x, int16_t y) -{ - float t[2]; - - sna_get_transformed_coordinates(x + channel->offset[0], - y + channel->offset[1], - channel->transform, - &t[0], &t[1]); - OUT_VERTEX_F(t[0] * channel->scale[0]); - OUT_VERTEX_F(t[1] * channel->scale[1]); -} - /* SSE4_2 */ #if defined(sse4_2) @@ -1548,7 +1533,7 @@ unsigned gen4_choose_composite_emitter(struct sna *sna, struct sna_composite_op return vb; } -inline static void +sse2 force_inline static void emit_span_vertex(struct sna *sna, const struct sna_composite_spans_op *op, int16_t x, int16_t y) diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h index 7d9f2cac..1a3be2cb 100644 --- a/src/sna/sna_render_inline.h +++ b/src/sna/sna_render_inline.h @@ -17,7 +17,7 @@ static inline bool need_redirect(struct sna *sna, PixmapPtr dst) dst->drawable.height > sna->render.max_3d_size); } -static inline float pack_2s(int16_t x, int16_t y) +static force_inline float pack_2s(int16_t x, int16_t y) { union { struct sna_coordinate p; @@ -28,35 +28,35 @@ static inline float pack_2s(int16_t x, int16_t y) return u.f; } -static inline int vertex_space(struct sna *sna) +static force_inline int vertex_space(struct sna *sna) { return sna->render.vertex_size - sna->render.vertex_used; } -static inline void vertex_emit(struct sna *sna, float v) +static force_inline void vertex_emit(struct sna *sna, float v) { assert(sna->render.vertex_used < sna->render.vertex_size); sna->render.vertices[sna->render.vertex_used++] = v; } -static inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y) +static force_inline void vertex_emit_2s(struct sna *sna, int16_t x, int16_t y) { vertex_emit(sna, pack_2s(x, y)); } -static inline int batch_space(struct sna *sna) +static force_inline int batch_space(struct sna *sna) { assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem)); assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED <= sna->kgem.surface); return sna->kgem.surface - sna->kgem.nbatch - KGEM_BATCH_RESERVED; } -static inline void batch_emit(struct sna *sna, uint32_t dword) +static force_inline void batch_emit(struct sna *sna, uint32_t dword) { assert(sna->kgem.mode != KGEM_NONE); assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED < sna->kgem.surface); sna->kgem.batch[sna->kgem.nbatch++] = dword; } -static inline void batch_emit_float(struct sna *sna, float f) +static force_inline void batch_emit_float(struct sna *sna, float f) { union { uint32_t dw; |