freedreno: Rename the UBWC layer size field and store it as bytes.
[mesa.git] / src / freedreno / fdl / freedreno_layout.h
index be73a24ccc56988a67a71938d6d61f0f642fc12a..7230d337a484a741453f05e65d1b393f1e4180ea 100644 (file)
@@ -92,6 +92,7 @@ struct fdl_layout {
        struct fdl_slice slices[FDL_MAX_MIP_LEVELS];
        struct fdl_slice ubwc_slices[FDL_MAX_MIP_LEVELS];
        uint32_t layer_size;
+       uint32_t ubwc_layer_size; /* in bytes */
        bool layer_first : 1;    /* see above description */
 
        /* Note that for tiled textures, beyond a certain mipmap level (ie.
@@ -108,10 +109,10 @@ struct fdl_layout {
        uint8_t cpp;
 
        uint32_t width0, height0, depth0;
+       uint32_t nr_samples;
+       enum pipe_format format;
 
        uint32_t size; /* Size of the whole image, in bytes. */
-
-       uint32_t ubwc_size;
 };
 
 static inline uint32_t
@@ -136,7 +137,7 @@ fdl_ubwc_offset(const struct fdl_layout *layout, unsigned level, unsigned layer)
        /* for now this doesn't do anything clever, but when UBWC is enabled
         * for multi layer/level images, it will.
         */
-       if (layout->ubwc_size) {
+       if (layout->ubwc_layer_size) {
                assert(level == 0);
                assert(layer == 0);
        }
@@ -164,7 +165,7 @@ fdl_tile_mode(const struct fdl_layout *layout, int level)
 static inline bool
 fdl_ubwc_enabled(const struct fdl_layout *layout, int level)
 {
-       return layout->ubwc_size && fdl_tile_mode(layout, level);
+       return layout->ubwc_layer_size && fdl_tile_mode(layout, level);
 }
 
 void
@@ -174,6 +175,13 @@ void
 fdl6_layout(struct fdl_layout *layout,
                enum pipe_format format, uint32_t nr_samples,
                uint32_t width0, uint32_t height0, uint32_t depth0,
-               uint32_t mip_levels, uint32_t array_size, bool is_3d);
+               uint32_t mip_levels, uint32_t array_size, bool is_3d, bool ubwc);
+
+void
+fdl_dump_layout(struct fdl_layout *layout);
+
+void
+fdl6_get_ubwc_blockwidth(struct fdl_layout *layout,
+               uint32_t *blockwidth, uint32_t *blockheight);
 
 #endif /* FREEDRENO_LAYOUT_H_ */