radeonsi: Use defines for CONTEXT_CONTROL instead of magic values.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 20 Apr 2016 23:19:28 +0000 (01:19 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 21 Apr 2016 10:50:58 +0000 (12:50 +0200)
v2: Use field names provided by Nicolai.
v3: Updated to use CONTEXT_CONTROL prefix.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/sid.h

index 305a70b9dfaba0fc38ced3eac64feab66e26cfd9..8603f3ecb6b1702fd8f316eb2ca29a334c6fea71 100644 (file)
@@ -3821,8 +3821,8 @@ static void si_init_config(struct si_context *sctx)
                return;
 
        si_pm4_cmd_begin(pm4, PKT3_CONTEXT_CONTROL);
-       si_pm4_cmd_add(pm4, 0x80000000);
-       si_pm4_cmd_add(pm4, 0x80000000);
+       si_pm4_cmd_add(pm4, CONTEXT_CONTROL_LOAD_ENABLE(1));
+       si_pm4_cmd_add(pm4, CONTEXT_CONTROL_SHADOW_ENABLE(1));
        si_pm4_cmd_end(pm4, false);
 
        si_pm4_set_reg(pm4, R_028A18_VGT_HOS_MAX_TESS_LEVEL, fui(64));
index 516e114a6c0d85d7bb5abc9341ac356055721a54..9daefdb5f31d18977c5b66cc4c8e5c707df1dbee 100644 (file)
@@ -88,6 +88,9 @@
 #define PKT3_INDEX_BASE                        0x26
 #define PKT3_DRAW_INDEX_2                      0x27
 #define PKT3_CONTEXT_CONTROL                   0x28
+#define     CONTEXT_CONTROL_LOAD_ENABLE(x)     (((x) & 0x1) << 31)
+#define     CONTEXT_CONTROL_LOAD_CE_RAM(x)     (((x) & 0x1) << 28)
+#define     CONTEXT_CONTROL_SHADOW_ENABLE(x)   (((x) & 0x1) << 31)
 #define PKT3_INDEX_TYPE                        0x2A
 #define PKT3_DRAW_INDIRECT_MULTI               0x2C
 #define PKT3_DRAW_INDEX_AUTO                   0x2D