gallium/radeon: let drivers specify SC_MODE_CNTL_1 fields
authorMarek Olšák <marek.olsak@amd.com>
Thu, 23 Jun 2016 20:24:07 +0000 (22:24 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 24 Jun 2016 14:24:53 +0000 (16:24 +0200)
radeonsi will set more fields

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/radeon/cayman_msaa.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_state.c

index 4a25582f660d4a9d6056c4345b047cb2ea3e4c04..0b8488d3aa3c2b2ea577d5e9ba19a0362f997ca3 100644 (file)
@@ -1670,8 +1670,13 @@ static void evergreen_emit_framebuffer_state(struct r600_context *rctx, struct r
        if (rctx->b.chip_class == EVERGREEN) {
                evergreen_emit_msaa_state(rctx, rctx->framebuffer.nr_samples, rctx->ps_iter_samples);
        } else {
+               unsigned sc_mode_cntl_1 =
+                       EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
+                       EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1);
+
                cayman_emit_msaa_sample_locs(cs, rctx->framebuffer.nr_samples);
-               cayman_emit_msaa_config(cs, rctx->framebuffer.nr_samples, rctx->ps_iter_samples, 0);
+               cayman_emit_msaa_config(cs, rctx->framebuffer.nr_samples,
+                                       rctx->ps_iter_samples, 0, sc_mode_cntl_1);
        }
 }
 
index 9412e8962c4c77b12f8dbe9cb6e87adfd26028e4..a9ec4c38754500ca5d29de8bce2495283ac55076 100644 (file)
@@ -195,7 +195,8 @@ void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples)
 }
 
 void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
-                            int ps_iter_samples, int overrast_samples)
+                            int ps_iter_samples, int overrast_samples,
+                            unsigned sc_mode_cntl_1)
 {
        int setup_samples = nr_samples > 1 ? nr_samples :
                            overrast_samples > 1 ? overrast_samples : 0;
@@ -230,16 +231,14 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
                                               S_028804_STATIC_ANCHOR_ASSOCIATIONS(1));
                        radeon_set_context_reg(cs, EG_R_028A4C_PA_SC_MODE_CNTL_1,
                                               EG_S_028A4C_PS_ITER_SAMPLE(ps_iter_samples > 1) |
-                                              EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
-                                              EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1));
+                                              sc_mode_cntl_1);
                } else if (overrast_samples > 1) {
                        radeon_set_context_reg(cs, CM_R_028804_DB_EQAA,
                                               S_028804_HIGH_QUALITY_INTERSECTIONS(1) |
                                               S_028804_STATIC_ANCHOR_ASSOCIATIONS(1) |
                                               S_028804_OVERRASTERIZATION_AMOUNT(log_samples));
                        radeon_set_context_reg(cs, EG_R_028A4C_PA_SC_MODE_CNTL_1,
-                                              EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
-                                              EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1));
+                                              sc_mode_cntl_1);
                }
        } else {
                radeon_set_context_reg_seq(cs, CM_R_028BDC_PA_SC_LINE_CNTL, 2);
@@ -250,7 +249,6 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
                                       S_028804_HIGH_QUALITY_INTERSECTIONS(1) |
                                       S_028804_STATIC_ANCHOR_ASSOCIATIONS(1));
                radeon_set_context_reg(cs, EG_R_028A4C_PA_SC_MODE_CNTL_1,
-                                      EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
-                                      EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1));
+                                      sc_mode_cntl_1);
        }
 }
index fe29f689a77035f29dde23a1f2b22c3c263beeda..8117c9a53cae8a051f569f15271f6bcb7e662c78 100644 (file)
@@ -727,7 +727,8 @@ void cayman_get_sample_position(struct pipe_context *ctx, unsigned sample_count,
 void cayman_init_msaa(struct pipe_context *ctx);
 void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples);
 void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
-                            int ps_iter_samples, int overrast_samples);
+                            int ps_iter_samples, int overrast_samples,
+                            unsigned sc_mode_cntl_1);
 
 
 /* Inline helpers. */
index 02890a1c27b30ad86adba2a1f7b7f7021f9f5f9d..f5da153a7ebf491fc727e0daed91989e996a192b 100644 (file)
@@ -2555,10 +2555,14 @@ static void si_emit_msaa_sample_locs(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;
+       unsigned sc_mode_cntl_1 =
+               S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
+               S_028A4C_FORCE_EOV_REZ_ENABLE(1);
 
        cayman_emit_msaa_config(cs, sctx->framebuffer.nr_samples,
                                sctx->ps_iter_samples,
-                               sctx->smoothing_enabled ? SI_NUM_SMOOTH_AA_SAMPLES : 0);
+                               sctx->smoothing_enabled ? SI_NUM_SMOOTH_AA_SAMPLES : 0,
+                               sc_mode_cntl_1);
 }