r300g: cleanup tiling flags propagation
authorMarek Olšák <maraeo@gmail.com>
Sun, 21 Mar 2010 20:34:57 +0000 (21:34 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 21 Mar 2010 20:54:06 +0000 (21:54 +0100)
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r300/r300_winsys.h
src/gallium/winsys/drm/radeon/core/radeon_buffer.h
src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c
src/gallium/winsys/drm/radeon/core/radeon_r300.c

index f396b42e9506e32e0274baa5e172c32222150f02..397369015a517e987bd49838fe550528777fe1b1 100644 (file)
@@ -528,8 +528,8 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300,
         if (tex) {
             r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
                                             tex->pitch[0],
-                                            tex->microtile != 0,
-                                            tex->macrotile != 0);
+                                            tex->microtile,
+                                            tex->macrotile);
         }
     }
     if (old_state->zsbuf &&
@@ -540,8 +540,8 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300,
         if (tex) {
             r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
                                             tex->pitch[0],
-                                            tex->microtile != 0,
-                                            tex->macrotile != 0);
+                                            tex->microtile,
+                                            tex->macrotile);
         }
     }
 
@@ -552,8 +552,8 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300,
 
         r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
                                         tex->pitch[level],
-                                        tex->microtile != 0,
-                                        tex->mip_macrotile[level] != 0);
+                                        tex->microtile,
+                                        tex->mip_macrotile[level]);
     }
     if (new_state->zsbuf) {
         tex = (struct r300_texture*)new_state->zsbuf->texture;
@@ -561,8 +561,8 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300,
 
         r300->rws->buffer_set_tiling(r300->rws, tex->buffer,
                                         tex->pitch[level],
-                                        tex->microtile != 0,
-                                        tex->mip_macrotile[level] != 0);
+                                        tex->microtile,
+                                        tex->mip_macrotile[level]);
     }
 }
 
index cb53619fe5ef450ae1329bd295688829d86854e4..2fa656067fa91c1aab8b521b839ba5b66e1b797b 100644 (file)
@@ -777,8 +777,8 @@ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen,
                                     tex->size);
     rws->buffer_set_tiling(rws, tex->buffer,
                           tex->pitch[0],
-                          tex->microtile != R300_BUFFER_LINEAR,
-                          tex->macrotile != R300_BUFFER_LINEAR);
+                          tex->microtile,
+                          tex->macrotile);
 
     if (!tex->buffer) {
         FREE(tex);
index cd03355ab3e8a16f5123d11d4bcfb70c95112494..93f9dd7cfac3b4177da44584925e3662d7cb1ce0 100644 (file)
@@ -148,8 +148,8 @@ struct r300_winsys_screen {
     void (*buffer_set_tiling)(struct r300_winsys_screen *winsys,
                               struct r300_winsys_buffer *buffer,
                               uint32_t pitch,
-                              boolean microtiled,
-                              boolean macrotiled);
+                              enum r300_buffer_tiling microtiled,
+                              enum r300_buffer_tiling macrotiled);
 
     uint32_t (*get_value)(struct r300_winsys_screen *winsys,
                          enum r300_value_id vid);
index 3d14c861dfacaf8b98ddb8f5e2f7e491f07d0843..218a3763018057d7416c6a43e9e411ffa95422d9 100644 (file)
@@ -72,7 +72,10 @@ void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf,
 struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr,
                                                              uint32_t handle);
 
-void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch);
+void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
+                                  enum r300_buffer_tiling microtiled,
+                                  enum r300_buffer_tiling macrotiled,
+                                  uint32_t pitch);
 
 void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr);
 
index a8a7c45a96f3adc0b558ee8f855184380deafefb..0a86acc228473eac4988c853482cc78ac21167ca 100644 (file)
@@ -306,13 +306,16 @@ boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
 }
                                           
 
-void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch)
+void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
+                                  enum r300_buffer_tiling microtiled,
+                                  enum r300_buffer_tiling macrotiled,
+                                  uint32_t pitch)
 {
     struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
     uint32_t flags = 0, old_flags, old_pitch;
-    if (microtiled)
+    if (microtiled == R300_BUFFER_TILED)
        flags |= RADEON_BO_FLAGS_MICRO_TILE;
-    if (macrotiled)
+    if (macrotiled == R300_BUFFER_TILED)
        flags |= RADEON_BO_FLAGS_MACRO_TILE;
 
     radeon_bo_get_tiling(buf->bo, &old_flags, &old_pitch);
index 62d66d31dc12a084133855bf08f00c1831a6d98c..0c0fee1586cd9e53ba6c9dac4e21b81cfd29d770 100644 (file)
@@ -65,8 +65,8 @@ static void radeon_r300_winsys_buffer_destroy(struct r300_winsys_buffer *buf)
 static void radeon_r300_winsys_buffer_set_tiling(struct r300_winsys_screen *rws,
                                                  struct r300_winsys_buffer *buf,
                                                  uint32_t pitch,
-                                                 boolean microtiled,
-                                                 boolean macrotiled)
+                                                 enum r300_buffer_tiling microtiled,
+                                                 enum r300_buffer_tiling macrotiled)
 {
     struct pb_buffer *_buf = radeon_pb_buffer(buf);
     radeon_drm_bufmgr_set_tiling(_buf, microtiled, macrotiled, pitch);