diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-09-22 02:09:17 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-09-22 02:09:17 +0000 |
commit | 865c23c9c56f47f6cf8d73e8a6060a0c33a28b93 (patch) | |
tree | aeed22bc39ce87dd6f09ff173c8273beaef65fe7 /lib/mesa/src/gallium/drivers/vc4 | |
parent | 27e7bb02bd0f89f96d9e3b402b46c2c97ee4defe (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/vc4')
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_blit.c | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.c | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.h | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_draw.c | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_blend.c | 14 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_register_allocate.c | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_screen.c | 20 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_screen.h | 2 |
8 files changed, 35 insertions, 15 deletions
diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_blit.c b/lib/mesa/src/gallium/drivers/vc4/vc4_blit.c index 4e4c4898e..93b1478dd 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_blit.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_blit.c @@ -165,8 +165,6 @@ vc4_tile_blit(struct pipe_context *pctx, const struct pipe_blit_info *info) void vc4_blitter_save(struct vc4_context *vc4) { - util_blitter_save_fragment_constant_buffer_slot(vc4->blitter, - vc4->constbuf[PIPE_SHADER_FRAGMENT].cb); util_blitter_save_vertex_buffer_slot(vc4->blitter, vc4->vertexbuf.vb); util_blitter_save_vertex_elements(vc4->blitter, vc4->vtx); util_blitter_save_vertex_shader(vc4->blitter, vc4->prog.bind_vs); diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.c b/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.c index a786e8ee9..206b1e98f 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.c @@ -100,7 +100,7 @@ vc4_bo_dump_stats(struct vc4_screen *screen) struct timespec time; clock_gettime(CLOCK_MONOTONIC, &time); fprintf(stderr, " now: %ld\n", - (long)time.tv_sec); + time.tv_sec); } } @@ -405,7 +405,7 @@ vc4_bo_open_handle(struct vc4_screen *screen, bo->map = malloc(bo->size); #endif - _mesa_hash_table_insert(screen->bo_handles, (void *)(uintptr_t)handle, bo); + util_hash_table_set(screen->bo_handles, (void *)(uintptr_t)handle, bo); done: mtx_unlock(&screen->bo_handles_mutex); @@ -463,7 +463,7 @@ vc4_bo_get_dmabuf(struct vc4_bo *bo) mtx_lock(&bo->screen->bo_handles_mutex); bo->private = false; - _mesa_hash_table_insert(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo); + util_hash_table_set(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo); mtx_unlock(&bo->screen->bo_handles_mutex); return fd; diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.h b/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.h index 26378cb48..30a388ee5 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.h +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_bufmgr.h @@ -102,7 +102,7 @@ vc4_bo_unreference(struct vc4_bo **bo) if (pipe_reference_described(&(*bo)->reference, NULL, (debug_reference_descriptor) vc4_bo_debug_describe)) { - _mesa_hash_table_remove_key(screen->bo_handles, + util_hash_table_remove(screen->bo_handles, (void *)(uintptr_t)(*bo)->handle); vc4_bo_last_unreference(*bo); } diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_draw.c b/lib/mesa/src/gallium/drivers/vc4/vc4_draw.c index b4523bb12..3da60ff64 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_draw.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_draw.c @@ -517,7 +517,7 @@ pack_rgba(enum pipe_format format, const float *rgba) } static void -vc4_clear(struct pipe_context *pctx, unsigned buffers, const struct pipe_scissor_state *scissor_state, +vc4_clear(struct pipe_context *pctx, unsigned buffers, const union pipe_color_union *color, double depth, unsigned stencil) { struct vc4_context *vc4 = vc4_context(pctx); diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_blend.c b/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_blend.c index c915b8c50..32991ac78 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_blend.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_blend.c @@ -512,6 +512,17 @@ vc4_nir_blend_pipeline(struct vc4_compile *c, nir_builder *b, nir_ssa_def *src, nir_imm_int(b, ~colormask))); } +static int +vc4_nir_next_output_driver_location(nir_shader *s) +{ + int maxloc = -1; + + nir_foreach_variable(var, &s->outputs) + maxloc = MAX2(maxloc, (int)var->data.driver_location); + + return maxloc + 1; +} + static void vc4_nir_store_sample_mask(struct vc4_compile *c, nir_builder *b, nir_ssa_def *val) @@ -519,7 +530,8 @@ vc4_nir_store_sample_mask(struct vc4_compile *c, nir_builder *b, nir_variable *sample_mask = nir_variable_create(c->s, nir_var_shader_out, glsl_uint_type(), "sample_mask"); - sample_mask->data.driver_location = c->s->num_outputs++; + sample_mask->data.driver_location = + vc4_nir_next_output_driver_location(c->s); sample_mask->data.location = FRAG_RESULT_SAMPLE_MASK; nir_intrinsic_instr *intr = diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_register_allocate.c b/lib/mesa/src/gallium/drivers/vc4/vc4_register_allocate.c index 53faf1ae7..1d860ea05 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_register_allocate.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_register_allocate.c @@ -208,7 +208,7 @@ struct vc4_ra_select_callback_data { }; static unsigned int -vc4_ra_select_callback(unsigned int n, BITSET_WORD *regs, void *data) +vc4_ra_select_callback(struct ra_graph *g, BITSET_WORD *regs, void *data) { struct vc4_ra_select_callback_data *vc4_ra = data; diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_screen.c b/lib/mesa/src/gallium/drivers/vc4/vc4_screen.c index faa36c722..2be0b6c3f 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_screen.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_screen.c @@ -102,7 +102,7 @@ vc4_screen_destroy(struct pipe_screen *pscreen) { struct vc4_screen *screen = vc4_screen(pscreen); - _mesa_hash_table_destroy(screen->bo_handles, NULL); + util_hash_table_destroy(screen->bo_handles); vc4_bufmgr_destroy(pscreen); slab_destroy_parent(&screen->transfer_pool); free(screen->ro); @@ -412,7 +412,6 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, int *count) { int m, i; - bool tex_will_lower; uint64_t available_modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, DRM_FORMAT_MOD_LINEAR, @@ -427,7 +426,6 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, *count = MIN2(max, num_modifiers); m = screen->has_tiling_ioctl ? 0 : 1; - tex_will_lower = !vc4_tex_format_supported(format); /* We support both modifiers (tiled and linear) for all sampler * formats, but if we don't have the DRM_VC4_GET_TILING ioctl * we shouldn't advertise the tiled formats. @@ -435,10 +433,22 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, for (i = 0; i < *count; i++) { modifiers[i] = available_modifiers[m++]; if (external_only) - external_only[i] = tex_will_lower; + external_only[i] = false; } } +#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) + +static unsigned handle_hash(void *key) +{ + return PTR_TO_UINT(key); +} + +static int handle_compare(void *key1, void *key2) +{ + return PTR_TO_UINT(key1) != PTR_TO_UINT(key2); +} + static bool vc4_get_chip_info(struct vc4_screen *screen) { @@ -515,7 +525,7 @@ vc4_screen_create(int fd, struct renderonly *ro) list_inithead(&screen->bo_cache.time_list); (void) mtx_init(&screen->bo_handles_mutex, mtx_plain); - screen->bo_handles = util_hash_table_create_ptr_keys(); + screen->bo_handles = util_hash_table_create(handle_hash, handle_compare); screen->has_control_flow = vc4_has_feature(screen, DRM_VC4_PARAM_SUPPORTS_BRANCHES); diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_screen.h b/lib/mesa/src/gallium/drivers/vc4/vc4_screen.h index fa4becd8a..f4550d1c2 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_screen.h +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_screen.h @@ -87,7 +87,7 @@ struct vc4_screen { uint32_t bo_count; } bo_cache; - struct hash_table *bo_handles; + struct util_hash_table *bo_handles; mtx_t bo_handles_mutex; uint32_t bo_size; |