iris: Define MCS_CCS state transitions and usages
authorSagar Ghuge <sagar.ghuge@intel.com>
Wed, 18 Sep 2019 20:15:47 +0000 (13:15 -0700)
committerSagar Ghuge <sagar.ghuge@intel.com>
Mon, 28 Oct 2019 21:02:01 +0000 (14:02 -0700)
v2: 1) Fix assertion check (Nanley Chery)
    2) Correct commit subject (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_resource.c

index f4b5002bd5bffb803b48eb8b1bc35d056202d089..d40ec265f5758381e868012f50d729d7c4fa5823 100644 (file)
@@ -522,7 +522,7 @@ iris_mcs_partial_resolve(struct iris_context *ice,
    //DBG("%s to mt %p layers %u-%u\n", __FUNCTION__, mt,
        //start_layer, start_layer + num_layers - 1);
 
-   assert(res->aux.usage == ISL_AUX_USAGE_MCS);
+   assert(isl_aux_usage_has_mcs(res->aux.usage));
 
    struct blorp_surf surf;
    iris_blorp_surf_for_resource(&ice->vtbl, &surf, &res->base, res->aux.usage,
@@ -989,7 +989,7 @@ iris_resource_prepare_mcs_access(struct iris_context *ice,
                                  enum isl_aux_usage aux_usage,
                                  bool fast_clear_supported)
 {
-   assert(aux_usage == ISL_AUX_USAGE_MCS);
+   assert(isl_aux_usage_has_mcs(aux_usage));
 
    switch (iris_resource_get_aux_state(res, 0, layer)) {
    case ISL_AUX_STATE_CLEAR:
@@ -1018,7 +1018,7 @@ iris_resource_finish_mcs_write(struct iris_context *ice,
                                uint32_t layer,
                                enum isl_aux_usage aux_usage)
 {
-   assert(aux_usage == ISL_AUX_USAGE_MCS);
+   assert(isl_aux_usage_has_mcs(aux_usage));
 
    switch (iris_resource_get_aux_state(res, 0, layer)) {
    case ISL_AUX_STATE_CLEAR:
@@ -1162,6 +1162,7 @@ iris_resource_prepare_access(struct iris_context *ice,
       break;
 
    case ISL_AUX_USAGE_MCS:
+   case ISL_AUX_USAGE_MCS_CCS:
       assert(start_level == 0 && num_levels == 1);
       const uint32_t level_layers =
          miptree_layer_range_length(res, 0, start_layer, num_layers);
@@ -1220,6 +1221,7 @@ iris_resource_finish_write(struct iris_context *ice,
       break;
 
    case ISL_AUX_USAGE_MCS:
+   case ISL_AUX_USAGE_MCS_CCS:
       for (uint32_t a = 0; a < num_layers; a++) {
          iris_resource_finish_mcs_write(ice, res, start_layer + a,
                                         aux_usage);
@@ -1360,7 +1362,8 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
       break;
 
    case ISL_AUX_USAGE_MCS:
-      return ISL_AUX_USAGE_MCS;
+   case ISL_AUX_USAGE_MCS_CCS:
+      return res->aux.usage;
 
    case ISL_AUX_USAGE_CCS_D:
    case ISL_AUX_USAGE_CCS_E:
@@ -1441,7 +1444,8 @@ iris_resource_render_aux_usage(struct iris_context *ice,
 
    switch (res->aux.usage) {
    case ISL_AUX_USAGE_MCS:
-      return ISL_AUX_USAGE_MCS;
+   case ISL_AUX_USAGE_MCS_CCS:
+      return res->aux.usage;
 
    case ISL_AUX_USAGE_CCS_D:
    case ISL_AUX_USAGE_CCS_E:
index 5a3c271e5595f01a93b3fe0505d0d70c600c43b7..0050d2615d6c450c269210f7fb26cf824911d89f 100644 (file)
@@ -518,6 +518,7 @@ iris_resource_configure_aux(struct iris_screen *screen,
       initial_state = ISL_AUX_STATE_AUX_INVALID;
       break;
    case ISL_AUX_USAGE_MCS:
+   case ISL_AUX_USAGE_MCS_CCS:
       /* The Ivybridge PRM, Vol 2 Part 1 p326 says:
        *
        *    "When MCS buffer is enabled and bound to MSRT, it is required