summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-01-24 01:07:58 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-01-24 01:07:58 +0000
commit3fce1b3d241bfc89eaf38612d3a9ea7e8207d0eb (patch)
tree8ce841449b87cbdf4115527493b0459b2253f35e /lib/mesa/src/gallium
parentbe0545197373e5331df04aed2a7b42ce7c71c70c (diff)
Import Mesa 11.0.9
Diffstat (limited to 'lib/mesa/src/gallium')
-rw-r--r--lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_pack.c31
-rw-r--r--lib/mesa/src/gallium/drivers/freedreno/ir3/ir3_print.c2
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp3
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nv50/nv50_vbo.c2
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c4
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c6
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_query.c1
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c1
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c2
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c7
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video.c7
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c4
-rw-r--r--lib/mesa/src/gallium/drivers/r600/evergreen_state.c2
-rw-r--r--lib/mesa/src/gallium/drivers/r600/r600_state.c2
-rw-r--r--lib/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c5
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_state_shaders.c9
16 files changed, 51 insertions, 37 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_pack.c b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_pack.c
index cdf6d80c2..0b0f7f014 100644
--- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_pack.c
+++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_pack.c
@@ -461,50 +461,49 @@ lp_build_pack2(struct gallivm_state *gallivm,
assert(src_type.length * 2 == dst_type.length);
/* Check for special cases first */
- if((util_cpu_caps.has_sse2 || util_cpu_caps.has_altivec) &&
- src_type.width * src_type.length >= 128) {
+ if ((util_cpu_caps.has_sse2 || util_cpu_caps.has_altivec) &&
+ src_type.width * src_type.length >= 128) {
const char *intrinsic = NULL;
boolean swap_intrinsic_operands = FALSE;
switch(src_type.width) {
case 32:
if (util_cpu_caps.has_sse2) {
- if(dst_type.sign) {
+ if (dst_type.sign) {
intrinsic = "llvm.x86.sse2.packssdw.128";
- }
- else {
+ } else {
if (util_cpu_caps.has_sse4_1) {
intrinsic = "llvm.x86.sse41.packusdw";
}
}
} else if (util_cpu_caps.has_altivec) {
if (dst_type.sign) {
- intrinsic = "llvm.ppc.altivec.vpkswus";
- } else {
- intrinsic = "llvm.ppc.altivec.vpkuwus";
- }
+ intrinsic = "llvm.ppc.altivec.vpkswss";
+ } else {
+ intrinsic = "llvm.ppc.altivec.vpkuwus";
+ }
#ifdef PIPE_ARCH_LITTLE_ENDIAN
- swap_intrinsic_operands = TRUE;
+ swap_intrinsic_operands = TRUE;
#endif
}
break;
case 16:
if (dst_type.sign) {
if (util_cpu_caps.has_sse2) {
- intrinsic = "llvm.x86.sse2.packsswb.128";
+ intrinsic = "llvm.x86.sse2.packsswb.128";
} else if (util_cpu_caps.has_altivec) {
- intrinsic = "llvm.ppc.altivec.vpkshss";
+ intrinsic = "llvm.ppc.altivec.vpkshss";
#ifdef PIPE_ARCH_LITTLE_ENDIAN
- swap_intrinsic_operands = TRUE;
+ swap_intrinsic_operands = TRUE;
#endif
}
} else {
if (util_cpu_caps.has_sse2) {
- intrinsic = "llvm.x86.sse2.packuswb.128";
+ intrinsic = "llvm.x86.sse2.packuswb.128";
} else if (util_cpu_caps.has_altivec) {
- intrinsic = "llvm.ppc.altivec.vpkshus";
+ intrinsic = "llvm.ppc.altivec.vpkshus";
#ifdef PIPE_ARCH_LITTLE_ENDIAN
- swap_intrinsic_operands = TRUE;
+ swap_intrinsic_operands = TRUE;
#endif
}
}
diff --git a/lib/mesa/src/gallium/drivers/freedreno/ir3/ir3_print.c b/lib/mesa/src/gallium/drivers/freedreno/ir3/ir3_print.c
index 07e03d269..a84e7989c 100644
--- a/lib/mesa/src/gallium/drivers/freedreno/ir3/ir3_print.c
+++ b/lib/mesa/src/gallium/drivers/freedreno/ir3/ir3_print.c
@@ -143,7 +143,7 @@ block_id(struct ir3_block *block)
#ifdef DEBUG
return block->serialno;
#else
- return (uint32_t)(uint64_t)block;
+ return (uint32_t)(unsigned long)block;
#endif
}
diff --git a/lib/mesa/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/lib/mesa/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 13f36d0cf..7e5240936 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/lib/mesa/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1664,6 +1664,9 @@ AlgebraicOpt::handleCVT_EXTBF(Instruction *cvt)
arg = shift->getSrc(0);
offset = imm.reg.data.u32;
}
+ // We just AND'd the high bits away, which means this is effectively an
+ // unsigned value.
+ cvt->sType = TYPE_U32;
} else if (insn->op == OP_SHR &&
insn->sType == cvt->sType &&
insn->src(1).getImmediate(imm)) {
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/lib/mesa/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
index f5f47087b..829e05d74 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
@@ -641,8 +641,8 @@ nv50_draw_elements(struct nv50_context *nv50, bool shorten,
BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
PUSH_DATA (push, prim);
- PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
nouveau_pushbuf_space(push, 8, 0, 1);
+ PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
switch (index_size) {
case 4:
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c b/lib/mesa/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
index 6058c2213..7668cc025 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
@@ -77,7 +77,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
bsp_size += (1 << 20) - 1;
bsp_size &= ~((1 << 20) - 1);
- ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_size, NULL, &tmp_bo);
+ ret = nouveau_bo_new(dec->client->device, NOUVEAU_BO_VRAM, 0, bsp_size, NULL, &tmp_bo);
if (ret) {
debug_printf("reallocating bsp %u -> %u failed with %i\n",
bsp_bo ? (unsigned)bsp_bo->size : 0, bsp_size, ret);
@@ -90,7 +90,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
if (!inter_bo || bsp_bo->size * 4 > inter_bo->size) {
struct nouveau_bo *tmp_bo = NULL;
- ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, NULL, &tmp_bo);
+ ret = nouveau_bo_new(dec->client->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, NULL, &tmp_bo);
if (ret) {
debug_printf("reallocating inter %u -> %u failed with %i\n",
inter_bo ? (unsigned)inter_bo->size : 0, (unsigned)bsp_bo->size * 4, ret);
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
index a168dd684..4490d2886 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
@@ -287,8 +287,6 @@ nvc0_tp_get_tess_mode(struct nvc0_program *tp, struct nv50_ir_prog_info *info)
break;
case PIPE_PRIM_TRIANGLES:
tp->tp.tess_mode = NVC0_3D_TESS_MODE_PRIM_TRIANGLES;
- if (info->prop.tp.winding > 0)
- tp->tp.tess_mode |= NVC0_3D_TESS_MODE_CW;
break;
case PIPE_PRIM_QUADS:
tp->tp.tess_mode = NVC0_3D_TESS_MODE_PRIM_QUADS;
@@ -297,6 +295,10 @@ nvc0_tp_get_tess_mode(struct nvc0_program *tp, struct nv50_ir_prog_info *info)
tp->tp.tess_mode = ~0;
return;
}
+
+ if (info->prop.tp.winding > 0)
+ tp->tp.tess_mode |= NVC0_3D_TESS_MODE_CW;
+
if (info->prop.tp.outputPrim != PIPE_PRIM_POINTS)
tp->tp.tess_mode |= NVC0_3D_TESS_MODE_CONNECTED;
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index f7b85a8e9..b6f7caa4d 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -618,7 +618,6 @@ nvc0_query_pushbuf_submit(struct nouveau_pushbuf *push,
#define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8))
PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART);
- nouveau_pushbuf_space(push, 0, 0, 1);
nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 |
NVC0_IB_ENTRY_1_NO_PREFETCH);
}
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
index 8f8ac2d34..ecea96011 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
@@ -273,6 +273,7 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
if (!targ->clean)
nvc0_query_fifo_wait(push, targ->pq);
+ nouveau_pushbuf_space(push, 0, 0, 1);
BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
PUSH_DATA (push, 1);
PUSH_DATAh(push, buf->address + targ->pipe.buffer_offset);
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index dbdf292c8..5f21db27e 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -1006,9 +1006,11 @@ nvc0_blitctx_post_blit(struct nvc0_blitctx *blit)
nvc0->base.pipe.render_condition(&nvc0->base.pipe, nvc0->cond_query,
nvc0->cond_cond, nvc0->cond_mode);
+ nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX_TMP);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(4, 0));
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(4, 1));
+ nouveau_scratch_done(&nvc0->base);
nvc0->dirty = blit->saved.dirty |
(NVC0_NEW_FRAMEBUFFER | NVC0_NEW_SCISSOR | NVC0_NEW_SAMPLE_MASK |
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index 188c7d7cd..5b6c6e50a 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -783,7 +783,7 @@ nvc0_draw_stream_output(struct nvc0_context *nvc0,
}
while (num_instances--) {
- PUSH_SPACE(push, 8);
+ nouveau_pushbuf_space(push, 9, 0, 1);
BEGIN_NVC0(push, NVC0_3D(VERTEX_BEGIN_GL), 1);
PUSH_DATA (push, mode);
BEGIN_NVC0(push, NVC0_3D(DRAW_TFB_BASE), 1);
@@ -810,7 +810,8 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
if (buf->fence_wr && !nouveau_fence_signalled(buf->fence_wr))
IMMED_NVC0(push, SUBC_3D(NV10_SUBCHAN_REF_CNT), 0);
- PUSH_SPACE(push, 8);
+ nouveau_pushbuf_space(push, 8, 0, 1);
+ PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
if (info->indexed) {
assert(nvc0->idxbuf.buffer);
assert(nouveau_resource_mapped_by_gpu(nvc0->idxbuf.buffer));
@@ -828,8 +829,6 @@ nvc0_draw_indirect(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
}
PUSH_DATA(push, nvc0_prim_gl(info->mode));
#define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8))
- PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
- nouveau_pushbuf_space(push, 0, 0, 1);
nouveau_pushbuf_data(push,
buf->bo, offset, NVC0_IB_ENTRY_1_NO_PREFETCH | size);
}
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
index 48ffac1b7..5a946ca63 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
@@ -169,9 +169,12 @@ nvc0_create_decoder(struct pipe_context *context,
for (i = 0; i < NOUVEAU_VP3_VIDEO_QDEPTH && !ret; ++i)
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
0, 1 << 20, &cfg, &dec->bsp_bo[i]);
- if (!ret)
+ if (!ret) {
+ /* total fudge factor... just has to be bigger for higher bitrates? */
+ unsigned inter_size = align(templ->width * templ->height * 2, 4 << 20);
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
- 0x100, 4 << 20, &cfg, &dec->inter_bo[0]);
+ 0x100, inter_size, &cfg, &dec->inter_bo[0]);
+ }
if (!ret) {
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
0x100, dec->inter_bo[0]->size, &cfg,
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
index 9139bc1c9..8c9662b46 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
@@ -81,7 +81,7 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
bsp_size += (1 << 20) - 1;
bsp_size &= ~((1 << 20) - 1);
- ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_size, &cfg, &tmp_bo);
+ ret = nouveau_bo_new(dec->client->device, NOUVEAU_BO_VRAM, 0, bsp_size, &cfg, &tmp_bo);
if (ret) {
debug_printf("reallocating bsp %u -> %u failed with %i\n",
bsp_bo ? (unsigned)bsp_bo->size : 0, bsp_size, ret);
@@ -98,7 +98,7 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
cfg.nvc0.tile_mode = 0x10;
cfg.nvc0.memtype = 0xfe;
- ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, &cfg, &tmp_bo);
+ ret = nouveau_bo_new(dec->client->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, &cfg, &tmp_bo);
if (ret) {
debug_printf("reallocating inter %u -> %u failed with %i\n",
inter_bo ? (unsigned)inter_bo->size : 0, (unsigned)bsp_bo->size * 4, ret);
diff --git a/lib/mesa/src/gallium/drivers/r600/evergreen_state.c b/lib/mesa/src/gallium/drivers/r600/evergreen_state.c
index 1976d873f..9eb75233c 100644
--- a/lib/mesa/src/gallium/drivers/r600/evergreen_state.c
+++ b/lib/mesa/src/gallium/drivers/r600/evergreen_state.c
@@ -1916,7 +1916,7 @@ static void evergreen_emit_constant_buffers(struct r600_context *rctx,
if (!gs_ring_buffer) {
r600_write_context_reg_flag(cs, reg_alu_constbuf_size + buffer_index * 4,
- ALIGN_DIVUP(cb->buffer_size >> 4, 16), pkt_flags);
+ ALIGN_DIVUP(cb->buffer_size, 256), pkt_flags);
r600_write_context_reg_flag(cs, reg_alu_const_cache + buffer_index * 4, va >> 8,
pkt_flags);
}
diff --git a/lib/mesa/src/gallium/drivers/r600/r600_state.c b/lib/mesa/src/gallium/drivers/r600/r600_state.c
index a588e16e5..3460925b7 100644
--- a/lib/mesa/src/gallium/drivers/r600/r600_state.c
+++ b/lib/mesa/src/gallium/drivers/r600/r600_state.c
@@ -1732,7 +1732,7 @@ static void r600_emit_constant_buffers(struct r600_context *rctx,
if (!gs_ring_buffer) {
r600_write_context_reg(cs, reg_alu_constbuf_size + buffer_index * 4,
- ALIGN_DIVUP(cb->buffer_size >> 4, 16));
+ ALIGN_DIVUP(cb->buffer_size, 256));
r600_write_context_reg(cs, reg_alu_const_cache + buffer_index * 4, offset >> 8);
}
diff --git a/lib/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c b/lib/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c
index 1a66a55ee..2008799db 100644
--- a/lib/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c
+++ b/lib/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c
@@ -194,8 +194,8 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
if (mem_err) {
fprintf(stderr, "%s: %s", __FUNCTION__, err);
FREE(err);
- LLVMDisposeTargetMachine(tm);
- return 1;
+ rval = 1;
+ goto out;
}
if (0 != rval) {
@@ -211,6 +211,7 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
/* Clean up */
LLVMDisposeMemoryBuffer(out_buffer);
+out:
if (dispose_tm) {
LLVMDisposeTargetMachine(tm);
}
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_state_shaders.c b/lib/mesa/src/gallium/drivers/radeonsi/si_state_shaders.c
index 1ba9c8595..5ef2c895e 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1198,6 +1198,7 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
si_get_max_scratch_bytes_per_wave(sctx);
unsigned scratch_needed_size = scratch_bytes_per_wave *
sctx->scratch_waves;
+ unsigned spi_tmpring_size;
int r;
if (scratch_needed_size > 0) {
@@ -1280,8 +1281,12 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
assert((scratch_needed_size & ~0x3FF) == scratch_needed_size &&
"scratch size should already be aligned correctly.");
- sctx->spi_tmpring_size = S_0286E8_WAVES(sctx->scratch_waves) |
- S_0286E8_WAVESIZE(scratch_bytes_per_wave >> 10);
+ spi_tmpring_size = S_0286E8_WAVES(sctx->scratch_waves) |
+ S_0286E8_WAVESIZE(scratch_bytes_per_wave >> 10);
+ if (spi_tmpring_size != sctx->spi_tmpring_size) {
+ sctx->spi_tmpring_size = spi_tmpring_size;
+ sctx->emit_scratch_reloc = true;
+ }
return true;
}