summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/r600/r600_state_common.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 02:09:17 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 02:09:17 +0000
commit865c23c9c56f47f6cf8d73e8a6060a0c33a28b93 (patch)
treeaeed22bc39ce87dd6f09ff173c8273beaef65fe7 /lib/mesa/src/gallium/drivers/r600/r600_state_common.c
parent27e7bb02bd0f89f96d9e3b402b46c2c97ee4defe (diff)
Merge Mesa 20.0.8
With Mesa 20.1 even after the kernel change to do wbinvd on all cpus sthen@ reported that hard hangs still occurred on his Haswell system with inteldrm. Mark Kane also reported seeing hangs on Ivy Bridge on bugs@. Some systems/workloads seem to be more prone to triggering this than others as I have not seen any hangs on Ivy Bridge and the only hangs I saw on Haswell when running piglit went away with the wbinvd change. It seems something is wrong with drm memory attributes or coherency in the kernel and newer Mesa versions expect behaviour we don't have.
Diffstat (limited to 'lib/mesa/src/gallium/drivers/r600/r600_state_common.c')
-rw-r--r--lib/mesa/src/gallium/drivers/r600/r600_state_common.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/lib/mesa/src/gallium/drivers/r600/r600_state_common.c b/lib/mesa/src/gallium/drivers/r600/r600_state_common.c
index 76dd93141..4718286bd 100644
--- a/lib/mesa/src/gallium/drivers/r600/r600_state_common.c
+++ b/lib/mesa/src/gallium/drivers/r600/r600_state_common.c
@@ -37,10 +37,6 @@
#include "tgsi/tgsi_scan.h"
#include "tgsi/tgsi_ureg.h"
-#include "nir.h"
-#include "nir/nir_to_tgsi_info.h"
-#include "tgsi/tgsi_from_mesa.h"
-
void r600_init_command_buffer(struct r600_command_buffer *cb, unsigned num_dw)
{
assert(!cb->buf);
@@ -910,19 +906,14 @@ int r600_shader_select(struct pipe_context *ctx,
}
struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_context *ctx,
- const void *prog, enum pipe_shader_ir ir,
+ const struct tgsi_token *tokens,
unsigned pipe_shader_type)
{
struct r600_pipe_shader_selector *sel = CALLOC_STRUCT(r600_pipe_shader_selector);
sel->type = pipe_shader_type;
- if (ir == PIPE_SHADER_IR_TGSI) {
- sel->tokens = tgsi_dup_tokens((const struct tgsi_token *)prog);
- tgsi_scan_shader(sel->tokens, &sel->info);
- } else if (ir == PIPE_SHADER_IR_NIR){
- sel->nir = nir_shader_clone(NULL, (const nir_shader *)prog);
- nir_tgsi_scan_shader(sel->nir, &sel->info, true);
- }
+ sel->tokens = tgsi_dup_tokens(tokens);
+ tgsi_scan_shader(tokens, &sel->info);
return sel;
}
@@ -931,16 +922,8 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
unsigned pipe_shader_type)
{
int i;
- struct r600_pipe_shader_selector *sel;
-
- if (state->type == PIPE_SHADER_IR_TGSI)
- sel = r600_create_shader_state_tokens(ctx, state->tokens, state->type, pipe_shader_type);
- else if (state->type == PIPE_SHADER_IR_NIR) {
- sel = r600_create_shader_state_tokens(ctx, state->ir.nir, state->type, pipe_shader_type);
- } else
- assert(0 && "Unknown shader type\n");
-
- sel->ir_type = state->type;
+ struct r600_pipe_shader_selector *sel = r600_create_shader_state_tokens(ctx, state->tokens, pipe_shader_type);
+
sel->so = state->stream_output;
switch (pipe_shader_type) {
@@ -956,7 +939,6 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
case PIPE_SHADER_TESS_CTRL:
sel->lds_patch_outputs_written_mask = 0;
sel->lds_outputs_written_mask = 0;
- bool texxcoord_semantic = ctx->screen->get_param(ctx->screen, PIPE_CAP_TGSI_TEXCOORD);
for (i = 0; i < sel->info.num_outputs; i++) {
unsigned name = sel->info.output_semantic_name[i];
@@ -967,11 +949,11 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
case TGSI_SEMANTIC_TESSOUTER:
case TGSI_SEMANTIC_PATCH:
sel->lds_patch_outputs_written_mask |=
- 1ull << r600_get_lds_unique_index(name, index, texxcoord_semantic);
+ 1ull << r600_get_lds_unique_index(name, index);
break;
default:
sel->lds_outputs_written_mask |=
- 1ull << r600_get_lds_unique_index(name, index, texxcoord_semantic);
+ 1ull << r600_get_lds_unique_index(name, index);
}
}
break;
@@ -1100,14 +1082,7 @@ void r600_delete_shader_selector(struct pipe_context *ctx,
p = c;
}
- if (sel->ir_type == PIPE_SHADER_IR_TGSI) {
- free(sel->tokens);
- /* We might have converted the TGSI shader to a NIR shader */
- if (sel->nir)
- ralloc_free(sel->nir);
- }
- else if (sel->ir_type == PIPE_SHADER_IR_NIR)
- ralloc_free(sel->nir);
+ free(sel->tokens);
free(sel);
}