r300g: random hyperz cleanups
authorMarek Olšák <maraeo@gmail.com>
Fri, 11 Jan 2013 16:10:36 +0000 (17:10 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 14 Jan 2013 02:11:42 +0000 (03:11 +0100)
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_context.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 46578318af2c51bd1f677a69b9069a4db17e41f0..2953764354240190ae6f3dd252fb4f0d6d5ded64 100644 (file)
@@ -237,7 +237,7 @@ static void r300_clear(struct pipe_context* pipe,
     uint32_t height = fb->height;
     uint32_t hyperz_dcv = hyperz->zb_depthclearvalue;
 
-    /* Enable fast Z clear.
+    /* Use fast Z clear.
      * The zbuffer must be in micro-tiled mode, otherwise it locks up. */
     if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
         boolean zmask_clear, hiz_clear;
index b498454561d868bb718a6a36b327a16c4a64b4b3..0ac41471650de5694c5d21c66d1c44297fbc5f35 100644 (file)
@@ -200,9 +200,8 @@ static boolean r300_setup_atoms(struct r300_context* r300)
     /* TX. */
     R300_INIT_ATOM(texture_cache_inval, 2);
     R300_INIT_ATOM(textures_state, 0);
-    /* HiZ Clear */
+    /* Clear commands */
     R300_INIT_ATOM(hiz_clear, r300->screen->caps.hiz_ram > 0 ? 6 : 0);
-    /* zmask clear */
     R300_INIT_ATOM(zmask_clear, r300->screen->caps.zmask_ram > 0 ? 6 : 0);
     /* ZB (unpipelined), SU. */
     R300_INIT_ATOM(query_start, 4);
index bcfb448db5d0cf803b8312951d5681202d659aa8..b8a876c166241bba90211a6a9647da0693953c43 100644 (file)
@@ -101,7 +101,8 @@ static struct util_hash_table *fd_tab = NULL;
 static boolean radeon_set_fd_access(struct radeon_drm_cs *applier,
                                     struct radeon_drm_cs **owner,
                                     pipe_mutex *mutex,
-                                    unsigned request, boolean enable)
+                                    unsigned request, const char *request_name,
+                                    boolean enable)
 {
     struct drm_radeon_info info;
     unsigned value = enable ? 1 : 0;
@@ -136,17 +137,13 @@ static boolean radeon_set_fd_access(struct radeon_drm_cs *applier,
     if (enable) {
         if (value) {
             *owner = applier;
-            if (request == RADEON_INFO_WANT_HYPERZ) {
-                printf("radeon: Acquired Hyper-Z.\n");
-            }
+            printf("radeon: Acquired access to %s.\n", request_name);
             pipe_mutex_unlock(*mutex);
             return TRUE;
         }
     } else {
         *owner = NULL;
-        if (request == RADEON_INFO_WANT_HYPERZ) {
-            printf("radeon: Released Hyper-Z.\n");
-        }
+        printf("radeon: Released access to %s.\n", request_name);
     }
 
     pipe_mutex_unlock(*mutex);
@@ -426,16 +423,14 @@ static boolean radeon_cs_request_feature(struct radeon_winsys_cs *rcs,
     case RADEON_FID_R300_HYPERZ_ACCESS:
         return radeon_set_fd_access(cs, &cs->ws->hyperz_owner,
                                     &cs->ws->hyperz_owner_mutex,
-                                    RADEON_INFO_WANT_HYPERZ, enable);
+                                    RADEON_INFO_WANT_HYPERZ, "Hyper-Z",
+                                    enable);
 
     case RADEON_FID_R300_CMASK_ACCESS:
-        if (debug_get_bool_option("RADEON_CMASK", FALSE)) {
-            return radeon_set_fd_access(cs, &cs->ws->cmask_owner,
-                                        &cs->ws->cmask_owner_mutex,
-                                        RADEON_INFO_WANT_CMASK, enable);
-        } else {
-            return FALSE;
-        }
+        return radeon_set_fd_access(cs, &cs->ws->cmask_owner,
+                                    &cs->ws->cmask_owner_mutex,
+                                    RADEON_INFO_WANT_CMASK, "AA optimizations",
+                                    enable);
     }
     return FALSE;
 }