diff options
author | Marek Olšák <[email protected]> | 2018-04-01 19:44:25 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-04-05 15:34:58 -0400 |
commit | 6a93441295c884022daa955059e74befc667510d (patch) | |
tree | a008cc3347781125c13f6e0b326ec5f828e6f244 /src/gallium/drivers/radeonsi/si_state.c | |
parent | 5f77361d2e02ab3c8ec6e2b1710f1c0c257c415c (diff) |
radeonsi: remove r600_common_context
Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 214 |
1 files changed, 107 insertions, 107 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 60eec54eb3c..a33414e0e8d 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -85,7 +85,7 @@ static unsigned si_pack_float_12p4(float x) */ static void si_emit_cb_render_state(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; struct si_state_blend *blend = sctx->queued.named.blend; /* CB_COLORn_INFO.FORMAT=INVALID should disable unbound colorbuffers, * but you never know. */ @@ -119,13 +119,13 @@ static void si_emit_cb_render_state(struct si_context *sctx, struct r600_atom *a radeon_emit(cs, EVENT_TYPE(V_028A90_FLUSH_DFSM) | EVENT_INDEX(0)); } - if (sctx->b.chip_class >= VI) { + if (sctx->chip_class >= VI) { /* DCC MSAA workaround for blending. * Alternatively, we can set CB_COLORi_DCC_CONTROL.OVERWRITE_- * COMBINER_DISABLE, but that would be more complicated. */ - bool oc_disable = (sctx->b.chip_class == VI || - sctx->b.chip_class == GFX9) && + bool oc_disable = (sctx->chip_class == VI || + sctx->chip_class == GFX9) && blend && blend->blend_enable_4bit & cb_target_mask && sctx->framebuffer.nr_samples >= 2; @@ -723,7 +723,7 @@ static void si_set_blend_color(struct pipe_context *ctx, static void si_emit_blend_color(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; radeon_set_context_reg_seq(cs, R_028414_CB_BLEND_RED, 4); radeon_emit_array(cs, (uint32_t*)sctx->blend_color.state.color, 4); @@ -757,7 +757,7 @@ static void si_set_clip_state(struct pipe_context *ctx, static void si_emit_clip_state(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; radeon_set_context_reg_seq(cs, R_0285BC_PA_CL_UCP_0_X, 6*4); radeon_emit_array(cs, (uint32_t*)sctx->clip_state.state.ucp, 6*4); @@ -765,7 +765,7 @@ static void si_emit_clip_state(struct si_context *sctx, struct r600_atom *atom) static void si_emit_clip_regs(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; struct si_shader *vs = si_get_vs_state(sctx); struct si_shader_selector *vs_sel = vs->selector; struct tgsi_shader_info *info = &vs_sel->info; @@ -1079,7 +1079,7 @@ static void si_delete_rs_state(struct pipe_context *ctx, void *state) */ static void si_emit_stencil_ref(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; struct pipe_stencil_ref *ref = &sctx->stencil_ref.state; struct si_dsa_stencil_ref_part *dsa = &sctx->stencil_ref.dsa_part; @@ -1321,7 +1321,7 @@ static void *si_create_db_flush_dsa(struct si_context *sctx) { struct pipe_depth_stencil_alpha_state dsa = {}; - return sctx->b.b.create_depth_stencil_alpha_state(&sctx->b.b, &dsa); + return sctx->b.create_depth_stencil_alpha_state(&sctx->b, &dsa); } /* DB RENDER STATE */ @@ -1332,11 +1332,11 @@ static void si_set_active_query_state(struct pipe_context *ctx, boolean enable) /* Pipeline stat & streamout queries. */ if (enable) { - sctx->b.flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS; - sctx->b.flags |= SI_CONTEXT_START_PIPELINE_STATS; + sctx->flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS; + sctx->flags |= SI_CONTEXT_START_PIPELINE_STATS; } else { - sctx->b.flags &= ~SI_CONTEXT_START_PIPELINE_STATS; - sctx->b.flags |= SI_CONTEXT_STOP_PIPELINE_STATS; + sctx->flags &= ~SI_CONTEXT_START_PIPELINE_STATS; + sctx->flags |= SI_CONTEXT_STOP_PIPELINE_STATS; } /* Occlusion queries. */ @@ -1351,7 +1351,7 @@ void si_set_occlusion_query_state(struct si_context *sctx, { si_mark_atom_dirty(sctx, &sctx->db_render_state); - bool perfect_enable = sctx->b.num_perfect_occlusion_queries != 0; + bool perfect_enable = sctx->num_perfect_occlusion_queries != 0; if (perfect_enable != old_perfect_enable) si_mark_atom_dirty(sctx, &sctx->msaa_config); @@ -1367,7 +1367,7 @@ void si_save_qbo_state(struct si_context *sctx, struct si_qbo_state *st) static void si_emit_db_render_state(struct si_context *sctx, struct r600_atom *state) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; unsigned db_shader_control; @@ -1392,11 +1392,11 @@ static void si_emit_db_render_state(struct si_context *sctx, struct r600_atom *s } /* DB_COUNT_CONTROL (occlusion queries) */ - if (sctx->b.num_occlusion_queries > 0 && + if (sctx->num_occlusion_queries > 0 && !sctx->occlusion_queries_disabled) { - bool perfect = sctx->b.num_perfect_occlusion_queries > 0; + bool perfect = sctx->num_perfect_occlusion_queries > 0; - if (sctx->b.chip_class >= CIK) { + if (sctx->chip_class >= CIK) { radeon_emit(cs, S_028004_PERFECT_ZPASS_COUNTS(perfect) | S_028004_SAMPLE_RATE(sctx->framebuffer.log_samples) | @@ -1410,7 +1410,7 @@ static void si_emit_db_render_state(struct si_context *sctx, struct r600_atom *s } } else { /* Disable occlusion queries. */ - if (sctx->b.chip_class >= CIK) { + if (sctx->chip_class >= CIK) { radeon_emit(cs, 0); } else { radeon_emit(cs, S_028004_ZPASS_INCREMENT_DISABLE(1)); @@ -1426,7 +1426,7 @@ static void si_emit_db_render_state(struct si_context *sctx, struct r600_atom *s db_shader_control = sctx->ps_db_shader_control; /* Bug workaround for smoothing (overrasterization) on SI. */ - if (sctx->b.chip_class == SI && sctx->smoothing_enabled) { + if (sctx->chip_class == SI && sctx->smoothing_enabled) { db_shader_control &= C_02880C_Z_ORDER; db_shader_control |= S_02880C_Z_ORDER(V_02880C_LATE_Z); } @@ -2437,14 +2437,14 @@ static void si_initialize_color_surface(struct si_context *sctx, color_info |= S_028C70_COMPRESSION(1); unsigned fmask_bankh = util_logbase2(rtex->fmask.bank_height); - if (sctx->b.chip_class == SI) { + if (sctx->chip_class == SI) { /* due to a hw bug, FMASK_BANK_HEIGHT must be set on SI too */ color_attrib |= S_028C74_FMASK_BANK_HEIGHT(fmask_bankh); } } } - if (sctx->b.chip_class >= VI) { + if (sctx->chip_class >= VI) { unsigned max_uncompressed_block_size = V_028C78_MAX_BLOCK_SIZE_256B; unsigned min_compressed_block_size = V_028C78_MIN_BLOCK_SIZE_32B; @@ -2468,7 +2468,7 @@ static void si_initialize_color_surface(struct si_context *sctx, } /* This must be set for fast clear to work without FMASK. */ - if (!rtex->fmask.size && sctx->b.chip_class == SI) { + if (!rtex->fmask.size && sctx->chip_class == SI) { unsigned bankh = util_logbase2(rtex->surface.u.legacy.bankh); color_attrib |= S_028C74_FMASK_BANK_HEIGHT(bankh); } @@ -2476,7 +2476,7 @@ static void si_initialize_color_surface(struct si_context *sctx, unsigned color_view = S_028C6C_SLICE_START(surf->base.u.tex.first_layer) | S_028C6C_SLICE_MAX(surf->base.u.tex.last_layer); - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { unsigned mip0_depth = util_max_layer(&rtex->resource.b.b, 0); color_view |= S_028C6C_MIP_LEVEL(surf->base.u.tex.level); @@ -2518,7 +2518,7 @@ static void si_init_depth_surface(struct si_context *sctx, surf->db_htile_data_base = 0; surf->db_htile_surface = 0; - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { assert(rtex->surface.u.gfx9.surf_offset == 0); surf->db_depth_base = rtex->resource.gpu_address >> 8; surf->db_stencil_base = (rtex->resource.gpu_address + @@ -2583,7 +2583,7 @@ static void si_init_depth_surface(struct si_context *sctx, s_info = S_028044_FORMAT(stencil_format); surf->db_depth_info = S_02803C_ADDR5_SWIZZLE_MASK(!rtex->tc_compatible_htile); - if (sctx->b.chip_class >= CIK) { + if (sctx->chip_class >= CIK) { struct radeon_info *info = &sctx->screen->info; unsigned index = rtex->surface.u.legacy.tiling_index[level]; unsigned stencil_index = rtex->surface.u.legacy.stencil_tiling_index[level]; @@ -2782,7 +2782,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, si_make_CB_shader_coherent(sctx, sctx->framebuffer.nr_samples, sctx->framebuffer.CB_has_shader_readable_metadata); - sctx->b.flags |= SI_CONTEXT_CS_PARTIAL_FLUSH; + sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH; /* u_blitter doesn't invoke depth decompression when it does multiple * blits in a row, but the only case when it matters for DB is when @@ -2793,14 +2793,14 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, if (sctx->generate_mipmap_for_depth) { si_make_DB_shader_coherent(sctx, 1, false, sctx->framebuffer.DB_has_shader_readable_metadata); - } else if (sctx->b.chip_class == GFX9) { + } else if (sctx->chip_class == GFX9) { /* It appears that DB metadata "leaks" in a sequence of: * - depth clear * - DCC decompress for shader image writes (with DB disabled) * - render with DEPTH_BEFORE_SHADER=1 * Flushing DB metadata works around the problem. */ - sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_DB_META; + sctx->flags |= SI_CONTEXT_FLUSH_AND_INV_DB_META; } /* Take the maximum of the old and new count. If the new count is lower, @@ -2954,7 +2954,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; struct pipe_framebuffer_state *state = &sctx->framebuffer.state; unsigned i, nr_cbufs = state->nr_cbufs; struct r600_texture *tex = NULL; @@ -2977,20 +2977,20 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom } tex = (struct r600_texture *)cb->base.texture; - radeon_add_to_buffer_list(sctx, sctx->b.gfx_cs, + radeon_add_to_buffer_list(sctx, sctx->gfx_cs, &tex->resource, RADEON_USAGE_READWRITE, tex->resource.b.b.nr_samples > 1 ? RADEON_PRIO_COLOR_BUFFER_MSAA : RADEON_PRIO_COLOR_BUFFER); if (tex->cmask_buffer && tex->cmask_buffer != &tex->resource) { - radeon_add_to_buffer_list(sctx, sctx->b.gfx_cs, + radeon_add_to_buffer_list(sctx, sctx->gfx_cs, tex->cmask_buffer, RADEON_USAGE_READWRITE, RADEON_PRIO_CMASK); } if (tex->dcc_separate_buffer) - radeon_add_to_buffer_list(sctx, sctx->b.gfx_cs, + radeon_add_to_buffer_list(sctx, sctx->gfx_cs, tex->dcc_separate_buffer, RADEON_USAGE_READWRITE, RADEON_PRIO_DCC); @@ -3022,7 +3022,7 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom cb_dcc_base |= tex->surface.tile_swizzle; } - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { struct gfx9_surf_meta_flags meta; if (tex->dcc_offset) @@ -3086,20 +3086,20 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom cb_color_slice = S_028C68_TILE_MAX(slice_tile_max); if (tex->fmask.size) { - if (sctx->b.chip_class >= CIK) + if (sctx->chip_class >= CIK) cb_color_pitch |= S_028C64_FMASK_TILE_MAX(tex->fmask.pitch_in_pixels / 8 - 1); cb_color_attrib |= S_028C74_FMASK_TILE_MODE_INDEX(tex->fmask.tile_mode_index); cb_color_fmask_slice = S_028C88_TILE_MAX(tex->fmask.slice_tile_max); } else { /* This must be set for fast clear to work without FMASK. */ - if (sctx->b.chip_class >= CIK) + if (sctx->chip_class >= CIK) cb_color_pitch |= S_028C64_FMASK_TILE_MAX(pitch_tile_max); cb_color_attrib |= S_028C74_FMASK_TILE_MODE_INDEX(tile_mode_index); cb_color_fmask_slice = S_028C88_TILE_MAX(slice_tile_max); } radeon_set_context_reg_seq(cs, R_028C60_CB_COLOR0_BASE + i * 0x3C, - sctx->b.chip_class >= VI ? 14 : 13); + sctx->chip_class >= VI ? 14 : 13); radeon_emit(cs, cb_color_base); /* CB_COLOR0_BASE */ radeon_emit(cs, cb_color_pitch); /* CB_COLOR0_PITCH */ radeon_emit(cs, cb_color_slice); /* CB_COLOR0_SLICE */ @@ -3114,7 +3114,7 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom radeon_emit(cs, tex->color_clear_value[0]); /* CB_COLOR0_CLEAR_WORD0 */ radeon_emit(cs, tex->color_clear_value[1]); /* CB_COLOR0_CLEAR_WORD1 */ - if (sctx->b.chip_class >= VI) /* R_028C94_CB_COLOR0_DCC_BASE */ + if (sctx->chip_class >= VI) /* R_028C94_CB_COLOR0_DCC_BASE */ radeon_emit(cs, cb_dcc_base); } } @@ -3127,13 +3127,13 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom struct r600_surface *zb = (struct r600_surface*)state->zsbuf; struct r600_texture *rtex = (struct r600_texture*)zb->base.texture; - radeon_add_to_buffer_list(sctx, sctx->b.gfx_cs, + radeon_add_to_buffer_list(sctx, sctx->gfx_cs, &rtex->resource, RADEON_USAGE_READWRITE, zb->base.texture->nr_samples > 1 ? RADEON_PRIO_DEPTH_BUFFER_MSAA : RADEON_PRIO_DEPTH_BUFFER); - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { radeon_set_context_reg_seq(cs, R_028014_DB_HTILE_DATA_BASE, 3); radeon_emit(cs, zb->db_htile_data_base); /* DB_HTILE_DATA_BASE */ radeon_emit(cs, S_028018_BASE_HI(zb->db_htile_data_base >> 32)); /* DB_HTILE_DATA_BASE_HI */ @@ -3178,7 +3178,7 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom radeon_set_context_reg(cs, R_028008_DB_DEPTH_VIEW, zb->db_depth_view); radeon_set_context_reg(cs, R_028ABC_DB_HTILE_SURFACE, zb->db_htile_surface); } else if (sctx->framebuffer.dirty_zsbuf) { - if (sctx->b.chip_class >= GFX9) + if (sctx->chip_class >= GFX9) radeon_set_context_reg_seq(cs, R_028038_DB_Z_INFO, 2); else radeon_set_context_reg_seq(cs, R_028040_DB_Z_INFO, 2); @@ -3204,7 +3204,7 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom static void si_emit_msaa_sample_locs(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; unsigned nr_samples = sctx->framebuffer.nr_samples; bool has_msaa_sample_loc_bug = sctx->screen->has_msaa_sample_loc_bug; @@ -3225,12 +3225,12 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx, si_emit_sample_locations(cs, nr_samples); } - if (sctx->b.family >= CHIP_POLARIS10) { + if (sctx->family >= CHIP_POLARIS10) { struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; unsigned small_prim_filter_cntl = S_028830_SMALL_PRIM_FILTER_ENABLE(1) | /* line bug */ - S_028830_LINE_FILTER_DISABLE(sctx->b.family <= CHIP_POLARIS12); + S_028830_LINE_FILTER_DISABLE(sctx->family <= CHIP_POLARIS12); /* The alternative of setting sample locations to 0 would * require a DB flush to avoid Z errors, see @@ -3286,7 +3286,7 @@ static bool si_out_of_order_rasterization(struct si_context *sctx) !dsa_order_invariant.pass_set) return false; - if (sctx->b.num_perfect_occlusion_queries != 0 && + if (sctx->num_perfect_occlusion_queries != 0 && !dsa_order_invariant.pass_set) return false; } @@ -3315,7 +3315,7 @@ static bool si_out_of_order_rasterization(struct si_context *sctx) static void si_emit_msaa_config(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; unsigned num_tile_pipes = sctx->screen->info.num_tile_pipes; /* 33% faster rendering to linear color buffers */ bool dst_is_linear = sctx->framebuffer.any_dst_linear; @@ -3883,7 +3883,7 @@ si_create_sampler_view_custom(struct pipe_context *ctx, height = height0; depth = texture->depth0; - if (sctx->b.chip_class <= VI && force_level) { + if (sctx->chip_class <= VI && force_level) { assert(force_level == first_level && force_level == last_level); base_level = force_level; @@ -4120,7 +4120,7 @@ static void *si_create_sampler_state(struct pipe_context *ctx, S_008F30_ANISO_THRESHOLD(max_aniso_ratio >> 1) | S_008F30_ANISO_BIAS(max_aniso_ratio) | S_008F30_DISABLE_CUBE_WRAP(!state->seamless_cube_map) | - S_008F30_COMPAT_MODE(sctx->b.chip_class >= VI)); + S_008F30_COMPAT_MODE(sctx->chip_class >= VI)); rstate->val[1] = (S_008F34_MIN_LOD(S_FIXED(CLAMP(state->min_lod, 0, 15), 8)) | S_008F34_MAX_LOD(S_FIXED(CLAMP(state->max_lod, 0, 15), 8)) | S_008F34_PERF_MIP(max_aniso_ratio ? max_aniso_ratio + 6 : 0)); @@ -4129,9 +4129,9 @@ static void *si_create_sampler_state(struct pipe_context *ctx, S_008F38_XY_MIN_FILTER(si_tex_filter(state->min_img_filter, max_aniso)) | S_008F38_MIP_FILTER(si_tex_mipfilter(state->min_mip_filter)) | S_008F38_MIP_POINT_PRECLAMP(0) | - S_008F38_DISABLE_LSB_CEIL(sctx->b.chip_class <= VI) | + S_008F38_DISABLE_LSB_CEIL(sctx->chip_class <= VI) | S_008F38_FILTER_PREC_FIX(1) | - S_008F38_ANISO_OVERRIDE(sctx->b.chip_class >= VI)); + S_008F38_ANISO_OVERRIDE(sctx->chip_class >= VI)); rstate->val[3] = si_translate_border_color(sctx, state, &state->border_color, false); /* Create sampler resource for integer textures. */ @@ -4170,7 +4170,7 @@ static void si_set_sample_mask(struct pipe_context *ctx, unsigned sample_mask) static void si_emit_sample_mask(struct si_context *sctx, struct r600_atom *atom) { - struct radeon_winsys_cs *cs = sctx->b.gfx_cs; + struct radeon_winsys_cs *cs = sctx->gfx_cs; unsigned mask = sctx->sample_mask.sample_mask; /* Needed for line and polygon smoothing as well as for the Polaris @@ -4463,11 +4463,11 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags) /* Subsequent commands must wait for all shader invocations to * complete. */ - sctx->b.flags |= SI_CONTEXT_PS_PARTIAL_FLUSH | + sctx->flags |= SI_CONTEXT_PS_PARTIAL_FLUSH | SI_CONTEXT_CS_PARTIAL_FLUSH; if (flags & PIPE_BARRIER_CONSTANT_BUFFER) - sctx->b.flags |= SI_CONTEXT_INV_SMEM_L1 | + sctx->flags |= SI_CONTEXT_INV_SMEM_L1 | SI_CONTEXT_INV_VMEM_L1; if (flags & (PIPE_BARRIER_VERTEX_BUFFER | @@ -4479,7 +4479,7 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags) /* As far as I can tell, L1 contents are written back to L2 * automatically at end of shader, but the contents of other * L1 caches might still be stale. */ - sctx->b.flags |= SI_CONTEXT_INV_VMEM_L1; + sctx->flags |= SI_CONTEXT_INV_VMEM_L1; } if (flags & PIPE_BARRIER_INDEX_BUFFER) { @@ -4487,7 +4487,7 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags) * L1 isn't used. */ if (sctx->screen->info.chip_class <= CIK) - sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; + sctx->flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; } /* MSAA color, any depth and any stencil are flushed in @@ -4495,16 +4495,16 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags) */ if (flags & PIPE_BARRIER_FRAMEBUFFER && sctx->framebuffer.uncompressed_cb_mask) { - sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB; + sctx->flags |= SI_CONTEXT_FLUSH_AND_INV_CB; - if (sctx->b.chip_class <= VI) - sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; + if (sctx->chip_class <= VI) + sctx->flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; } /* Indirect buffers use TC L2 on GFX9, but not older hw. */ if (sctx->screen->info.chip_class <= VI && flags & PIPE_BARRIER_INDIRECT_BUFFER) - sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; + sctx->flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2; } static void *si_create_blend_custom(struct si_context *sctx, unsigned mode) @@ -4514,14 +4514,14 @@ static void *si_create_blend_custom(struct si_context *sctx, unsigned mode) memset(&blend, 0, sizeof(blend)); blend.independent_blend_enable = true; blend.rt[0].colormask = 0xf; - return si_create_blend_state_mode(&sctx->b.b, &blend, mode); + return si_create_blend_state_mode(&sctx->b, &blend, mode); } static void si_init_config(struct si_context *sctx); void si_init_state_functions(struct si_context *sctx) { - si_init_external_atom(sctx, &sctx->b.render_cond_atom, &sctx->atoms.s.render_cond); + si_init_external_atom(sctx, &sctx->render_cond_atom, &sctx->atoms.s.render_cond); si_init_external_atom(sctx, &sctx->streamout.begin_atom, &sctx->atoms.s.streamout_begin); si_init_external_atom(sctx, &sctx->streamout.enable_atom, &sctx->atoms.s.streamout_enable); si_init_external_atom(sctx, &sctx->scissors.atom, &sctx->atoms.s.scissors); @@ -4539,18 +4539,18 @@ void si_init_state_functions(struct si_context *sctx) si_init_atom(sctx, &sctx->clip_state.atom, &sctx->atoms.s.clip_state, si_emit_clip_state); si_init_atom(sctx, &sctx->stencil_ref.atom, &sctx->atoms.s.stencil_ref, si_emit_stencil_ref); - sctx->b.b.create_blend_state = si_create_blend_state; - sctx->b.b.bind_blend_state = si_bind_blend_state; - sctx->b.b.delete_blend_state = si_delete_blend_state; - sctx->b.b.set_blend_color = si_set_blend_color; + sctx->b.create_blend_state = si_create_blend_state; + sctx->b.bind_blend_state = si_bind_blend_state; + sctx->b.delete_blend_state = si_delete_blend_state; + sctx->b.set_blend_color = si_set_blend_color; - sctx->b.b.create_rasterizer_state = si_create_rs_state; - sctx->b.b.bind_rasterizer_state = si_bind_rs_state; - sctx->b.b.delete_rasterizer_state = si_delete_rs_state; + sctx->b.create_rasterizer_state = si_create_rs_state; + sctx->b.bind_rasterizer_state = si_bind_rs_state; + sctx->b.delete_rasterizer_state = si_delete_rs_state; - sctx->b.b.create_depth_stencil_alpha_state = si_create_dsa_state; - sctx->b.b.bind_depth_stencil_alpha_state = si_bind_dsa_state; - sctx->b.b.delete_depth_stencil_alpha_state = si_delete_dsa_state; + sctx->b.create_depth_stencil_alpha_state = si_create_dsa_state; + sctx->b.bind_depth_stencil_alpha_state = si_bind_dsa_state; + sctx->b.delete_depth_stencil_alpha_state = si_delete_dsa_state; sctx->custom_dsa_flush = si_create_db_flush_dsa(sctx); sctx->custom_blend_resolve = si_create_blend_custom(sctx, V_028808_CB_RESOLVE); @@ -4558,32 +4558,32 @@ void si_init_state_functions(struct si_context *sctx) sctx->custom_blend_eliminate_fastclear = si_create_blend_custom(sctx, V_028808_CB_ELIMINATE_FAST_CLEAR); sctx->custom_blend_dcc_decompress = si_create_blend_custom(sctx, V_028808_CB_DCC_DECOMPRESS); - sctx->b.b.set_clip_state = si_set_clip_state; - sctx->b.b.set_stencil_ref = si_set_stencil_ref; + sctx->b.set_clip_state = si_set_clip_state; + sctx->b.set_stencil_ref = si_set_stencil_ref; - sctx->b.b.set_framebuffer_state = si_set_framebuffer_state; + sctx->b.set_framebuffer_state = si_set_framebuffer_state; - sctx->b.b.create_sampler_state = si_create_sampler_state; - sctx->b.b.delete_sampler_state = si_delete_sampler_state; + sctx->b.create_sampler_state = si_create_sampler_state; + sctx->b.delete_sampler_state = si_delete_sampler_state; - sctx->b.b.create_sampler_view = si_create_sampler_view; - sctx->b.b.sampler_view_destroy = si_sampler_view_destroy; + sctx->b.create_sampler_view = si_create_sampler_view; + sctx->b.sampler_view_destroy = si_sampler_view_destroy; - sctx->b.b.set_sample_mask = si_set_sample_mask; + sctx->b.set_sample_mask = si_set_sample_mask; - sctx->b.b.create_vertex_elements_state = si_create_vertex_elements; - sctx->b.b.bind_vertex_elements_state = si_bind_vertex_elements; - sctx->b.b.delete_vertex_elements_state = si_delete_vertex_element; - sctx->b.b.set_vertex_buffers = si_set_vertex_buffers; + sctx->b.create_vertex_elements_state = si_create_vertex_elements; + sctx->b.bind_vertex_elements_state = si_bind_vertex_elements; + sctx->b.delete_vertex_elements_state = si_delete_vertex_element; + sctx->b.set_vertex_buffers = si_set_vertex_buffers; - sctx->b.b.texture_barrier = si_texture_barrier; - sctx->b.b.memory_barrier = si_memory_barrier; - sctx->b.b.set_min_samples = si_set_min_samples; - sctx->b.b.set_tess_state = si_set_tess_state; + sctx->b.texture_barrier = si_texture_barrier; + sctx->b.memory_barrier = si_memory_barrier; + sctx->b.set_min_samples = si_set_min_samples; + sctx->b.set_tess_state = si_set_tess_state; - sctx->b.b.set_active_query_state = si_set_active_query_state; + sctx->b.set_active_query_state = si_set_active_query_state; - sctx->b.b.draw_vbo = si_draw_vbo; + sctx->b.draw_vbo = si_draw_vbo; si_init_config(sctx); } @@ -4596,7 +4596,7 @@ void si_init_screen_state_functions(struct si_screen *sscreen) static void si_set_grbm_gfx_index(struct si_context *sctx, struct si_pm4_state *pm4, unsigned value) { - unsigned reg = sctx->b.chip_class >= CIK ? R_030800_GRBM_GFX_INDEX : + unsigned reg = sctx->chip_class >= CIK ? R_030800_GRBM_GFX_INDEX : R_00802C_GRBM_GFX_INDEX; si_pm4_set_reg(pm4, reg, value); } @@ -4719,7 +4719,7 @@ si_write_harvested_raster_configs(struct si_context *sctx, } si_set_grbm_gfx_index(sctx, pm4, ~0); - if (sctx->b.chip_class >= CIK) { + if (sctx->chip_class >= CIK) { if ((num_se > 2) && ((!se_mask[0] && !se_mask[1]) || (!se_mask[2] && !se_mask[3]))) { raster_config_1 &= C_028354_SE_PAIR_MAP; @@ -4744,7 +4744,7 @@ static void si_set_raster_config(struct si_context *sctx, struct si_pm4_state *p unsigned rb_mask = sctx->screen->info.enabled_rb_mask; unsigned raster_config, raster_config_1; - switch (sctx->b.family) { + switch (sctx->family) { case CHIP_TAHITI: case CHIP_PITCAIRN: raster_config = 0x2a00126a; @@ -4828,7 +4828,7 @@ static void si_set_raster_config(struct si_context *sctx, struct si_pm4_state *p */ si_pm4_set_reg(pm4, R_028350_PA_SC_RASTER_CONFIG, raster_config); - if (sctx->b.chip_class >= CIK) + if (sctx->chip_class >= CIK) si_pm4_set_reg(pm4, R_028354_PA_SC_RASTER_CONFIG_1, raster_config_1); } else { @@ -4860,7 +4860,7 @@ static void si_init_config(struct si_context *sctx) si_pm4_cmd_end(pm4, false); } - if (sctx->b.chip_class <= VI) + if (sctx->chip_class <= VI) si_set_raster_config(sctx, pm4); si_pm4_set_reg(pm4, R_028A18_VGT_HOS_MAX_TESS_LEVEL, fui(64)); @@ -4868,7 +4868,7 @@ static void si_init_config(struct si_context *sctx) si_pm4_set_reg(pm4, R_028A1C_VGT_HOS_MIN_TESS_LEVEL, fui(0)); /* FIXME calculate these values somehow ??? */ - if (sctx->b.chip_class <= VI) { + if (sctx->chip_class <= VI) { si_pm4_set_reg(pm4, R_028A54_VGT_GS_PER_ES, SI_GS_PER_ES); si_pm4_set_reg(pm4, R_028A58_VGT_ES_PER_GS, 0x40); } @@ -4882,7 +4882,7 @@ static void si_init_config(struct si_context *sctx) si_pm4_set_reg(pm4, R_028AA0_VGT_INSTANCE_STEP_RATE_0, 1); if (!has_clear_state) si_pm4_set_reg(pm4, R_028AB8_VGT_VTX_CNT_EN, 0x0); - if (sctx->b.chip_class < CIK) + if (sctx->chip_class < CIK) si_pm4_set_reg(pm4, R_008A14_PA_CL_ENHANCE, S_008A14_NUM_CLIP_SEQ(3) | S_008A14_CLIP_VTX_REORDER_ENA(1)); @@ -4895,7 +4895,7 @@ static void si_init_config(struct si_context *sctx) /* CLEAR_STATE doesn't clear these correctly on certain generations. * I don't know why. Deduced by trial and error. */ - if (sctx->b.chip_class <= CIK) { + if (sctx->chip_class <= CIK) { si_pm4_set_reg(pm4, R_028B28_VGT_STRMOUT_DRAW_OPAQUE_OFFSET, 0); si_pm4_set_reg(pm4, R_028204_PA_SC_WINDOW_SCISSOR_TL, S_028204_WINDOW_OFFSET_DISABLE(1)); si_pm4_set_reg(pm4, R_028240_PA_SC_GENERIC_SCISSOR_TL, S_028240_WINDOW_OFFSET_DISABLE(1)); @@ -4926,7 +4926,7 @@ static void si_init_config(struct si_context *sctx) si_pm4_set_reg(pm4, R_02800C_DB_RENDER_OVERRIDE, 0); } - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { si_pm4_set_reg(pm4, R_030920_VGT_MAX_VTX_INDX, ~0); si_pm4_set_reg(pm4, R_030924_VGT_MIN_VTX_INDX, 0); si_pm4_set_reg(pm4, R_030928_VGT_INDX_OFFSET, 0); @@ -4940,8 +4940,8 @@ static void si_init_config(struct si_context *sctx) si_pm4_set_reg(pm4, R_028408_VGT_INDX_OFFSET, 0); } - if (sctx->b.chip_class >= CIK) { - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= CIK) { + if (sctx->chip_class >= GFX9) { si_pm4_set_reg(pm4, R_00B41C_SPI_SHADER_PGM_RSRC3_HS, S_00B41C_CU_EN(0xffff) | S_00B41C_WAVE_LIMIT(0x3F)); } else { @@ -4969,7 +4969,7 @@ static void si_init_config(struct si_context *sctx) sscreen->info.max_sh_per_se); unsigned late_alloc_limit; /* The limit is per SH. */ - if (sctx->b.family == CHIP_KABINI) { + if (sctx->family == CHIP_KABINI) { late_alloc_limit = 0; /* Potential hang on Kabini. */ } else if (num_cu_per_sh <= 4) { /* Too few available compute units per SH. Disallowing @@ -5001,7 +5001,7 @@ static void si_init_config(struct si_context *sctx) S_00B01C_CU_EN(0xffff) | S_00B01C_WAVE_LIMIT(0x3F)); } - if (sctx->b.chip_class >= VI) { + if (sctx->chip_class >= VI) { unsigned vgt_tess_distribution; vgt_tess_distribution = @@ -5013,8 +5013,8 @@ static void si_init_config(struct si_context *sctx) /* Testing with Unigine Heaven extreme tesselation yielded best results * with TRAP_SPLIT = 3. */ - if (sctx->b.family == CHIP_FIJI || - sctx->b.family >= CHIP_POLARIS10) + if (sctx->family == CHIP_FIJI || + sctx->family >= CHIP_POLARIS10) vgt_tess_distribution |= S_028B50_TRAP_SPLIT(3); si_pm4_set_reg(pm4, R_028B50_VGT_TESS_DISTRIBUTION, vgt_tess_distribution); @@ -5024,18 +5024,18 @@ static void si_init_config(struct si_context *sctx) } si_pm4_set_reg(pm4, R_028080_TA_BC_BASE_ADDR, border_color_va >> 8); - if (sctx->b.chip_class >= CIK) { + if (sctx->chip_class >= CIK) { si_pm4_set_reg(pm4, R_028084_TA_BC_BASE_ADDR_HI, S_028084_ADDRESS(border_color_va >> 40)); } si_pm4_add_bo(pm4, sctx->border_color_buffer, RADEON_USAGE_READ, RADEON_PRIO_BORDER_COLORS); - if (sctx->b.chip_class >= GFX9) { + if (sctx->chip_class >= GFX9) { unsigned num_se = sscreen->info.max_se; unsigned pc_lines = 0; - switch (sctx->b.family) { + switch (sctx->family) { case CHIP_VEGA10: case CHIP_VEGA12: pc_lines = 4096; |