- /* Format properties. */
- unsigned blk_w:4;
- unsigned blk_h:4;
- unsigned bpe:5;
- /* Number of mipmap levels where DCC is enabled starting from level 0.
- * Non-zero levels may be disabled due to alignment constraints, but not
- * the first level.
- */
- unsigned num_dcc_levels:4;
- unsigned is_linear:1;
- unsigned has_stencil:1;
- /* This might be true even if micro_tile_mode isn't displayable or rotated. */
- unsigned is_displayable:1;
- /* Displayable, thin, depth, rotated. AKA D,S,Z,R swizzle modes. */
- unsigned micro_tile_mode:3;
- uint32_t flags;
-
- /* These are return values. Some of them can be set by the caller, but
- * they will be treated as hints (e.g. bankw, bankh) and might be
- * changed by the calculator.
- */
-
- /* Tile swizzle can be OR'd with low bits of the BASE_256B address.
- * The value is the same for all mipmap levels. Supported tile modes:
- * - GFX6: Only macro tiling.
- * - GFX9: Only *_X and *_T swizzle modes. Level 0 must not be in the mip
- * tail.
- *
- * Only these surfaces are allowed to set it:
- * - color (if it doesn't have to be displayable)
- * - DCC (same tile swizzle as color)
- * - FMASK
- * - CMASK if it's TC-compatible or if the gen is GFX9
- * - depth/stencil if HTILE is not TC-compatible and if the gen is not GFX9
- */
- uint8_t tile_swizzle;
- uint8_t fmask_tile_swizzle;
-
- uint64_t surf_size;
- uint64_t fmask_size;
- uint32_t surf_alignment;
- uint32_t fmask_alignment;
-
- /* DCC and HTILE are very small. */
- uint32_t dcc_size;
- uint32_t dcc_alignment;
-
- uint32_t htile_size;
- uint32_t htile_slice_size;
- uint32_t htile_alignment;
-
- uint32_t cmask_size;
- uint32_t cmask_alignment;
-
- union {
- /* Return values for GFX8 and older.
- *
- * Some of them can be set by the caller if certain parameters are
- * desirable. The allocator will try to obey them.
- */
- struct legacy_surf_layout legacy;
-
- /* GFX9+ return values. */
- struct gfx9_surf_layout gfx9;
- } u;
+ /* Format properties. */
+ unsigned blk_w : 4;
+ unsigned blk_h : 4;
+ unsigned bpe : 5;
+ /* Number of mipmap levels where DCC is enabled starting from level 0.
+ * Non-zero levels may be disabled due to alignment constraints, but not
+ * the first level.
+ */
+ unsigned num_dcc_levels : 4;
+ unsigned is_linear : 1;
+ unsigned has_stencil : 1;
+ /* This might be true even if micro_tile_mode isn't displayable or rotated. */
+ unsigned is_displayable : 1;
+ /* Displayable, thin, depth, rotated. AKA D,S,Z,R swizzle modes. */
+ unsigned micro_tile_mode : 3;
+ uint32_t flags;
+
+ /* These are return values. Some of them can be set by the caller, but
+ * they will be treated as hints (e.g. bankw, bankh) and might be
+ * changed by the calculator.
+ */
+
+ /* Tile swizzle can be OR'd with low bits of the BASE_256B address.
+ * The value is the same for all mipmap levels. Supported tile modes:
+ * - GFX6: Only macro tiling.
+ * - GFX9: Only *_X and *_T swizzle modes. Level 0 must not be in the mip
+ * tail.
+ *
+ * Only these surfaces are allowed to set it:
+ * - color (if it doesn't have to be displayable)
+ * - DCC (same tile swizzle as color)
+ * - FMASK
+ * - CMASK if it's TC-compatible or if the gen is GFX9
+ * - depth/stencil if HTILE is not TC-compatible and if the gen is not GFX9
+ */
+ uint8_t tile_swizzle;
+ uint8_t fmask_tile_swizzle;
+
+ uint64_t surf_size;
+ uint64_t fmask_size;
+ uint32_t surf_alignment;
+ uint32_t fmask_alignment;
+
+ /* DCC and HTILE are very small. */
+ uint32_t dcc_size;
+ uint32_t dcc_slice_size;
+ uint32_t dcc_alignment;
+
+ uint32_t htile_size;
+ uint32_t htile_slice_size;
+ uint32_t htile_alignment;
+
+ uint32_t cmask_size;
+ uint32_t cmask_slice_size;
+ uint32_t cmask_alignment;
+
+ /* All buffers combined. */
+ uint64_t htile_offset;
+ uint64_t fmask_offset;
+ uint64_t cmask_offset;
+ uint64_t dcc_offset;
+ uint64_t display_dcc_offset;
+ uint64_t dcc_retile_map_offset;
+ uint64_t total_size;
+ uint32_t alignment;
+
+ union {
+ /* Return values for GFX8 and older.
+ *
+ * Some of them can be set by the caller if certain parameters are
+ * desirable. The allocator will try to obey them.
+ */
+ struct legacy_surf_layout legacy;
+
+ /* GFX9+ return values. */
+ struct gfx9_surf_layout gfx9;
+ } u;